Package net.sf.cglib.core

Examples of net.sf.cglib.core.Signature


    private Map<Method, FastMethod> getMethodMappings(Class<?> intfs) {
        // 查找interface中的方法和被代理方法之间的对应关系
        Map<Method, FastMethod> methodMappings = createHashMap();

        for (Method method : intfs.getMethods()) {
            Signature sig = getSignature(method, null);
            Method realMethod = assertNotNull(methods.get(sig), "unknown method signature: %s", sig);
            FastClass fc = FastClass.create(getClassLoader(), realMethod.getDeclaringClass());
            FastMethod fm = fc.getMethod(realMethod);

            methodMappings.put(method, fm);
View Full Code Here


    protected Signature getSignature(Method method, String rename) {
        String name = defaultIfNull(trimToNull(rename), method.getName());
        Type returnType = Type.getType(method.getReturnType());
        Type[] paramTypes = Type.getArgumentTypes(method);

        return new Signature(name, returnType, paramTypes);
    }
View Full Code Here

        Map<String, List<Method>> overriderMethods = getMethodMap(overriderClass);
        FastClass overriderFastClass = FastClass.create(getClassLoader(), overriderClass);

        for (Class<?> interfaceClass : interfaces) {
            for (Method interfaceMethod : interfaceClass.getMethods()) {
                Signature sig = getSignature(interfaceMethod, null);
                Method overriderMethod = getCompatibleOverrideMethod(overriderMethods, interfaceMethod);

                if (overriderMethod != null) {
                    log.trace("Overrided method: {}", getSimpleMethodSignature(interfaceMethod, true));
                    overridedMethods.put(sig, overriderFastClass.getMethod(overriderMethod));
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

    private Signature getSignature(Method method, String rename) {
        String name = defaultIfNull(trimToNull(rename), method.getName());
        Type returnType = Type.getType(method.getReturnType());
        Type[] paramTypes = Type.getArgumentTypes(method);

        return new Signature(name, returnType, paramTypes);
    }
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

    private Map<Method, FastMethod> getMethodMappings(Class<?> intfs) {
        // 查找interface中的方法和被代理方法之间的对应关系
        Map<Method, FastMethod> methodMappings = createHashMap();

        for (Method method : intfs.getMethods()) {
            Signature sig = getSignature(method, null);
            Method realMethod = assertNotNull(methods.get(sig), "unknown method signature: %s", sig);
            FastClass fc = FastClass.create(getClassLoader(), realMethod.getDeclaringClass());
            FastMethod fm = fc.getMethod(realMethod);

            methodMappings.put(method, fm);
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

    private Signature getSignature(Method method, String rename) {
        String name = defaultIfNull(trimToNull(rename), method.getName());
        Type returnType = Type.getType(method.getReturnType());
        Type[] paramTypes = Type.getArgumentTypes(method);

        return new Signature(name, returnType, paramTypes);
    }
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.