Package net.sf.cglib.reflect

Examples of net.sf.cglib.reflect.FastConstructor


            String message = "Invalid assignment of expression " + i + " returning type '" + columnType +
                    "', column and parameter types mismatch";
            throw new ExprValidationException(message);
        }

        FastConstructor fctor;
        try {
            Constructor ctor = methodResolutionService.resolveCtor(beanEventType.getUnderlyingType(), ctorTypes);
            FastClass fastClass = FastClass.create(beanEventType.getUnderlyingType());
            fctor = fastClass.getConstructor(ctor);
        }
View Full Code Here


        enhancer.setUseCache(false);
        Class serviceClass = enhancer.createClass();

        Enhancer.registerCallbacks(serviceClass, methodInterceptors);

        FastConstructor constructor =
            FastClass.create(serviceClass).getConstructor(URL_SERVICE_NAME_CONSTRUCTOR);
        Object[] arguments =
            new Object[]{wsdlLocation, serviceName};

        LOG.debug("Initializing service with: " + wsdlLocation + " " + serviceName);

        try {
            return (Service)constructor.newInstance(arguments);
        } catch (InvocationTargetException e) {
            NamingException exception = new NamingException("Could not construct service proxy");
            exception.initCause(e.getTargetException());
            throw exception;
        }
View Full Code Here

            throw new DeploymentException("Could not write out class bytes", e);
        } catch (URISyntaxException e) {
            throw new DeploymentException("Could not constuct URI for location of enhanced class", e);
        }
        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
        try {
            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
        } catch (InvocationTargetException e) {
            throw new DeploymentException("Could not construct service instance", e.getTargetException());
        }
    }
View Full Code Here

                                  @FormGroup(name = "mygroupname") String s4) {
    }

    @Test
    public void getFastConstructor_and_newInstance() throws Exception {
        FastConstructor fc = DataResolverUtil.getFastConstructor(MyData.class);
        assertTrue(DataResolverUtil.newInstance(fc) instanceof MyData);
    }
View Full Code Here

        // 批量注入
        Params paramsAnnotation = context.getAnnotation(Params.class);

        if (paramsAnnotation != null) {
            Class<?> beanType = context.getTypeInfo().getRawType();
            FastConstructor fc = DataResolverUtil.getFastConstructor(beanType);
            return new ParametersResolver(context, fc);
        }

        return null;
    }
View Full Code Here

            String message = "Invalid assignment of expression " + i + " returning type '" + columnType +
                    "', column and parameter types mismatch";
            throw new ExprValidationException(message);
        }

        FastConstructor fctor;
        try {
            Constructor ctor = methodResolutionService.resolveCtor(beanEventType.getUnderlyingType(), ctorTypes);
            FastClass fastClass = FastClass.create(beanEventType.getUnderlyingType());
            fctor = fastClass.getConstructor(ctor);
        }
View Full Code Here

        // ����ע��
        Params paramsAnnotation = context.getAnnotation(Params.class);

        if (paramsAnnotation != null) {
            Class<?> beanType = context.getTypeInfo().getRawType();
            FastConstructor fc = DataResolverUtil.getFastConstructor(beanType);
            return new ParametersResolver(context, fc);
        }

        return null;
    }
View Full Code Here

            String message = "Invalid assignment of expression " + i + " returning type '" + columnType +
                    "', column and parameter types mismatch";
            throw new ExprValidationException(message);
        }

        FastConstructor fctor;
        try {
            Constructor ctor = engineImportService.resolveCtor(beanEventType.getUnderlyingType(), ctorTypes);
            FastClass fastClass = FastClass.create(Thread.currentThread().getContextClassLoader(), beanEventType.getUnderlyingType());
            fctor = fastClass.getConstructor(ctor);
        }
View Full Code Here

        Class[] parameterTypes = new Class[] { String.class };
        for(String property : propertyTypes.keySet())
    {
      log.debug(".createPropertyConstructors property==" + property + ", type==" + propertyTypes.get(property  ));
      FastClass fastClass = FastClass.create(Thread.currentThread().getContextClassLoader(), JavaClassHelper.getBoxedType((Class) propertyTypes.get(property)));
      FastConstructor constructor = fastClass.getConstructor(parameterTypes);
      constructors.put(property, constructor);
    }
    return constructors;
  }
View Full Code Here

public class BasicTypeCoercer extends AbstractTypeCoercer {

    public Object coerce(String property, String source) throws Exception {
    Object[] parameters = new Object[] { source };

        FastConstructor ctor = propertyConstructors.get(property);
        Object value;
        if (ctor != null)
        {
            value = ctor.newInstance(parameters);
        }
        else
        {
            value = Long.parseLong(source);
        }
View Full Code Here

TOP

Related Classes of net.sf.cglib.reflect.FastConstructor

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.