Package net.sf.cglib.core

Examples of net.sf.cglib.core.Signature


     * For internal use by {@link Enhancer} only; see the {@link net.sf.cglib.reflect.FastMethod} class
     * for similar functionality.
     */
    public static MethodProxy create(Class c1, Class c2, String desc, String name1, String name2) {
        MethodProxy proxy = new MethodProxy();
        proxy.sig1 = new Signature(name1, desc);
        proxy.sig2 = new Signature(name2, desc);
        proxy.createInfo = new CreateInfo(c1, c2);
        return proxy;
    }
View Full Code Here


    PropertyValue[] pvs = bd.getPropertyValues().getPropertyValues();
    for (PropertyValue pv : pvs) {
      String propertyName = pv.getName();
      Class propertyType = BeanUtils.findPropertyType(propertyName, interfaces);
      String setterName = "set" + StringUtils.capitalize(propertyName);
      Signature signature = new Signature(setterName, Type.VOID_TYPE, new Type[] {Type.getType(propertyType)});
      maker.add(signature, new Type[0]);
    }
    if (bd instanceof AbstractBeanDefinition) {
      AbstractBeanDefinition abd = (AbstractBeanDefinition) bd;
      if (abd.getInitMethodName() != null) {
        Signature signature = new Signature(abd.getInitMethodName(), Type.VOID_TYPE, new Type[0]);
        maker.add(signature, new Type[0]);
      }
      if (abd.getDestroyMethodName() != null) {
        Signature signature = new Signature(abd.getDestroyMethodName(), Type.VOID_TYPE, new Type[0]);
        maker.add(signature, new Type[0]);
      }
    }
    return maker.create();
  }
View Full Code Here

        this.handlerInfoChainFactory = new HandlerInfoChainFactory(handlerInfos);
        sortedOperationInfos = new OperationInfo[FastClass.create(serviceEndpointClass).getMaxIndex() + 1];
        String encodingStyle = "";
        for (int i = 0; i < operationInfos.length; i++) {
            OperationInfo operationInfo = operationInfos[i];
            Signature signature = operationInfo.getSignature();
            MethodProxy methodProxy = MethodProxy.find(serviceEndpointClass, signature);
            if (methodProxy == null) {
                throw new ServerRuntimeException("No method proxy for operationInfo " + signature);
            }
            int index = methodProxy.getSuperIndex();
View Full Code Here

        // it is just a plain old opertaion
        return new KernelOperationInvoker(kernel, method);
    }

    private static int getSuperIndex(Class proxyType, Method method) {
        Signature signature = new Signature(method.getName(), Type.getReturnType(method), Type.getArgumentTypes(method));
        MethodProxy methodProxy = MethodProxy.find(proxyType, signature);
        if (methodProxy != null) {
            return methodProxy.getSuperIndex();
        }
        return -1;
View Full Code Here

        this.methodName = methodName;
        this.methodDesc = methodDesc;
    }

    public Signature getSignature() {
        return new Signature(methodName, methodDesc);
    }
View Full Code Here

        }
        return null;
    }

    private static int getSuperIndex(Class proxyType, Method method) {
        Signature signature = new Signature(method.getName(), Type.getReturnType(method), Type.getArgumentTypes(method));
        MethodProxy methodProxy = MethodProxy.find(proxyType, signature);
        if (methodProxy != null) {
            return methodProxy.getSuperIndex();
        }
        return -1;
View Full Code Here

    void initialize() {
        String encodingStyle = "";
        for (int i = 0; i < operationInfos.length; i++) {
            OperationInfo operationInfo = operationInfos[i];
            Signature signature = operationInfo.getSignature();
            MethodProxy methodProxy = MethodProxy.find(serviceEndpointClass, signature);
            if (methodProxy == null) {
                throw new RuntimeException("No method proxy for operationInfo " + signature);
            }
            int index = methodProxy.getSuperIndex();
View Full Code Here

    PropertyValue[] pvs = bd.getPropertyValues().getPropertyValues();
    for (int i = 0; i < pvs.length; i++) {
      String propertyName = pvs[i].getName();
      Class propertyType = BeanUtils.findPropertyType(propertyName, interfaces);
      String setterName = "set" + StringUtils.capitalize(propertyName);
      Signature signature = new Signature(setterName, Type.VOID_TYPE, new Type[] {Type.getType(propertyType)});
      maker.add(signature, new Type[0]);
    }
    if (bd instanceof AbstractBeanDefinition) {
      AbstractBeanDefinition abd = (AbstractBeanDefinition) bd;
      if (abd.getInitMethodName() != null) {
        Signature signature = new Signature(abd.getInitMethodName(), Type.VOID_TYPE, new Type[0]);
        maker.add(signature, new Type[0]);
      }
      if (abd.getDestroyMethodName() != null) {
        Signature signature = new Signature(abd.getDestroyMethodName(), Type.VOID_TYPE, new Type[0]);
        maker.add(signature, new Type[0]);
      }
    }
    return maker.create();
  }
View Full Code Here

    public StaticFunctionDelegatorBuilder addMethod(Method method, String rename) {
        assertNotNull(method, "Method is null");
        assertTrue(isPublicStatic(method), "Method is not public static: %s", method);

        Signature sig = getSignature(method, rename);

        if (methods.containsKey(sig)) {
            throw new IllegalArgumentException("Duplicated method signature: " + sig + "\n  method: "
                                               + methods.get(sig));
        }
View Full Code Here

    public Class<?> getMixinInterface() {
        if (mixinInterface == null) {
            InterfaceMaker im = new InterfaceMaker();

            for (Map.Entry<Signature, Method> entry : methods.entrySet()) {
                Signature sig = entry.getKey();
                Method method = entry.getValue();

                Type[] exceptionTypes = new Type[method.getExceptionTypes().length];

                for (int i = 0; i < exceptionTypes.length; i++) {
View Full Code Here

TOP

Related Classes of net.sf.cglib.core.Signature

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.