com.sun.org.apache.bcel.internal.generic.ClassGen
| Modifier and Type | Field and Description |
|---|---|
| private AnnotationEntry[] | |
| private Attribute[] | |
| private static BCELComparator | |
| private String | |
| private int | |
| private boolean | |
| private boolean | |
| private ConstantPool | |
| public static final JavaClass[] | EMPTY_ARRAY
Empty array. |
| public static final String | EXTENSION
The standard class file extension. |
| private Field[] | |
| public static final byte | |
| private String | |
| public static final byte | |
| private String[] | |
| private int[] | |
| private boolean | |
| private boolean | |
| private boolean | |
| private int | |
| private Method[] | |
| private int | |
| private final String | |
| private transient Repository | repository
In cases where we go ahead and create something, use the default SyntheticRepository, because we don't know any better. |
| private byte | |
| private String | |
| private String | |
| private int | |
| public static final byte |
| Access | Constructor and Description |
|---|---|
| public | JavaClass(final int
Class name classNameIndex, final int Superclass name superclassNameIndex, final String File name fileName, final int Major compiler version major, final int Minor compiler version minor, final int Access rights defined by bit flags accessFlags, final ConstantPool Array of constants constantPool, final int[] Implemented interfaces interfaces, final Field[] Class fields fields, final Method[] Class methods methods, final Attribute[] Class attributes attributes)Constructor gets all contents as arguments. |
| public | JavaClass(final int
Index into constant pool referencing a ConstantClass that represents this class. classNameIndex, final int Index into constant pool referencing a ConstantClass that represents this class's
superclass. superclassNameIndex, final String File name fileName, final int Major compiler version major, final int Minor compiler version minor, final int Access rights defined by bit flags accessFlags, final ConstantPool Array of constants constantPool, int[] Implemented interfaces interfaces, Field[] Class fields fields, Method[] Class methods methods, Attribute[] Class attributes attributes, final byte Read from file or generated in memory? source)Constructor gets all contents as arguments. |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(final Visitor
Visitor object v)Implements com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. |
| public int | compareTo(final JavaClass obj)
Implements java. Return the natural ordering of two JavaClasses. |
| private void | |
| private void | |
| public JavaClass | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | equals(final Object obj)
Overrides java. Return value as defined by given BCELComparator strategy. |
| public Field | |
| public JavaClass[] | |
| public AnnotationEntry[] | |
| public final <T extends Attribute> T | Returns: Attribute for given tag, null if not found. Refer tocom. constants named ATTR_* for possible values.Gets attribute for given tag. |
| public Attribute[] | |
| public byte[] | |
| public String | |
| public int | |
| public static BCELComparator | |
| public ConstantPool | |
| public Field[] | |
| public String | |
| public int[] | |
| public String[] | |
| public JavaClass[] | |
| public int | |
| public Method | |
| public Method[] | |
| public int | |
| public String | |
| public Repository | |
| public final byte | |
| public String | |
| public String | Returns: path to original source file of parsed class, relative to original source directory.Gets the source file path including the package path. |
| public JavaClass | |
| public JavaClass[] | getSuperClasses()
Returns: list of super classes of this class in ascending order, i.e., java.lang.Object is always the last element |
| public String | |
| public int | |
| public int | hashCode()
Overrides java. Return value as defined by given BCELComparator strategy. |
| public boolean | implementationOf(final JavaClass inter)
Returns: true, if this class is an implementation of interface inter |
| private static String | |
| public final boolean | Returns: true if this JavaClass is derived from the super classEquivalent to runtime "instanceof" operator. |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public boolean | Returns: true if a record attribute is present, false otherwise.Tests whether this class was declared as a record |
| public final boolean | |
| public void | |
| public void | |
| public void | |
| public static void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | Returns: String representing class contents.Overrides java. Returns a string representation of the object. |
| annotations | back to summary |
|---|---|
| private AnnotationEntry[] annotations | |
| attributes | back to summary |
|---|---|
| private Attribute[] attributes | |
| bcelComparator | back to summary |
|---|---|
| private static BCELComparator<JavaClass> bcelComparator | |
| className | back to summary |
|---|---|
| private String className | |
| classNameIndex | back to summary |
|---|---|
| private int classNameIndex | |
| computedNestedTypeStatus | back to summary |
|---|---|
| private boolean computedNestedTypeStatus | |
| computedRecord | back to summary |
|---|---|
| private boolean computedRecord | |
| constantPool | back to summary |
|---|---|
| private ConstantPool constantPool | |
| EMPTY_ARRAY | back to summary |
|---|---|
| public static final JavaClass[] EMPTY_ARRAY Empty array.
| |
| EXTENSION | back to summary |
|---|---|
| public static final String EXTENSION The standard class file extension.
| |
| fields | back to summary |
|---|---|
| private Field[] fields | |
| FILE | back to summary |
|---|---|
| public static final byte FILE | |
| fileName | back to summary |
|---|---|
| private String fileName | |
| HEAP | back to summary |
|---|---|
| public static final byte HEAP | |
| interfaceNames | back to summary |
|---|---|
| private String[] interfaceNames | |
| interfaces | back to summary |
|---|---|
| private int[] interfaces | |
| isAnonymous | back to summary |
|---|---|
| private boolean isAnonymous | |
| isNested | back to summary |
|---|---|
| private boolean isNested | |
| isRecord | back to summary |
|---|---|
| private boolean isRecord | |
| major | back to summary |
|---|---|
| private int major | |
| methods | back to summary |
|---|---|
| private Method[] methods | |
| minor | back to summary |
|---|---|
| private int minor | |
| packageName | back to summary |
|---|---|
| private final String packageName | |
| repository | back to summary |
|---|---|
| private transient Repository repository In cases where we go ahead and create something, use the default SyntheticRepository, because we don't know any better. | |
| source | back to summary |
|---|---|
| private byte source | |
| sourceFileName | back to summary |
|---|---|
| private String sourceFileName | |
| superclassName | back to summary |
|---|---|
| private String superclassName | |
| superclassNameIndex | back to summary |
|---|---|
| private int superclassNameIndex | |
| ZIP | back to summary |
|---|---|
| public static final byte ZIP | |
| JavaClass | back to summary |
|---|---|
| public JavaClass(final int classNameIndex, final int superclassNameIndex, final String fileName, final int major, final int minor, final int accessFlags, final ConstantPool constantPool, final int[] interfaces, final Field[] fields, final Method[] methods, final Attribute[] attributes) Constructor gets all contents as arguments.
| |
| JavaClass | back to summary |
|---|---|
| public JavaClass(final int classNameIndex, final int superclassNameIndex, final String fileName, final int major, final int minor, final int accessFlags, final ConstantPool constantPool, int[] interfaces, Field[] fields, Method[] methods, Attribute[] attributes, final byte source) Constructor gets all contents as arguments.
| |
| accept | back to summary |
|---|---|
| public void accept(final Visitor v) Implements com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. | |
| compareTo | back to summary |
|---|---|
| public int compareTo(final JavaClass obj) Implements java. Return the natural ordering of two JavaClasses. This ordering is based on the class name
| |
| computeIsRecord | back to summary |
|---|---|
| private void computeIsRecord() | |
| computeNestedTypeStatus | back to summary |
|---|---|
| private void computeNestedTypeStatus() | |
| copy | back to summary |
|---|---|
public JavaClass copy()
| |
| dump | back to summary |
|---|---|
| public void dump(final DataOutputStream file) throws IOException Dump Java class to output stream in binary format.
| |
| dump | back to summary |
|---|---|
| public void dump(final File file) throws IOException Dump class to a file.
| |
| dump | back to summary |
|---|---|
| public void dump(final OutputStream file) throws IOException Dump Java class to output stream in binary format.
| |
| dump | back to summary |
|---|---|
| public void dump(final String fileName) throws IOException Dump class to a file named fileName.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Return value as defined by given BCELComparator strategy. By default two JavaClass objects are said to be equal when their class names are equal.
| |
| findField | back to summary |
|---|---|
| public Field findField(final String fieldName, final Type fieldType) throws ClassNotFoundException Finds a visible field by name and type in this class and its super classes. | |
| getAllInterfaces | back to summary |
|---|---|
| public JavaClass[] getAllInterfaces() throws ClassNotFoundException Gets all interfaces implemented by this JavaClass (transitively).
| |
| getAnnotationEntries | back to summary |
|---|---|
public AnnotationEntry[] getAnnotationEntries()
| |
| getAttribute | back to summary |
|---|---|
| public final <T extends Attribute> T getAttribute(final byte tag) Gets attribute for given tag.
| |
| getAttributes | back to summary |
|---|---|
public Attribute[] getAttributes()
| |
| getBytes | back to summary |
|---|---|
public byte[] getBytes()
| |
| getClassName | back to summary |
|---|---|
public String getClassName()
| |
| getClassNameIndex | back to summary |
|---|---|
public int getClassNameIndex()
| |
| getComparator | back to summary |
|---|---|
public static BCELComparator
| |
| getConstantPool | back to summary |
|---|---|
public ConstantPool getConstantPool()
| |
| getFields | back to summary |
|---|---|
public Field[] getFields()
| |
| getFileName | back to summary |
|---|---|
public String getFileName()
| |
| getInterfaceIndices | back to summary |
|---|---|
public int[] getInterfaceIndices()
| |
| getInterfaceNames | back to summary |
|---|---|
public String[] getInterfaceNames()
| |
| getInterfaces | back to summary |
|---|---|
| public JavaClass[] getInterfaces() throws ClassNotFoundException Gets interfaces directly implemented by this JavaClass.
| |
| getMajor | back to summary |
|---|---|
public int getMajor()
| |
| getMethod | back to summary |
|---|---|
| public Method getMethod(final Method m) | |
| getMethods | back to summary |
|---|---|
public Method[] getMethods()
| |
| getMinor | back to summary |
|---|---|
public int getMinor()
| |
| getPackageName | back to summary |
|---|---|
public String getPackageName()
| |
| getRepository | back to summary |
|---|---|
| public Repository getRepository() Gets the ClassRepository which holds its definition. By default this is the same as SyntheticRepository.getInstance(); | |
| getSource | back to summary |
|---|---|
public final byte getSource()
| |
| getSourceFileName | back to summary |
|---|---|
public String getSourceFileName()
| |
| getSourceFilePath | back to summary |
|---|---|
| public String getSourceFilePath() Gets the source file path including the package path.
| |
| getSuperClass | back to summary |
|---|---|
public JavaClass getSuperClass() throws ClassNotFoundException
| |
| getSuperClasses | back to summary |
|---|---|
public JavaClass[] getSuperClasses() throws ClassNotFoundException
| |
| getSuperclassName | back to summary |
|---|---|
| public String getSuperclassName() returns the super class name of this class. In the case that this class is
| |
| getSuperclassNameIndex | back to summary |
|---|---|
public int getSuperclassNameIndex()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Return value as defined by given BCELComparator strategy. By default return the hash code of the class name.
| |
| implementationOf | back to summary |
|---|---|
public boolean implementationOf(final JavaClass inter) throws ClassNotFoundException
| |
| indent | back to summary |
|---|---|
| private static String indent(final Object obj) | |
| instanceOf | back to summary |
|---|---|
| public final boolean instanceOf(final JavaClass superclass) throws ClassNotFoundException Equivalent to runtime "instanceof" operator.
| |
| isAnonymous | back to summary |
|---|---|
public final boolean isAnonymous()
| |
| isClass | back to summary |
|---|---|
| public final boolean isClass() | |
| isNested | back to summary |
|---|---|
public final boolean isNested()
| |
| isRecord | back to summary |
|---|---|
| public boolean isRecord() Tests whether this class was declared as a record
| |
| isSuper | back to summary |
|---|---|
| public final boolean isSuper() | |
| setAttributes | back to summary |
|---|---|
public void setAttributes(final Attribute[] attributes)
| |
| setClassName | back to summary |
|---|---|
public void setClassName(final String className)
| |
| setClassNameIndex | back to summary |
|---|---|
public void setClassNameIndex(final int classNameIndex)
| |
| setComparator | back to summary |
|---|---|
public static void setComparator(final BCELComparator<JavaClass> comparator)
| |
| setConstantPool | back to summary |
|---|---|
public void setConstantPool(final ConstantPool constantPool)
| |
| setFields | back to summary |
|---|---|
public void setFields(final Field[] fields)
| |
| setFileName | back to summary |
|---|---|
| public void setFileName(final String fileName) Sets File name of class, aka SourceFile attribute value | |
| setInterfaceNames | back to summary |
|---|---|
public void setInterfaceNames(final String[] interfaceNames)
| |
| setInterfaces | back to summary |
|---|---|
public void setInterfaces(final int[] interfaces)
| |
| setMajor | back to summary |
|---|---|
public void setMajor(final int major)
| |
| setMethods | back to summary |
|---|---|
public void setMethods(final Method[] methods)
| |
| setMinor | back to summary |
|---|---|
public void setMinor(final int minor)
| |
| setRepository | back to summary |
|---|---|
| public void setRepository(final Repository repository) Sets the ClassRepository which loaded the JavaClass. Should be called immediately after parsing is done. | |
| setSourceFileName | back to summary |
|---|---|
| public void setSourceFileName(final String sourceFileName) Sets absolute path to file this class was read from. | |
| setSuperclassName | back to summary |
|---|---|
public void setSuperclassName(final String superclassName)
| |
| setSuperclassNameIndex | back to summary |
|---|---|
public void setSuperclassNameIndex(final int superclassNameIndex)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |