Package org.codehaus.aspectwerkz.reflect

Examples of org.codehaus.aspectwerkz.reflect.ClassInfo


        String annotationClassName = Type.getType(annotation.type).getClassName();

        // get the ClassInfo for the annoation class to populate the assigned element values
        // with lazy value holders from the setted value or the default value if defaulted element
        // has been used in the annotation
        ClassInfo annotationClassInfo = AsmClassInfo.getClassInfo(annotationClassName, loader);
        Map annotationElementValueHoldersByName = new HashMap();

        // populate with the default values (might be then overriden by setted values)
        MethodInfo[] annotationMethods = annotationClassInfo.getMethods();
        for (int i = 0; i < annotationMethods.length; i++) {
            MethodInfo annotationMethod = annotationMethods[i];
            for (Iterator iterator = annotationMethod.getAnnotations().iterator(); iterator.hasNext();) {
                AnnotationInfo annotationInfo = (AnnotationInfo) iterator.next();
                // handles AnnotationDefault attribute that we have wrapped. See AnnotationDefault.
View Full Code Here


        return Boolean.FALSE;
    }

    // ============ Patterns =============
    public Object visit(ASTClassPattern node, Object data) {
        ClassInfo classInfo = (ClassInfo) data;
        if (node.getTypePattern().matchType(classInfo) && visitAttributes(node, classInfo)) {
            return Boolean.TRUE;
        } else {
            return Boolean.FALSE;
        }
View Full Code Here

            }

            final byte[] bytecode = context.getInitialBytecode();
            final ClassLoader loader = context.getLoader();

            ClassInfo classInfo = AsmClassInfo.getClassInfo(bytecode, loader);
            final Set definitions = context.getDefinitions();
            final ExpressionContext[] ctxs = new ExpressionContext[]{
                new ExpressionContext(PointcutType.EXECUTION, classInfo, classInfo),
                new ExpressionContext(PointcutType.CALL, null, classInfo),
                new ExpressionContext(PointcutType.GET, classInfo, classInfo),
View Full Code Here

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

        for (int i = 0; i < methodInfos.length; i++) {

            if (Boolean.TRUE.equals(childNode.jjtAccept(this, methodInfos[i]))) {

                return Boolean.TRUE;

            }

        }



        ConstructorInfo[] constructorInfos = classInfo.getConstructors();

        for (int i = 0; i < constructorInfos.length; i++) {

            if (Boolean.TRUE.equals(childNode.jjtAccept(this, constructorInfos[i]))) {
View Full Code Here

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

        FieldInfo[] fieldInfos = classInfo.getFields();

        for (int i = 0; i < fieldInfos.length; i++) {

            if (Boolean.TRUE.equals(childNode.jjtAccept(this, fieldInfos[i]))) {
View Full Code Here

    // ============ Patterns =============

    public Object visit(ASTClassPattern node, Object data) {

        ClassInfo classInfo = (ClassInfo) data;

        TypePattern typePattern = node.getTypePattern();

        if (ClassInfoHelper.matchType(typePattern, classInfo)
View Full Code Here



    public Object visit(ASTParameter node, Object data) {

        ClassInfo parameterType = (ClassInfo) data;

        if (ClassInfoHelper.matchType(node.getDeclaringClassPattern(), parameterType)) {

            return Boolean.TRUE;
View Full Code Here

        // grab parameter from context

        ExpressionContext ctx = (ExpressionContext) data;

        ClassInfo argInfo = null;

        try {

            if (ctx.getReflectionInfo() instanceof MethodInfo) {
View Full Code Here

     * @param loader
     * @return the class info
     */
    public static ClassInfo getClassInfo(final String className, final ClassLoader loader, final boolean lazyAttributes) {
        AsmClassInfoRepository repository = AsmClassInfoRepository.getRepository(loader);
        ClassInfo classInfo = repository.getClassInfo(className);
        if (classInfo == null) {
            classInfo = createClassInfoFromStream(className, loader, lazyAttributes);
        }
        return classInfo;
    }
View Full Code Here

     * @return the class info
     */
    public static ClassInfo getClassInfo(final byte[] bytecode, final ClassLoader loader) {
        String className = AsmClassInfo.retrieveClassNameFromBytecode(bytecode);
        AsmClassInfoRepository repository = AsmClassInfoRepository.getRepository(loader);
        ClassInfo classInfo = repository.getClassInfo(className);
        if (classInfo == null) {
            classInfo = new AsmClassInfo(bytecode, loader, true);
        }
        return classInfo;
    }
View Full Code Here

TOP

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

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.