Package org.codehaus.aspectwerkz.reflect

Examples of org.codehaus.aspectwerkz.reflect.FieldInfo



            final Type fieldType = Type.getType(fieldDesc);
            final int joinPointHash = AsmHelper.calculateFieldHash(fieldName, fieldDesc);
            final ClassInfo classInfo = AsmClassInfo.getClassInfo(className, m_loader);
            final FieldInfo fieldInfo = getFieldInfo(classInfo, className, fieldName, fieldDesc, joinPointHash);

            if (opcode == PUTFIELD || opcode == PUTSTATIC) {
                handleFieldModification(fieldInfo, opcode, className, fieldName, fieldDesc, joinPointHash);
            } else if (opcode == GETFIELD || opcode == GETSTATIC) {
                handleFieldAccess(fieldInfo, opcode, className, fieldName, fieldDesc, joinPointHash, fieldType);
View Full Code Here


        private FieldInfo getFieldInfo(final ClassInfo classInfo,
                                       final String className,
                                       final String fieldName,
                                       final String fieldDesc,
                                       final int joinPointHash) {
            FieldInfo fieldInfo = classInfo.getField(joinPointHash);
            if (fieldInfo == null) {
                throw new Error(
                        "field info metadata structure could not be build for field: "
                        + className
                        + '.'
View Full Code Here

            m_declaringTypeName = name;
            m_mixinFields = new HashMap();

            // populate with fields already present for mixins from previous weaving
            for (int i = 0; i < m_classInfo.getFields().length; i++) {
                FieldInfo fieldInfo = m_classInfo.getFields()[i];
                if (fieldInfo.getName().startsWith(MIXIN_FIELD_NAME)) {
                    m_mixinFields.put(fieldInfo.getType(), fieldInfo);
                }
            }

            // add fields and method for (not already there) mixins
            addMixinMembers();
View Full Code Here

            return true;
        }
        if (!(o instanceof FieldInfo)) {
            return false;
        }
        FieldInfo fieldInfo = (FieldInfo) o;
        if (!m_declaringTypeName.equals(fieldInfo.getDeclaringType().getName())) {
            return false;
        }
        if (!m_member.name.equals(fieldInfo.getName())) {
            return false;
        }
        if (!m_typeName.equals(fieldInfo.getType().getName())) {
            return false;
        }
        return true;
    }
View Full Code Here

     */

    public FieldInfo getField(final int hash) {

        FieldInfo field = (FieldInfo) m_fields.get(hash);

        if (field == null && getSuperclass() != null) {

            field = getSuperclass().getField(hash);

View Full Code Here

            return true;
        }
        if (!(o instanceof FieldInfo)) {
            return false;
        }
        FieldInfo fieldInfo = (FieldInfo) o;
        if (!m_declaringType.getName().equals(fieldInfo.getDeclaringType().getName())) {
            return false;
        }
        if (!m_member.getName().equals(fieldInfo.getName())) {
            return false;
        }
        ClassInfo fieldType = fieldInfo.getType();
        if (!m_type.getName().equals(fieldType.getName())) {
            return false;
        }
        return true;
    }
View Full Code Here

     */

    public FieldInfo getField(final int hash) {

        FieldInfo field = (FieldInfo) m_fields.get(hash);

        if (field == null && getSuperclass() != null) {

            field = getSuperclass().getField(hash);

View Full Code Here

            }

        } else if (data instanceof FieldInfo) {

            FieldInfo fieldInfo = (FieldInfo) data;

            if (node.getDeclaringTypePattern().matchType(fieldInfo.getDeclaringType())) {

                return null;// it might not match further because of modifiers etc

            }
View Full Code Here

    public Object visit(ASTFieldPattern node, Object data) {

        if (data instanceof FieldInfo) {

            FieldInfo fieldInfo = (FieldInfo) data;

            if (node.getFieldNamePattern().matches(fieldInfo.getName())

                && node.getDeclaringTypePattern().matchType(fieldInfo.getDeclaringType())

                && node.getFieldTypePattern().matchType(fieldInfo.getType())

                && visitModifiers(node, fieldInfo)) {

                return Boolean.TRUE;
View Full Code Here

     * @return the annotation or null
     */
    public static Annotation getAnnotation(final String annotationName, final Field field) {
        ClassLoader loader = field.getDeclaringClass().getClassLoader();
        ClassInfo classInfo = AsmClassInfo.getClassInfo(field.getDeclaringClass().getName(), loader);
        FieldInfo fieldInfo = classInfo.getField(ReflectHelper.calculateHash(field));
        return AsmAnnotations.getAnnotation(annotationName, fieldInfo);
    }
View Full Code Here

TOP

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

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.