|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.util.asm.commons.EmptyVisitor
org.compass.core.config.binding.metadata.AsmClassMetaData
public class AsmClassMetaData
An ASM based class meta data provider.
| Constructor Summary | |
|---|---|
AsmClassMetaData()
|
|
| Method Summary | |
|---|---|
Map<String,Object> |
getAnnotationAttributes(String annotationType)
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying class). |
Set<String> |
getAnnotationTypes()
Return the names of all annotation types defined on the underlying class. |
String |
getClassName()
Return the name of the underlying class. |
String |
getEnclosingClassName()
Return the name of the enclosing class of the underlying class, or null if the underlying class is a top-level class. |
String[] |
getInterfaceNames()
Return the name of all interfaces that the underlying class implements, or an empty array if there are none. |
Set<String> |
getMetaAnnotationTypes(String annotationType)
Return the names of all meta-annotation types defined on the given annotation type of the underlying class. |
String |
getSuperClassName()
Return the name of the super class of the underlying class, or null if there is no super class defined. |
boolean |
hasAnnotation(String annotationType)
Determine whether the underlying class has an annotation of the given type defined. |
boolean |
hasEnclosingClass()
Return whether the underlying class has an enclosing class (i.e. the underlying class is an inner/nested class or a local class within a method). |
boolean |
hasMetaAnnotation(String metaAnnotationType)
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type. |
boolean |
hasSuperClass()
Return whether the underlying class has a super class. |
boolean |
isAbstract()
Return whether the underlying class is marked as abstract. |
boolean |
isConcrete()
Return whether the underlying class represents a concrete class, i.e. neither an interface nor an abstract class. |
boolean |
isIndependent()
Determine whether the underlying class is independent, i.e. whether it is a top-level class or a nested class (static inner class) that can be constructed independent from an enclosing class. |
boolean |
isInterface()
Return whether the underlying class represents an interface. |
void |
visit(int version,
int access,
String name,
String signature,
String supername,
String[] interfaces)
Visits the header of the class. |
AnnotationVisitor |
visitAnnotation(String desc,
boolean visible)
Visits an annotation of the class. |
void |
visitInnerClass(String name,
String outerName,
String innerName,
int access)
Visits information about an inner class. |
void |
visitOuterClass(String owner,
String name,
String desc)
Visits the enclosing class of the class. |
| Methods inherited from class org.compass.core.util.asm.commons.EmptyVisitor |
|---|
visit, visitAnnotation, visitAnnotationDefault, visitArray, visitAttribute, visitCode, visitEnd, visitEnum, visitField, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLookupSwitchInsn, visitMaxs, visitMethod, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitSource, visitTableSwitchInsn, visitTryCatchBlock, visitTypeInsn, visitVarInsn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsmClassMetaData()
| Method Detail |
|---|
public void visit(int version,
int access,
String name,
String signature,
String supername,
String[] interfaces)
ClassVisitor
visit in interface ClassVisitorvisit in class EmptyVisitorversion - the class version.access - the class's access flags (see Opcodes). This
parameter also indicates if the class is deprecated.name - the internal name of the class (see
getInternalName).signature - the signature of this class. May be null if
the class is not a generic one, and does not extend or implement
generic classes or interfaces.supername - the internal of name of the super class (see
getInternalName). For interfaces,
the super class is Object. May be null, but
only for the Object class.interfaces - the internal names of the class's interfaces (see
getInternalName). May be
null.
public void visitOuterClass(String owner,
String name,
String desc)
ClassVisitor
visitOuterClass in interface ClassVisitorvisitOuterClass in class EmptyVisitorowner - internal name of the enclosing class of the class.name - the name of the method that contains the class, or
null if the class is not enclosed in a method of its
enclosing class.desc - the descriptor of the method that contains the class, or
null if the class is not enclosed in a method of its
enclosing class.
public void visitInnerClass(String name,
String outerName,
String innerName,
int access)
ClassVisitor
visitInnerClass in interface ClassVisitorvisitInnerClass in class EmptyVisitorname - the internal name of an inner class (see
getInternalName).outerName - the internal name of the class to which the inner class
belongs (see getInternalName). May
be null for not member classes.innerName - the (simple) name of the inner class inside its
enclosing class. May be null for anonymous inner
classes.access - the access flags of the inner class as originally declared
in the enclosing class.
public AnnotationVisitor visitAnnotation(String desc,
boolean visible)
ClassVisitor
visitAnnotation in interface ClassVisitorvisitAnnotation in interface FieldVisitorvisitAnnotation in interface MethodVisitorvisitAnnotation in class EmptyVisitordesc - the class descriptor of the annotation class.visible - true if the annotation is visible at runtime.
public Set<String> getAnnotationTypes()
ClassMetaData
getAnnotationTypes in interface ClassMetaDatapublic boolean hasAnnotation(String annotationType)
ClassMetaData
hasAnnotation in interface ClassMetaDataannotationType - the annotation type to look for
public Set<String> getMetaAnnotationTypes(String annotationType)
ClassMetaData
getMetaAnnotationTypes in interface ClassMetaDatapublic boolean hasMetaAnnotation(String metaAnnotationType)
ClassMetaData
hasMetaAnnotation in interface ClassMetaDatametaAnnotationType - the meta-annotation type to look for
public Map<String,Object> getAnnotationAttributes(String annotationType)
ClassMetaData
getAnnotationAttributes in interface ClassMetaDataannotationType - the annotation type to look for
null if no matching
annotation is defined.public String getClassName()
ClassMetaData
getClassName in interface ClassMetaDatapublic boolean isInterface()
ClassMetaData
isInterface in interface ClassMetaDatapublic boolean isAbstract()
ClassMetaData
isAbstract in interface ClassMetaDatapublic boolean isConcrete()
ClassMetaData
isConcrete in interface ClassMetaDatapublic boolean isIndependent()
ClassMetaData
isIndependent in interface ClassMetaDatapublic boolean hasEnclosingClass()
ClassMetaDataIf this method returns false, then the
underlying class is a top-level class.
hasEnclosingClass in interface ClassMetaDatapublic String getEnclosingClassName()
ClassMetaDatanull if the underlying class is a top-level class.
getEnclosingClassName in interface ClassMetaDatapublic boolean hasSuperClass()
ClassMetaData
hasSuperClass in interface ClassMetaDatapublic String getSuperClassName()
ClassMetaDatanull if there is no super class defined.
getSuperClassName in interface ClassMetaDatapublic String[] getInterfaceNames()
ClassMetaData
getInterfaceNames in interface ClassMetaData
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||