ClassNodepublic class ClassNode extends Object A node that represents a class. |
Fields Summary |
---|
public int | versionThe class version. | public int | accessThe class's access flags (see {@link oracle.toplink.libraries.asm.Constants}). This
field also indicates if the class is deprecated. | public String | nameThe internal name of the class (see {@link
oracle.toplink.libraries.asm.Type#getInternalName() getInternalName}). | public String | superNameThe internal of name of the super class (see {@link
oracle.toplink.libraries.asm.Type#getInternalName() getInternalName}). For interfaces,
the super class is {@link Object}. May be null, but only for the
{@link Object java.lang.Object} class. | public final List | interfacesThe internal names of the class's interfaces (see {@link
oracle.toplink.libraries.asm.Type#getInternalName() getInternalName}). This list is a
list of {@link String} objects. | public String | sourceFileThe name of the source file from which this class was compiled. May be
null. | public final List | innerClassesInformations about the inner classes of this class. This list is a list of
{@link InnerClassNode InnerClassNode} objects. | public final List | fieldsThe fields of this class. This list is a list of {@link FieldNode
FieldNode} objects. | public final List | methodsThe methods of this class. This list is a list of {@link MethodNode
MethodNode} objects. | public Attribute | attrsThe non standard attributes of the class. |
Constructors Summary |
---|
public ClassNode(int version, int access, String name, String superName, String[] interfaces, String sourceFile)Constructs a new {@link ClassNode ClassNode} object.
this.version = version;
this.access = access;
this.name = name;
this.superName = superName;
this.interfaces = new ArrayList();
this.sourceFile = sourceFile;
this.innerClasses = new ArrayList();
this.fields = new ArrayList();
this.methods = new ArrayList();
if (interfaces != null) {
this.interfaces.addAll(Arrays.asList(interfaces));
}
|
Methods Summary |
---|
public void | accept(oracle.toplink.libraries.asm.ClassVisitor cv)Makes the given class visitor visit this class.
// visits header
String[] interfaces = new String[this.interfaces.size()];
this.interfaces.toArray(interfaces);
cv.visit(version, access, name, superName, interfaces, sourceFile);
// visits inner classes
int i;
for (i = 0; i < innerClasses.size(); ++i) {
((InnerClassNode)innerClasses.get(i)).accept(cv);
}
// visits fields
for (i = 0; i < fields.size(); ++i) {
((FieldNode)fields.get(i)).accept(cv);
}
// visits methods
for (i = 0; i < methods.size(); ++i) {
((MethodNode)methods.get(i)).accept(cv);
}
// visits attributes
Attribute attrs = this.attrs;
while (attrs != null) {
cv.visitAttribute(attrs);
attrs = attrs.next;
}
// visits end
cv.visitEnd();
|
|