Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.MethodSignature


    public void by_convention_on_component_id()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();

        MethodSignature signature = new MethodSignature("onAnyEventFromZork");

        train_findMethods(ct, signature);

        train_getMethodAnnotation(ct, signature, OnEvent.class, null);
View Full Code Here


        String[] eventTypes = new String[]
        { "gnip", "gnop" };
        String[] componentIds = new String[]
        { "zork" };

        MethodSignature signature = new MethodSignature("foo");

        train_findMethods(ct, signature);

        train_getMethodAnnotation(ct, signature, OnEvent.class, annotation);
View Full Code Here

    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "java.lang.String",
                "foo", null, null);

        train_findMethods(ct, signature);

        train_getMethodAnnotation(ct, signature, OnEvent.class, annotation);
View Full Code Here

    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "java.lang.String" }, null);

        train_findMethods(ct, signature);
View Full Code Here

    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

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

        train_findMethods(ct, signature);
View Full Code Here

    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "java.lang.String", "java.lang.Integer" }, null);

        train_findMethods(ct, signature);
View Full Code Here

    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "java.lang.String", OnEventWorker.OBJECT_ARRAY_TYPE, "java.lang.Integer" }, null);

        train_findMethods(ct, signature);

        train_getMethodAnnotation(ct, signature, OnEvent.class, annotation);

        train_value(annotation, new String[0]);
        train_component(annotation, new String[0]);

        train_getClassName(ct, "foo.Bar");

        // Notice that the context doesn't affect the indexing of the other parameters. Though it is
        // unlikely that a method would use both a context array and explicit context parameters.

        train_extendMethod(
                ct,
                TransformConstants.HANDLE_COMPONENT_EVENT,
                "{",
                BOILERPLATE_1,
                BOILERPLATE_2,
                String.format("$1.setSource(this, \"foo.Bar.%s\");", signature
                        .getMediumDescription()),
                "foo((java.lang.String)$1.coerceContext(0, \"java.lang.String\"), ",
                "$1.getContext(), ",
                "(java.lang.Integer)$1.coerceContext(1, \"java.lang.Integer\"));",
                "}");
View Full Code Here

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

            String methodName = transformation.newMemberName("environment_read", 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

        _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.