Examples of MethodSignature


Examples of org.apache.hivemind.service.MethodSignature

    {
        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

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

        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

Examples of org.apache.tapestry.services.MethodSignature

    public void no_methods_with_annotation()
    {
        ClassTransformation tf = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

        MethodSignature sig = new MethodSignature("someRandomMethod");

        train_findMethods(tf, sig);

        train_getMethodAnnotation(tf, sig, SetupRender.class, null);
View Full Code Here

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

    private void processMethod(Method m, Map<String, MethodSignature> map)
    {
        toString |= isToString(m);

        MethodSignature sig = new MethodSignature(m);
        String uid = sig.getUniqueId();

        MethodSignature existing = map.get(uid);

        if (existing == null || sig.isOverridingSignatureOf(existing))
            map.put(uid, sig);
    }
View Full Code Here

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

            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

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

            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

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

                        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

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

        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

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

    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

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

    {
        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
TOP
Copyright © 2018 www.massapi.com. 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.