Top Description Fields Constructors Methods
org.apache.tomcat.util.bcel.classfile

public Class JavaClass

extends Object
Class Inheritance
Imports
java.util.HashMap, .List

Represents a Java class, i.e., the data structures, constant pool, fields, methods and commands contained in a Java .class file. See JVM specification for details. The intent of this class is to represent a parsed or otherwise existing class file. Those interested in programmatically generating classes should see the ClassGen class.

Field Summary

Modifier and TypeField and Description
private final int
private final String
private final String[]
private final Annotations
private final List<Annotations>
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
JavaClass(final String
Name of this class.
className
,
final String
Name of this class's superclass.
superclassName
,
final int
Access rights defined by bit flags
accessFlags
,
final ConstantPool
Array of constants
constantPool
,
final String[]
Implemented interfaces
interfaceNames
,
final Annotations
"RuntimeVisibleAnnotations" attribute defined on the Class, or null
runtimeVisibleAnnotations
,
final List<Annotations>
"RuntimeVisibleAnnotations" attribute defined on the fields or methods, or null
runtimeVisibleFieldOrMethodAnnotations
)

Constructor gets all contents as arguments.

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

Access flags of the object aka. "modifiers".
getAccessFlags
()

public AnnotationEntry[]

Returns:

An array of entries or null
getAllAnnotationEntries
()

Return annotations entries from "RuntimeVisibleAnnotations" attribute on the class, fields or methods if there is any.

public AnnotationEntry[]

Returns:

An array of entries or null
getAnnotationEntries
()

Return annotations entries from "RuntimeVisibleAnnotations" attribute on the class, if there is any.

public String

Returns:

Class name.
getClassName
()

public String[]

Returns:

Names of implemented interfaces.
getInterfaceNames
()

public String

Returns:

Superclass name.
getSuperclassName
()

returns the super class name of this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessFlagsback to summary
private final int accessFlags
classNameback to summary
private final String className
interfaceNamesback to summary
private final String[] interfaceNames
runtimeVisibleAnnotationsback to summary
private final Annotations runtimeVisibleAnnotations
runtimeVisibleFieldOrMethodAnnotationsback to summary
private final List<Annotations> runtimeVisibleFieldOrMethodAnnotations
superclassNameback to summary
private final String superclassName

Constructor Detail

JavaClassback to summary
pack-priv JavaClass(final String className, final String superclassName, final int accessFlags, final ConstantPool constantPool, final String[] interfaceNames, final Annotations runtimeVisibleAnnotations, final List<Annotations> runtimeVisibleFieldOrMethodAnnotations)

Constructor gets all contents as arguments.

Parameters
className:String

Name of this class.

superclassName:String

Name of this class's superclass.

accessFlags:int

Access rights defined by bit flags

constantPool:ConstantPool

Array of constants

interfaceNames:String[]

Implemented interfaces

runtimeVisibleAnnotations:Annotations

"RuntimeVisibleAnnotations" attribute defined on the Class, or null

runtimeVisibleFieldOrMethodAnnotations:List<Annotations>

"RuntimeVisibleAnnotations" attribute defined on the fields or methods, or null

Method Detail

getAccessFlagsback to summary
public final int getAccessFlags()
Returns:int

Access flags of the object aka. "modifiers".

getAllAnnotationEntriesback to summary
public AnnotationEntry[] getAllAnnotationEntries()

Return annotations entries from "RuntimeVisibleAnnotations" attribute on the class, fields or methods if there is any.

Returns:AnnotationEntry[]

An array of entries or null

getAnnotationEntriesback to summary
public AnnotationEntry[] getAnnotationEntries()

Return annotations entries from "RuntimeVisibleAnnotations" attribute on the class, if there is any.

Returns:AnnotationEntry[]

An array of entries or null

getClassNameback to summary
public String getClassName()
Returns:String

Class name.

getInterfaceNamesback to summary
public String[] getInterfaceNames()
Returns:String[]

Names of implemented interfaces.

getSuperclassNameback to summary
public String getSuperclassName()

returns the super class name of this class. In the case that this class is java.lang.Object, it will return itself (java.lang.Object). This is probably incorrect but isn't fixed at this time to not break existing clients.

Returns:String

Superclass name.