Package org.codehaus.aspectwerkz.reflect

Examples of org.codehaus.aspectwerkz.reflect.ReflectionInfo


        return Boolean.FALSE;
    }

    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
//        if (info instanceof ConstructorInfo) {
//            // target(..) does not match for constructors
//            return Boolean.FALSE;
View Full Code Here


    public Object visit(ASTThis node, Object data) {
        ExpressionContext context = (ExpressionContext) data;
        // for execution pointcut, this(..) is used to match the callee info
        // 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
                if (Modifier.isStatic(((MemberInfo) withinInfo).getModifiers())) {
                    return Boolean.FALSE;
                }
View Full Code Here

        }
        return Boolean.FALSE;
    }

    public Object visit(ASTModifier node, Object data) {
        ReflectionInfo refInfo = (ReflectionInfo) data;
        int modifiersToMatch = refInfo.getModifiers();
        int modifierPattern = node.getModifier();
        if (node.isNot()) {
            if ((modifierPattern & Modifier.PUBLIC) != 0) {
                if (((modifiersToMatch & Modifier.PUBLIC) == 0)) {
                    return Boolean.TRUE;
View Full Code Here

     *
     * @param ctx
     * @return
     */
    private int getParametersCount(final ExpressionContext ctx) {
        ReflectionInfo reflectionInfo = ctx.getReflectionInfo();
        if (reflectionInfo instanceof MethodInfo) {
            return ((MethodInfo) reflectionInfo).getParameterTypes().length;
        } else if (reflectionInfo instanceof ConstructorInfo) {
            return ((ConstructorInfo) reflectionInfo).getParameterTypes().length;
        } else if (reflectionInfo instanceof FieldInfo) {
View Full Code Here

    }

    public Object visit(ASTWithin node, Object data) {
        ExpressionContext context = (ExpressionContext)data;
        if (context.hasWithinReflectionInfo()) {
            ReflectionInfo withinInfo = context.getWithinReflectionInfo();
            if (withinInfo instanceof MemberInfo) {
                return node.jjtGetChild(0).jjtAccept(this, ((MemberInfo)withinInfo).getDeclaringType());
            } else if (withinInfo instanceof ClassInfo) {
                return node.jjtGetChild(0).jjtAccept(this, withinInfo);
            }
View Full Code Here

        }
        return Boolean.FALSE;
    }

    public Object visit(ASTModifier node, Object data) {
        ReflectionInfo refInfo = (ReflectionInfo)data;
        int modifiersToMatch = refInfo.getModifiers();
        int modifierPattern = node.getModifier();
        if (node.isNot()) {
            if ((modifierPattern & Modifier.PUBLIC) != 0) {
                if (((modifiersToMatch & Modifier.PUBLIC) == 0)) {
                    return Boolean.TRUE;
View Full Code Here

        }
    }

    public Object visit(ASTWithin node, Object data) {
        ExpressionContext context = (ExpressionContext)data;
        ReflectionInfo reflectionInfo = context.getReflectionInfo();
        if (reflectionInfo instanceof MemberInfo) {
            return node.jjtGetChild(0).jjtAccept(this, ((MemberInfo)reflectionInfo).getDeclaringType());
        } else if (reflectionInfo instanceof ClassInfo) {
            return node.jjtGetChild(0).jjtAccept(this, reflectionInfo);
        } else {
View Full Code Here

        }
    }

    public Object visit(ASTWithin node, Object data) {
        ExpressionContext context = (ExpressionContext) data;
        ReflectionInfo reflectionInfo = context.getWithinReflectionInfo();
        if (reflectionInfo instanceof MemberInfo) {
            return node.jjtGetChild(0).jjtAccept(this, ((MemberInfo) reflectionInfo).getDeclaringType());
        } else if (reflectionInfo instanceof ClassInfo) {
            return node.jjtGetChild(0).jjtAccept(this, reflectionInfo);
        } else {
View Full Code Here

    }

    public Object visit(ASTWithin node, Object data) {
        ExpressionContext context = (ExpressionContext) data;
        if (context.hasWithinReflectionInfo()) {
            ReflectionInfo withinInfo = context.getWithinReflectionInfo();
            if (withinInfo instanceof MemberInfo) {
                return node.jjtGetChild(0).jjtAccept(this, ((MemberInfo) withinInfo).getDeclaringType());
            } else if (withinInfo instanceof ClassInfo) {
                return node.jjtGetChild(0).jjtAccept(this, withinInfo);
            }
View Full Code Here

    public Object visit(ASTHasMethod node, Object data) {
        ExpressionContext context = (ExpressionContext) data;

        // 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;

        Node childNode = node.jjtGetChild(0);
        MethodInfo[] methodInfos = classInfo.getMethods();
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.reflect.ReflectionInfo

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.