Package org.apache.tapestry5.ioc.services

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


        ClassPath path = new LoaderClassPath(loader);

        classPool.appendClassPath(path);

        classSource = new CtClassSourceImpl(classPool, loader);

        try
        {
            loader.addTranslator(classPool, this);
        }
View Full Code Here


            builder.addln("return root;");

            builder.end();

            MethodSignature sig = new MethodSignature(rootType, "getRoot", new Class[]
            { Object.class }, null);

            classFab.addMethod(Modifier.PRIVATE, sig, builder.toString());
        }
View Full Code Here

            navBuilder.addln("return %s;", previousReference);

            navBuilder.end();

            MethodSignature sig = new MethodSignature(activeType, "navigate", new Class[]
            { rootType }, null);

            classFab.addMethod(Modifier.PRIVATE, sig, navBuilder.toString());

            createGetterAndSetter(activeType, sig, node);
View Full Code Here

                        return genericType != method.getReturnType();
                    }

                    public String getDescription()
                    {
                        return new MethodSignature(method).getUniqueId();
                    }

                    public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
                    {
                        return method.getAnnotation(annotationClass);
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())
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

    {
        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

        ClassFab cf = newClassFab("MyIntHolder", AbstractIntWrapper.class);

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

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(int.class, "getIntValue", null, null), "return _intValue;");

        Class targetClass = cf.createClass();
        Constructor c = targetClass.getConstructors()[0];

        AbstractIntWrapper targetBean = (AbstractIntWrapper) c.newInstance(new Object[] { new Integer(137) });
View Full Code Here

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

        cf.addInterface(SimpleService.class);

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(int.class, "add", new Class[] { int.class, int.class }, null),
                     "return $1 + $2;");

        Class targetClass = cf.createClass();

        SimpleService s = (SimpleService) targetClass.newInstance();
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.