Examples of ReflectionInfo


Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

        if (!expression.getAdvisedClassFilterExpression().match(new ExpressionContext(pointcutType, calleeClassInfo, callerClassInfo))) {
            return false;
        }

        // create the callee info
        final ReflectionInfo reflectionInfo;
        final PointcutType joinPointType;
        switch (emittedJoinPoint.getJoinPointType()) {
            case JoinPointType.STATIC_INITIALIZATION_INT:
                reflectionInfo = calleeClassInfo.staticInitializer();
                joinPointType = PointcutType.STATIC_INITIALIZATION;
                break;
            case JoinPointType.METHOD_EXECUTION_INT:
                reflectionInfo = calleeClassInfo.getMethod(emittedJoinPoint.getJoinPointHash());
                joinPointType = PointcutType.EXECUTION;
                break;
            case JoinPointType.METHOD_CALL_INT:
                reflectionInfo = calleeClassInfo.getMethod(emittedJoinPoint.getJoinPointHash());
                joinPointType = PointcutType.CALL;
                break;
            case JoinPointType.FIELD_GET_INT:
                reflectionInfo = calleeClassInfo.getField(emittedJoinPoint.getJoinPointHash());
                joinPointType = PointcutType.GET;
                break;
            case JoinPointType.FIELD_SET_INT:
                reflectionInfo = calleeClassInfo.getField(emittedJoinPoint.getJoinPointHash());
                joinPointType = PointcutType.SET;
                break;
            case JoinPointType.CONSTRUCTOR_EXECUTION_INT:
                reflectionInfo = calleeClassInfo.getConstructor(emittedJoinPoint.getJoinPointHash());
                joinPointType = PointcutType.EXECUTION;
                break;
            case JoinPointType.CONSTRUCTOR_CALL_INT:
                reflectionInfo = calleeClassInfo.getConstructor(emittedJoinPoint.getJoinPointHash());
                joinPointType = PointcutType.CALL;
                break;
            case JoinPointType.HANDLER_INT:
                reflectionInfo = calleeClassInfo;
                joinPointType = PointcutType.HANDLER;
                break;
            default:
                throw new RuntimeException("Joinpoint type not supported: " + emittedJoinPoint.getJoinPointType());
        }

        // create the caller info
        final ReflectionInfo withinInfo;
        if (TransformationConstants.CLINIT_METHOD_NAME.equals(emittedJoinPoint.getCallerMethodName())) {
            withinInfo = callerClassInfo.staticInitializer();
        } else if (TransformationConstants.INIT_METHOD_NAME.equals(emittedJoinPoint.getCallerMethodName())) {
            withinInfo = callerClassInfo.getConstructor(AsmHelper.calculateConstructorHash(
                    emittedJoinPoint.getCallerMethodDesc()
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

       

        if (context.hasStaticInitializationPointcut() && context.hasReflectionInfo()) {

          ReflectionInfo reflectInfo = context.getReflectionInfo();

         

          if(reflectInfo instanceof StaticInitializationInfo) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

        ExpressionContext context = (ExpressionContext) data;

        if (context.hasWithinReflectionInfo()) {

          ReflectionInfo reflectInfo = context.getWithinReflectionInfo();

          ReflectionInfo withinInfo  = null;

         

          if(reflectInfo instanceof MemberInfo) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

        }

       

        ReflectionInfo reflectInfo = context.getWithinReflectionInfo();

       

        if(node.isStaticInitializer()) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

        // we are matching on the CALLER info

        // for execution() pointcut, this is equals to CALLEE info

        ReflectionInfo info = context.getWithinReflectionInfo();

        ClassInfo classInfo = info instanceof MemberInfo

        ? ((MemberInfo) info).getDeclaringType()
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

        // we are matching on the CALLER info

        // for execution() pointcut, this is equals to CALLEE info

        ReflectionInfo info = context.getWithinReflectionInfo();

        ClassInfo classInfo = (info instanceof MemberInfo) ?

                              ((MemberInfo) info).getDeclaringType() : (ClassInfo) info;
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

    public Object visit(ASTTarget node, Object data) {

        ExpressionContext context = (ExpressionContext) data;

        ReflectionInfo info = context.getReflectionInfo();



//        //TODO - seems to be the case for AJ - not intuitive
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo

        // and we are assuming here that withinInfo is properly set to reflectionInfo

        if (context.hasWithinReflectionInfo()) {

            ReflectionInfo withinInfo = context.getWithinReflectionInfo();

            if (withinInfo instanceof MemberInfo) {

                // if method is static (callee for execution or caller for call/get/set), this(..) is evaluated to false
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo



    public Object visit(ASTModifier node, Object data) {

        ReflectionInfo refInfo = (ReflectionInfo) data;

        int modifiersToMatch = refInfo.getModifiers();

        int modifierPattern = node.getModifier();

        if (node.isNot()) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo



        // create the callee info

        final ReflectionInfo reflectionInfo;

        final PointcutType pointcutType;

        switch (joinPointType) {

            case JoinPointType.STATIC_INITIALIZATION_INT:

                reflectionInfo = calleeClassInfo.staticInitializer();

                pointcutType = PointcutType.STATIC_INITIALIZATION;

                break;

            case JoinPointType.METHOD_EXECUTION_INT:

                reflectionInfo = calleeClassInfo.getMethod(joinPointHash);

                pointcutType = PointcutType.EXECUTION;

                break;

            case JoinPointType.METHOD_CALL_INT:

                reflectionInfo = calleeClassInfo.getMethod(joinPointHash);

                pointcutType = PointcutType.CALL;

                break;

            case JoinPointType.FIELD_GET_INT:

                reflectionInfo = calleeClassInfo.getField(joinPointHash);

                pointcutType = PointcutType.GET;

                break;

            case JoinPointType.FIELD_SET_INT:

                reflectionInfo = calleeClassInfo.getField(joinPointHash);

                pointcutType = PointcutType.SET;

                break;

            case JoinPointType.CONSTRUCTOR_EXECUTION_INT:

                reflectionInfo = calleeClassInfo.getConstructor(joinPointHash);

                pointcutType = PointcutType.EXECUTION;

                break;

            case JoinPointType.CONSTRUCTOR_CALL_INT:

                reflectionInfo = calleeClassInfo.getConstructor(joinPointHash);

                pointcutType = PointcutType.CALL;

                break;

            case JoinPointType.HANDLER_INT:

                reflectionInfo = calleeClassInfo;

                pointcutType = PointcutType.HANDLER;

                break;

            default:

                throw new RuntimeException("Joinpoint type not supported: " + joinPointType);

        }



        // create the caller info

        final ClassInfo callerClassInfo = JavaClassInfo.getClassInfo(callerClass);

        final ReflectionInfo withinInfo;

        if (TransformationConstants.CLINIT_METHOD_NAME.equals(callerMethodName)) {

            withinInfo = callerClassInfo.staticInitializer();
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.