public class ClassHolder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
access_flags |
protected Attributes |
attribute_info |
protected java.util.Vector<ConstantPoolEntry> |
cptEntries |
private int |
cptEstimatedSize |
protected java.util.Hashtable<java.lang.Object,ConstantPoolEntry> |
cptHashTable |
protected MemberTable |
field_info |
protected int[] |
interfaces |
protected int |
major_version
Minor class format number defaults to
VMDescriptor.JAVA_CLASS_FORMAT_MAJOR_VERSION
|
protected MemberTable |
method_info |
protected int |
minor_version
Minor class format number defaults to
VMDescriptor.JAVA_CLASS_FORMAT_MINOR_VERSION
which currently corresponds to a really old (JDK 1.0.2) setting.
|
private CONSTANT_Index_info |
searchIndex
Used to search for index entries to avoid object allocation
in the case a referecne already exists.
|
protected int |
super_class |
protected int |
this_class |
Modifier | Constructor and Description |
---|---|
protected |
ClassHolder(int estimatedConstantPoolCount) |
|
ClassHolder(java.lang.String fullyQualifiedName,
java.lang.String superClassName,
int modifiers)
This will not define a constructor -- it is up
to the caller to add at least one.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String attributeName,
ClassFormatOutput info) |
int |
addClassReference(java.lang.String fullyQualifiedName)
Add a class entry to the pool.
|
int |
addConstant(double value) |
int |
addConstant(float value) |
int |
addConstant(int value) |
int |
addConstant(long value) |
int |
addConstant(java.lang.String value) |
private int |
addDirectEntry(ConstantPoolEntry item)
Add an entry, but only if it doesn't exist.
|
protected int |
addEntry(java.lang.Object key,
ConstantPoolEntry item)
Generic add entry to constant pool.
|
private CONSTANT_Utf8_info |
addExtraUtf8(java.lang.String value)
Add an extra UTF8 into the pool
|
int |
addFieldReference(ClassMember field) |
int |
addFieldReference(java.lang.String className,
java.lang.String simpleName,
java.lang.String descriptor) |
private int |
addIndexReference(int tag,
int i1,
int i2)
Add an index reference.
|
ClassMember |
addMember(java.lang.String simpleName,
java.lang.String descriptor,
int modifier) |
int |
addMethodReference(java.lang.String className,
java.lang.String simpleName,
java.lang.String descriptor,
boolean isInterface) |
private int |
addNameAndType(java.lang.String name,
java.lang.String descriptor)
Add a name and type entry
|
private int |
addReference(int tag,
ClassMember member) |
private int |
addReference(int tag,
java.lang.String className,
java.lang.String simpleName,
java.lang.String descriptor) |
private int |
addString(java.lang.String value)
Add a string entry
|
int |
addUtf8(java.lang.String value) |
private CONSTANT_Utf8_info |
addUtf8Entry(java.lang.String value)
Add a UTF8 into the pool and return the index to it.
|
protected java.lang.String |
className(int classIndex)
Return the class name for an index to a CONSTANT_Class_info.
|
private static java.lang.String |
convertToInternal(java.lang.String externalName,
boolean descriptor) |
static java.lang.String |
convertToInternalClassName(java.lang.String externalName) |
static java.lang.String |
convertToInternalDescriptor(java.lang.String externalName) |
protected void |
cptPut(ClassFormatOutput out) |
int |
findClass(java.lang.String fullyQualifiedName)
Find a class descriptor (section 4.4.1) and return its
index, returns -1 if not found.
|
protected CONSTANT_Index_info |
findIndexEntry(int tag,
int i1,
int i2) |
protected int |
findIndexIndex(int tag,
int i1,
int i2) |
protected ConstantPoolEntry |
findMatchingEntry(java.lang.Object key) |
int |
findNameAndType(java.lang.String name,
java.lang.String descriptor)
Find a name and type descriptor (section 4.4.6) and
return it's index.
|
(package private) int |
findUtf8(java.lang.String value)
Return the index of a UTF entry or -1 if it doesn't exist.
|
protected java.lang.String |
getClassName(int index)
get the class name of a Class given the index of its CONSTANT_Class_info
entry in the Constant Pool.
|
int |
getConstantPoolIndex() |
ConstantPoolEntry |
getEntry(int index) |
ByteArray |
getFileFormat()
Convert the object representation of the class into
its class file format.
|
int |
getModifier() |
java.lang.String |
getName() |
java.lang.String |
getSuperClassName() |
static boolean |
isExternalClassName(java.lang.String className) |
private static java.lang.String |
makeDesc(char builtin,
int arity)
A helper to build a type description based on a built-in type
and an array arity.
|
private static java.lang.String |
makeDesc(java.lang.String className,
int arity,
boolean descriptor)
A helper to build a type description based on a Java class
and an array arity.
|
(package private) java.lang.String |
nameIndexToString(int index)
get a string (UTF) given a name_index into the constant pool
|
private void |
put(ClassFormatOutput out) |
protected int minor_version
protected int major_version
protected int access_flags
protected int this_class
protected int super_class
protected int[] interfaces
protected MemberTable field_info
protected MemberTable method_info
protected Attributes attribute_info
protected java.util.Hashtable<java.lang.Object,ConstantPoolEntry> cptHashTable
protected java.util.Vector<ConstantPoolEntry> cptEntries
private int cptEstimatedSize
private final CONSTANT_Index_info searchIndex
protected ClassHolder(int estimatedConstantPoolCount)
public ClassHolder(java.lang.String fullyQualifiedName, java.lang.String superClassName, int modifiers)
private void put(ClassFormatOutput out) throws java.io.IOException
java.io.IOException
public ByteArray getFileFormat() throws java.io.IOException
java.io.IOException
- error writing the classpublic int getModifier()
ClassMember
public java.lang.String getName()
ClassMember
public ClassMember addMember(java.lang.String simpleName, java.lang.String descriptor, int modifier)
public int addFieldReference(java.lang.String className, java.lang.String simpleName, java.lang.String descriptor)
public int addFieldReference(ClassMember field)
public int addMethodReference(java.lang.String className, java.lang.String simpleName, java.lang.String descriptor, boolean isInterface)
private int addReference(int tag, java.lang.String className, java.lang.String simpleName, java.lang.String descriptor)
private int addReference(int tag, ClassMember member)
public int addConstant(java.lang.String value)
addConstant(java.lang.String)
public int addUtf8(java.lang.String value)
addUtf8(java.lang.String)
public int addConstant(int value)
addConstant(java.lang.String)
public int addConstant(float value)
addConstant(java.lang.String)
public int addConstant(long value)
addConstant(java.lang.String)
public int addConstant(double value)
addConstant(java.lang.String)
public int getConstantPoolIndex()
ClassMember
public void addAttribute(java.lang.String attributeName, ClassFormatOutput info)
public java.lang.String getSuperClassName()
protected int addEntry(java.lang.Object key, ConstantPoolEntry item)
private int addDirectEntry(ConstantPoolEntry item)
private int addIndexReference(int tag, int i1, int i2)
public int addClassReference(java.lang.String fullyQualifiedName)
private int addNameAndType(java.lang.String name, java.lang.String descriptor)
private CONSTANT_Utf8_info addUtf8Entry(java.lang.String value)
private CONSTANT_Utf8_info addExtraUtf8(java.lang.String value)
private int addString(java.lang.String value)
protected void cptPut(ClassFormatOutput out) throws java.io.IOException
java.io.IOException
public ConstantPoolEntry getEntry(int index)
protected java.lang.String className(int classIndex)
int findUtf8(java.lang.String value)
public int findClass(java.lang.String fullyQualifiedName)
public int findNameAndType(java.lang.String name, java.lang.String descriptor)
returns -1 if not found.
protected CONSTANT_Index_info findIndexEntry(int tag, int i1, int i2)
protected int findIndexIndex(int tag, int i1, int i2)
protected ConstantPoolEntry findMatchingEntry(java.lang.Object key)
java.lang.String nameIndexToString(int index)
protected java.lang.String getClassName(int index)
public static boolean isExternalClassName(java.lang.String className)
public static java.lang.String convertToInternalClassName(java.lang.String externalName)
public static java.lang.String convertToInternalDescriptor(java.lang.String externalName)
private static java.lang.String convertToInternal(java.lang.String externalName, boolean descriptor)
private static java.lang.String makeDesc(char builtin, int arity)
private static java.lang.String makeDesc(java.lang.String className, int arity, boolean descriptor)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.