Package net.sf.cglib.reflect

Examples of net.sf.cglib.reflect.FastClass


  public ReflectionOptimizer getReflectionOptimizer(
      Class clazz,
          String[] getterNames,
          String[] setterNames,
          Class[] types) {
    FastClass fastClass;
    BulkBean bulkBean;
    try {
      fastClass = FastClass.create( clazz );
      bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );
      if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
        if ( fastClass == null ) {
          bulkBean = null;
        }
        else {
          //test out the optimizer:
          Object instance = fastClass.newInstance();
          bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
        }
      }
    }
    catch( Throwable t ) {
View Full Code Here


    public ReflectionOptimizer getReflectionOptimizer(
                                                      Class clazz,
                                                      String[] getterNames,
                                                      String[] setterNames,
                                                      Class[] types) {
        FastClass fastClass;
        BulkBean bulkBean;
        try {
            fastClass = FastClass.create( clazz );
            bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );
            if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
                if ( fastClass == null ) {
                    bulkBean = null;
                }
                else {
                    //test out the optimizer:
                    Object instance = fastClass.newInstance();
                    bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
                }
            }
        }
        catch( Throwable t ) {
View Full Code Here

                Method method;
                FastMethod staticMethod;
                try
                {
                    method = validationContext.getMethodResolutionService().resolveMethod(firstItem.getName(), secondItem.getName(), paramTypes);
                    FastClass declaringClass = FastClass.create(Thread.currentThread().getContextClassLoader(), method.getDeclaringClass());
                    staticMethod = declaringClass.getMethod(method);
                }
                catch(Exception e)
                {
                    String message = "Failed to resolve '" + firstItem.getName() + "' to a property, stream or class name: " + e.getMessage();
                    throw new ExprValidationException(message, e);
View Full Code Here

            return null;
        }
        if (eventType instanceof BeanEventType)
        {
            BeanEventType beanEventType = (BeanEventType) eventType;
            FastClass fastClass = beanEventType.getFastClass();
            return PropertyHelper.getWritableProperties(fastClass.getJavaClass());
        }
        EventTypeSPI typeSPI = (EventTypeSPI) eventType;
        if (!typeSPI.getMetadata().isApplicationConfigured())
        {
            return null;
View Full Code Here

        final FastMethod staticMethod;
        Method method;
    try
    {
      method = validationContext.getMethodResolutionService().resolveMethod(clazz.getName(), firstItem.getName(), paramTypes);
      FastClass declaringClass = FastClass.create(Thread.currentThread().getContextClassLoader(), method.getDeclaringClass());
      staticMethod = declaringClass.getMethod(method);
    }
    catch(Exception e)
    {
      throw new ExprValidationException(e.getMessage());
    }
View Full Code Here

        final FastMethod staticMethod;
        Method method;
        try
        {
            method = methodResolutionService.resolveMethod(className, methodName, paramTypes);
            FastClass declaringClass = FastClass.create(Thread.currentThread().getContextClassLoader(), method.getDeclaringClass());
            staticMethod = declaringClass.getMethod(method);
        }
        catch(Exception e)
        {
            String message;
            if (configuredAsSingleRow) {
View Full Code Here

                    }
                    else {
                        target = currentInputType.getEventType().getUnderlyingType();
                    }
                    Method method = validationContext.getMethodResolutionService().resolveMethod(target, chainElement.getName(), paramTypes);
                    FastClass declaringClass = FastClass.create(Thread.currentThread().getContextClassLoader(), method.getDeclaringClass());
                    FastMethod fastMethod = declaringClass.getMethod(method);

                    ExprDotEval eval;
                    if (currentInputType.isScalar()) {
                        eval = new ExprDotMethodEvalNoDuck(validationContext.getStatementName(), fastMethod, paramEvals);
                    }
View Full Code Here

        }

        FastConstructor fctor;
        try {
            Constructor ctor = methodResolutionService.resolveCtor(beanEventType.getUnderlyingType(), ctorTypes);
            FastClass fastClass = FastClass.create(beanEventType.getUnderlyingType());
            fctor = fastClass.getConstructor(ctor);
        }
        catch (EngineImportException ex) {
            throw new ExprValidationException("Failed to find a suitable constructor for bean-event type '" + eventType.getName() + "': " + ex.getMessage(), ex);
        }
View Full Code Here

            return null;
        }
        if (eventType instanceof BeanEventType)
        {
            BeanEventType beanEventType = (BeanEventType) eventType;
            FastClass fastClass = beanEventType.getFastClass();
            return PropertyHelper.getWritableProperties(fastClass.getJavaClass());
        }
        EventTypeSPI typeSPI = (EventTypeSPI) eventType;
        if (!typeSPI.getMetadata().isApplicationConfigured() && typeSPI.getMetadata().getTypeClass() != EventTypeMetadata.TypeClass.ANONYMOUS)
        {
            return null;
View Full Code Here

        String className = factoryMethodName.substring(0, lastDotIndex);
        String methodName = factoryMethodName.substring(lastDotIndex + 1);
        try
        {
            Method method = methodResolutionService.resolveMethod(className, methodName, new Class[0]);
            FastClass fastClassFactory = FastClass.create(method.getDeclaringClass());
            return fastClassFactory.getMethod(method);
        }
        catch (EngineImportException e)
        {
            String message = "Failed to resolve configured factory method '" + methodName + "' expected to exist for class '" + className + "'";
            log.info(message, e);
View Full Code Here

TOP

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

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.