Package org.apache.tapestry.ioc.services

Examples of org.apache.tapestry.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 void addDelegateGetter(ClassFab cf, Class serviceInterface, String serviceId)
    {
        String body = format("return (%s) _creator.createObject();", serviceInterface.getName());

        MethodSignature sig = new MethodSignature(serviceInterface, "_delegate", null, null);

        cf.addMethod(Modifier.PRIVATE, sig, body);
    }
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

            filterMethods.add(mi.next());
        }

        while (!serviceMethods.isEmpty())
        {
            MethodSignature ms = serviceMethods.remove(0);

            addBridgeMethod(ms, filterMethods);
        }

        reportExtraFilterMethods(filterMethods);
View Full Code Here

    {
        Iterator i = filterMethods.iterator();

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

            _log.error(
                    ServiceMessages.extraFilterMethod(ms, _filterInterface, _serviceInterface),
                    null);
        }
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()", format(
                "<EnvironmentalProxy for %s>",
                serviceType.getName()));
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()",
                                        format("<EnvironmentalProxy for %s>", serviceType.getName()));
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

TOP

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