Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.MethodSignature


        {
            List<Annotation> annotations = findMethodAnnotations(method);

            if (findAnnotationInList(annotationClass, annotations) != null)
            {
                MethodSignature sig = getMethodSignature(method);
                result.add(sig);
            }
        }

        Collections.sort(result);
View Full Code Here


        List<MethodSignature> result = newList();

        for (CtMethod method : _ctClass.getDeclaredMethods())
        {
            MethodSignature sig = getMethodSignature(method);

            if (filter.accept(sig)) result.add(sig);
        }

        Collections.sort(result);
View Full Code Here

        return result;
    }

    private MethodSignature getMethodSignature(CtMethod method)
    {
        MethodSignature result = _methodSignatures.get(method);
        if (result == null)
        {
            try
            {
                String type = method.getReturnType().getName();
                String[] parameters = toTypeNames(method.getParameterTypes());
                String[] exceptions = toTypeNames(method.getExceptionTypes());

                result = new MethodSignature(method.getModifiers(), type, method.getName(),
                        parameters, exceptions);

                _methodSignatures.put(method, result);
            }
            catch (NotFoundException ex)
View Full Code Here

    {
        String methodName = newMemberName("write", fieldName);

        String fieldType = getFieldType(fieldName);

        MethodSignature sig = new MethodSignature(Modifier.PRIVATE, "void", methodName,
                new String[]
                { fieldType }, null);

        String message = ServicesMessages.readOnlyField(_ctClass.getName(), fieldName);
View Full Code Here

        builder.end();

        String methodName = transformation.newMemberName("update_parameter", parameterName);

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", methodName,
                new String[]
                { fieldType }, null);

        transformation.addMethod(signature, builder.toString());
View Full Code Here

        builder.addln("return result;");
        builder.end();

        String methodName = transformation.newMemberName("read_parameter", parameterName);

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, fieldType, methodName,
                null, null);

        transformation.addMethod(signature, builder.toString());

        transformation.replaceReadAccess(fieldName, methodName);
View Full Code Here

        String pageName = annotation.value();

        String fieldType = transformation.getFieldType(fieldName);
        String methodName = transformation.newMemberName("read_inject_page", fieldName);

        MethodSignature sig = new MethodSignature(Modifier.PRIVATE, fieldType, methodName, null,
                null);

        BodyBuilder builder = new BodyBuilder();
        builder.begin();
View Full Code Here

    private void replaceWrite(ClassTransformation transformation, String fieldName,
            String fieldType, String managerFieldName, String typeField)
    {
        String writeMethodName = transformation.newMemberName("write", fieldName);

        MethodSignature writeSignature = new MethodSignature(Modifier.PRIVATE, "void",
                writeMethodName, new String[]
                { fieldType }, null);

        String body = String.format("%s.set(%s, $1);", managerFieldName, typeField);
View Full Code Here

            String fieldType, String managerFieldName, String typeField)
    {

        String readMethodName = transformation.newMemberName("read", fieldName);

        MethodSignature readMethodSignature = new MethodSignature(Modifier.PRIVATE, fieldType,
                readMethodName, null, null);

        String body = String.format(
                "return (%s) %s.get(%s);",
                fieldType,
View Full Code Here

    {
        ClassTransformation transformation = newClassTransformation();

        replay();

        MethodSignature sig = new MethodSignature(Modifier.PUBLIC, "void", "myMethod", new String[]
        { MARKUP_WRITER_CLASS_NAME }, null);

        MethodInvocationBuilder invoker = new MethodInvocationBuilder();

        invoker.addParameter(MARKUP_WRITER_CLASS_NAME, "$1");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.MethodSignature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.