Package org.apache.tapestry5.ioc.services

Examples of org.apache.tapestry5.ioc.services.MethodSignature


    {
        Iterator i = filterMethods.iterator();

        while (i.hasNext())
        {
            MethodSignature fms = (MethodSignature) i.next();

            int position = filterMethodAnalyzer.findServiceInterfacePosition(ms, fms);

            if (position >= 0)
            {
View Full Code Here


{
    private MethodSignature find(Class target, String name)
    {
        Method method = findMethod(target, name);

        return new MethodSignature(method);
    }
View Full Code Here

    private void assertPosition(String methodName, int expected)
    {
        FilterMethodAnalyzer a = new FilterMethodAnalyzer(SampleService.class);

        MethodSignature ms = find(SampleService.class, methodName);
        MethodSignature fms = find(SampleFilter.class, methodName);

        assertEquals(expected, a.findServiceInterfacePosition(ms, fms));
    }
View Full Code Here

        classFab.addField("_serviceType", Class.class);

        classFab.addConstructor(new Class[] { Environment.class, Class.class }, null,
                                "{ environment = $1; _serviceType = $2; }");

        classFab.addMethod(Modifier.PRIVATE, new MethodSignature(serviceType, "_delegate", null, null),
                           "return ($r) environment.peekRequired(_serviceType); ");

        classFab.proxyMethodsToDelegate(serviceType, "_delegate()",
                                        String.format("<EnvironmentalProxy for %s>", serviceType.getName()));
View Full Code Here

        builder.addln("return ($r) invocation.getResult();");

        builder.end();

        interceptorClassFab.addMethod(Modifier.PUBLIC, new MethodSignature(method), builder.toString());
    }
View Full Code Here

        MethodIterator mi = new MethodIterator(serviceInterface);

        while (mi.hasNext())
        {
            MethodSignature sig = mi.next();

            // ($r) properly handles void methods for us, which keeps this simple.

            String body = format("return ($r) %s.%s($$);", delegateExpression, sig.getName());

            addMethod(Modifier.PUBLIC, sig, body);
        }

        if (!mi.getToString()) addToString(toString);
View Full Code Here

    public void addToString(String toString)
    {
        lock.check();

        MethodSignature sig = new MethodSignature(String.class, "toString", null, null);

        // TODO: Very simple quoting here, will break down if the string itself contains
        // double quotes or various other characters that need escaping.

        addMethod(Modifier.PUBLIC, sig, format("return \"%s\";", toString));
View Full Code Here

                "org.apache.tapestry5.ioc.internal.services.LineNumberBean.wilma(int[], Double[][][]) (at LineNumberBean.java:34)");
    }

    private void addRunMethod(ClassFab cf)
    {
        cf.addMethod(Modifier.PUBLIC, new MethodSignature(void.class, "run", null, null), " { } ");
    }
View Full Code Here

    {
        ClassFab cf = newClassFab("TargetBean", Object.class);

        cf.addField("_stringValue", String.class);

        MethodSignature setStringValue = new MethodSignature(void.class, "setStringValue", new Class[] { String.class },
                                                             null);

        cf.addMethod(Modifier.PUBLIC, setStringValue, "_stringValue = $1;");

        MethodSignature getStringValue = new MethodSignature(String.class, "getStringValue", null, null);

        cf.addMethod(Modifier.PUBLIC, getStringValue, "return _stringValue;");

        Class targetClass = cf.createClass();
View Full Code Here

        ClassFab cf = newClassFab("ConstructableBean", Object.class);

        cf.addField("_stringValue", String.class);
        cf.addConstructor(new Class[] { String.class }, null, "{ _stringValue = $1; }");

        MethodSignature getStringValue = new MethodSignature(String.class, "getStringValue", null, null);

        cf.addMethod(Modifier.PUBLIC, getStringValue, "return _stringValue;");

        Class targetClass = cf.createClass();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.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.