Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.TransformMethodSignature


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

            String methodName = transformation.newMemberName("environment_read", name);

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

            String body = String.format(
                    "return ($r) %s.%s($type);",
                    envField,
View Full Code Here


    {
        ClassTransformation transformation = mockClassTransformation();

        replay();

        TransformMethodSignature sig = new TransformMethodSignature(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

    {
        ClassTransformation transformation = mockClassTransformation();

        replay();

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

        MethodInvocationBuilder invoker = new MethodInvocationBuilder();

        assertEquals(invoker.buildMethodInvocation(sig, transformation), "myMethod(null)");
View Full Code Here

    {
        ClassTransformation transformation = mockClassTransformation();

        replay();

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

        MethodInvocationBuilder invoker = new MethodInvocationBuilder();

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

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

            String methodName = transformation.newMemberName("environment_read", name);

            TransformMethodSignature sig = new TransformMethodSignature(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);

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

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

            newMethod.setBody(null);

            _ctClass.addMethod(newMethod);

            TransformMethodSignature sig = getMethodSignature(newMethod);

            addMethodToDescription("add default", sig, "<default>");
        }
        catch (CannotCompileException ex)
        {
View Full Code Here

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

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

        Collections.sort(result);
View Full Code Here

        List<TransformMethodSignature> result = newList();

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

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

        Collections.sort(result);
View Full Code Here

        return result;
    }

    private TransformMethodSignature getMethodSignature(CtMethod method)
    {
        TransformMethodSignature 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 TransformMethodSignature(method.getModifiers(), type,
                        method.getName(), parameters, exceptions);

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

TOP

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

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.