|
org.netbeans.modules.classfile/1 1.19 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.modules.classfile.ClassFile
public class ClassFile
Class representing a Java class file.
Constructor Summary | |
---|---|
ClassFile(File file,
boolean includeCode)
Create a new ClassFile object. |
|
ClassFile(InputStream classData)
Create a new ClassFile object. |
|
ClassFile(InputStream classData,
boolean includeCode)
Create a new ClassFile object. |
|
ClassFile(String classFileName)
Create a new ClassFile object. |
|
ClassFile(String classFileName,
boolean includeCode)
Create a new ClassFile object. |
Method Summary | |
---|---|
int |
getAccess()
Returns the access permissions of this class or interface. |
Set<ClassName> |
getAllClassNames()
Return the collection of all unique class references in this class. |
Annotation |
getAnnotation(ClassName annotationClass)
Returns the annotation for a specified annotation type, or null if no annotation of that type exists for this class. |
Collection<Annotation> |
getAnnotations()
Returns all runtime annotations defined for this class. |
AttributeMap |
getAttributes()
Returns a map of the raw attributes for this classfile. |
ConstantPool |
getConstantPool()
Returns the ConstantPool object associated with this ClassFile. |
EnclosingMethod |
getEnclosingMethod()
Returns the enclosing method for this class. |
Collection<InnerClass> |
getInnerClasses()
|
Collection<ClassName> |
getInterfaces()
|
int |
getMajorVersion()
Returns the major version number of this classfile. |
Method |
getMethod(String name,
String signature)
Looks up a method by its name and type signature, as defined by the Java Virtual Machine Specification, section 4.3.3. |
int |
getMethodCount()
|
Collection<Method> |
getMethods()
|
int |
getMinorVersion()
Returns the minor version number of this classfile. |
ClassName |
getName()
Returns the name of this class. |
String |
getSourceFileName()
|
ClassName |
getSuperClass()
Returns the name of this class's superclass. |
String |
getTypeSignature()
Returns the generic type information associated with this class. |
Variable |
getVariable(String name)
Looks up a variable by its name. |
int |
getVariableCount()
|
Collection<Variable> |
getVariables()
|
boolean |
isAnnotation()
Returns true if this class is an annotation type. |
boolean |
isAnnotationPresent(ClassName annotationClass)
Returns true if an annotation of the specified type is defined for this class. |
boolean |
isDeprecated()
|
boolean |
isEnum()
Returns true if this class defines an enum type. |
boolean |
isSynthetic()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassFile(InputStream classData) throws IOException
classData
- an InputStream from which the defining bytes of this
class or interface are read.
IOException
- if InputStream can't be read, or if the class data
is malformed.public ClassFile(String classFileName) throws IOException
classFileName
- the path of a class file.
IOException
- if file cannot be opened or read.public ClassFile(File file, boolean includeCode) throws IOException
file
- a File instance of a class file.includeCode
- true if this classfile should support operations
at the bytecode level. Specify false to conserve
memory if code access isn't needed.
IOException
- if file cannot be opened or read.public ClassFile(InputStream classData, boolean includeCode) throws IOException
classData
- an InputStream from which the defining bytes of this
class or interface are read.includeCode
- true if this classfile should support operations
at the bytecode level. Specify false to conserve
memory if code access isn't needed.
IOException
- if InputStream can't be read, or if the class data
is malformed.public ClassFile(String classFileName, boolean includeCode) throws IOException
classFileName
- the path of a class file.includeCode
- true if this classfile should support operations
at the bytecode level. Specify false to conserve
memory if code access isn't needed.
IOException
- if file cannot be opened or read.Method Detail |
---|
public final ConstantPool getConstantPool()
public final int getAccess()
Access
public final ClassName getName()
public final ClassName getSuperClass()
public final Collection<ClassName> getInterfaces()
public final Variable getVariable(String name)
name
- the name of the variable
public final Collection<Variable> getVariables()
public final int getVariableCount()
public final Method getMethod(String name, String signature)
name
- the name of the methodsignature
- the method's type signature
public final Collection<Method> getMethods()
public final int getMethodCount()
public final String getSourceFileName()
public final boolean isDeprecated()
public final boolean isSynthetic()
public final boolean isAnnotation()
public final boolean isEnum()
public final AttributeMap getAttributes()
Field.getAttributes()
public final Collection<InnerClass> getInnerClasses()
public int getMajorVersion()
public int getMinorVersion()
public String getTypeSignature()
public EnclosingMethod getEnclosingMethod()
public final Collection<Annotation> getAnnotations()
public final Annotation getAnnotation(ClassName annotationClass)
public final boolean isAnnotationPresent(ClassName annotationClass)
public final Set<ClassName> getAllClassNames()
public String toString()
|
org.netbeans.modules.classfile/1 1.19 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |