Class ClassFile
- java.lang.Object
-
- com.sun.enterprise.deployment.annotation.introspection.ClassFile
-
public class ClassFile extends Object
This class is encapsulating binary .class file information as defined at http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html This is used by the annotation frameworks to quickly scan .class files for the presence of annotations. This avoid the annotation framework having to load each .class file in the class loader. The bytecode to be scanned could come from either a File (which lends itself easily to a channel) or from a JAR (which works better with a byte array). So we provide two variants of the containsAnnotation method, one for each.- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACC_ABSTRACT
static int
ACC_FINAL
static int
ACC_INTERFACE
static int
ACC_NATIVE
static int
ACC_PRIVATE
static int
ACC_PROTECTED
static int
ACC_PUBLIC
static int
ACC_STATIC
static int
ACC_SYNCHRONIZED
static int
ACC_THREADSAFE
static int
ACC_TRANSIENT
short
accessFlags
ConstantPoolInfo[]
constantPool
ConstantPoolInfo[]
interfaces
ConstantPoolInfo
superClass
ConstantPoolInfo
thisClass
-
Constructor Summary
Constructors Constructor Description ClassFile(ConstantPoolInfo poolInfo)
Creates a new instance of ClassFile
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsAnnotation(byte[] bytecode)
Read the input channel and initialize instance data structure.boolean
containsAnnotation(ReadableByteChannel in, long size)
Read the input channel and initialize instance data structure.
-
-
-
Field Detail
-
constantPool
public ConstantPoolInfo[] constantPool
-
accessFlags
public short accessFlags
-
thisClass
public ConstantPoolInfo thisClass
-
superClass
public ConstantPoolInfo superClass
-
interfaces
public ConstantPoolInfo[] interfaces
-
ACC_PUBLIC
public static final int ACC_PUBLIC
- See Also:
- Constant Field Values
-
ACC_PRIVATE
public static final int ACC_PRIVATE
- See Also:
- Constant Field Values
-
ACC_PROTECTED
public static final int ACC_PROTECTED
- See Also:
- Constant Field Values
-
ACC_STATIC
public static final int ACC_STATIC
- See Also:
- Constant Field Values
-
ACC_FINAL
public static final int ACC_FINAL
- See Also:
- Constant Field Values
-
ACC_SYNCHRONIZED
public static final int ACC_SYNCHRONIZED
- See Also:
- Constant Field Values
-
ACC_THREADSAFE
public static final int ACC_THREADSAFE
- See Also:
- Constant Field Values
-
ACC_TRANSIENT
public static final int ACC_TRANSIENT
- See Also:
- Constant Field Values
-
ACC_NATIVE
public static final int ACC_NATIVE
- See Also:
- Constant Field Values
-
ACC_INTERFACE
public static final int ACC_INTERFACE
- See Also:
- Constant Field Values
-
ACC_ABSTRACT
public static final int ACC_ABSTRACT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClassFile
public ClassFile(ConstantPoolInfo poolInfo)
Creates a new instance of ClassFile
-
-
Method Detail
-
containsAnnotation
public boolean containsAnnotation(ReadableByteChannel in, long size) throws IOException
Read the input channel and initialize instance data structure.- Throws:
IOException
-
containsAnnotation
public boolean containsAnnotation(byte[] bytecode) throws IOException
Read the input channel and initialize instance data structure.- Throws:
IOException
-
-