Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.MethodSignature


        replay();

        ClassTransformation ct = createClassTransformation(EventHandlerTarget.class, log);

        OnEvent annotation = ct.getMethodAnnotation(new MethodSignature("handler"), OnEvent.class);

        // Check that the attributes of the annotation match the expectation.

        assertEquals(annotation.value(), new String[]
        { "fred", "barney" });
View Full Code Here


        ClassTransformation ct = createClassTransformation(ParentClass.class, log);

        try
        {
            ct.getMethodAnnotation(new MethodSignature("foo"), OnEvent.class);
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(
View Full Code Here

            // Caching might be good for efficiency at some point.

            String methodName = transformation.newMemberName("environment_read_"
                    + InternalUtils.stripMemberPrefix(name));

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

            String body = String.format(
                    "return ($r) %s.%s($type);",
                    envField,
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 fieldType, String managerFieldName, String typeField)
    {
        String writeMethodName = transformation.newMemberName("write_"
                + InternalUtils.stripMemberPrefix(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 readMethodName = transformation.newMemberName("read_"
                + InternalUtils.stripMemberPrefix(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

        String fieldType = transformation.getFieldType(fieldName);
        String methodName = transformation.newMemberName("_read_inject_page_"
                + InternalUtils.stripMemberPrefix(fieldName));

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

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

        _resourcesFieldName = addInjectedFieldUncached(
                InternalComponentResources.class,
                "resources",
                null);

        MethodSignature sig = new MethodSignature(Modifier.PUBLIC | Modifier.FINAL,
                ComponentResources.class.getName(), "getComponentResources", null, null);

        addMethod(sig, "return " + _resourcesFieldName + ";");
    }
View Full Code Here

            newMethod.setBody(null);

            _ctClass.addMethod(newMethod);

            MethodSignature sig = getMethodSignature(newMethod);

            addMethodToDescription("add default", sig, "<default>");
        }
        catch (CannotCompileException ex)
        {
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.