Examples of createClass()


Examples of org.apache.hivemind.service.impl.ClassFabImpl.createClass()

        __CLOVER_367_0.S[8040]++;ClassFab classFab = new ClassFabImpl(_classSource, newClass);

        __CLOVER_367_0.S[8041]++;addMissingProperties(classFab, info);

        __CLOVER_367_0.S[8042]++;return classFab.createClass();
    } finally { }}

    public Class getEnhancedClass(Class inputClass)
    {try { __CLOVER_367_0.M[1837]++;
        __CLOVER_367_0.S[8043]++;Class result = (Class) _classes.get(inputClass);
View Full Code Here

Examples of org.apache.tapestry.ioc.services.ClassFab.createClass()

        cf.addConstructor(new Class[]
        { serviceInterface, ServiceLogger.class }, null, "{ _delegate = $1; _logger = $2; }");

        addMethods(cf, serviceInterface, serviceId);

        return cf.createClass();
    }

    private void addMethods(ClassFab cf, Class serviceInterface, String serviceId)
    {
        MethodIterator mi = new MethodIterator(serviceInterface);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

        ClassFab cf = factory.newClass(clazz.getName() + "$$Proxy", clazz);

        cf.addInterface(Serializable.class);

        Class proxyClass = cf.createClass();

        SimpleBean simple = (SimpleBean) proxyClass.newInstance();

        assertTrue(simple instanceof Serializable);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

            cf.addMethod(Modifier.PUBLIC, INVOKE_SIGNATURE, body);

            cf.addToString(String.format("MethodAccess[method %s of class %s]", sig.getMediumDescription(),
                    getClassName()));

            Class accessClass = cf.createClass();

            try
            {
                Object accessInstance = accessClass.newInstance();
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

        // base class) into the new component instance's constructor

        cf.addMethod(Modifier.PUBLIC, NEW_INSTANCE_SIGNATURE,
                String.format("return new %s($1, constructorArgs);", componentClassName));

        Class instantiatorClass = cf.createClass();

        try
        {
            Object instance = instantiatorClass.getConstructors()[0].newInstance(componentModel,
                    String.format("Instantiator[%s]", componentClassName), componentConstructorArgs);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

            addFieldAccessReadMethod(cf, reader);
            addFieldAccessWriteMethod(cf, writer);

            cf.addToString(String.format("FieldAccess<%s.%s>", getClassName(), name));

            Class accessClass = cf.createClass();

            try
            {
                return (org.apache.tapestry5.services.FieldAccess) accessClass.newInstance();
            }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

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

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

        Class targetClass = cf.createClass();

        try
        {
            targetClass.newInstance();
            unreachable();
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

        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) });

        assertEquals(targetBean.getIntValue(), 137);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

    {
        ClassFab cf = newClassFab("InvalidSuperClass", List.class);

        try
        {
            cf.createClass();
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to create class InvalidSuperClass");
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFab.createClass()

        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();

        assertEquals(207, s.add(99, 108));
    }
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.