org.apache.derby.iapi.services.classfile
Class ClassHolder
- java.lang.Object
-
- org.apache.derby.iapi.services.classfile.ClassHolder
-
- Direct Known Subclasses:
- ClassInvestigator
public class ClassHolder extends java.lang.ObjectBased upon "THE class FILE FORMAT" chapter of "The Java Virtual Machine Specification" corresponding to version 1.0.2 of the Java Virtual Machine and 1.0.2 of the Java Language Specification. ISBN 0-201-63452-X, September 1996.
-
-
Constructor Summary
Constructors Constructor and Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddAttribute(java.lang.String attributeName, ClassFormatOutput info)intaddClassReference(java.lang.String fullyQualifiedName)Add a class entry to the pool.intaddConstant(double value)intaddConstant(float value)intaddConstant(int value)intaddConstant(long value)intaddConstant(java.lang.String value)intaddFieldReference(ClassMember field)intaddFieldReference(java.lang.String className, java.lang.String simpleName, java.lang.String descriptor)ClassMemberaddMember(java.lang.String simpleName, java.lang.String descriptor, int modifier)intaddMethodReference(java.lang.String className, java.lang.String simpleName, java.lang.String descriptor, boolean isInterface)intaddUtf8(java.lang.String value)static java.lang.StringconvertToInternalClassName(java.lang.String externalName)static java.lang.StringconvertToInternalDescriptor(java.lang.String externalName)intfindClass(java.lang.String fullyQualifiedName)Find a class descriptor (section 4.4.1) and return its index, returns -1 if not found.intfindNameAndType(java.lang.String name, java.lang.String descriptor)Find a name and type descriptor (section 4.4.6) and return it's index.intgetConstantPoolIndex()ConstantPoolEntrygetEntry(int index)ByteArraygetFileFormat()Convert the object representation of the class into its class file format.intgetModifier()java.lang.StringgetName()java.lang.StringgetSuperClassName()static booleanisExternalClassName(java.lang.String className)
-
-
-
Constructor Detail
-
ClassHolder
public 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.
-
-
Method Detail
-
getFileFormat
public ByteArray getFileFormat() throws java.io.IOException
Convert the object representation of the class into its class file format.- Throws:
java.io.IOException- error writing the class
-
getModifier
public int getModifier()
- See Also:
ClassMember
-
getName
public java.lang.String getName()
- See Also:
ClassMember
-
addMember
public ClassMember addMember(java.lang.String simpleName, java.lang.String descriptor, int modifier)
-
addFieldReference
public int addFieldReference(java.lang.String className, java.lang.String simpleName, java.lang.String descriptor)
-
addFieldReference
public int addFieldReference(ClassMember field)
-
addMethodReference
public int addMethodReference(java.lang.String className, java.lang.String simpleName, java.lang.String descriptor, boolean isInterface)
-
addConstant
public int addConstant(java.lang.String value)
- See Also:
addConstant(java.lang.String)
-
addUtf8
public int addUtf8(java.lang.String value)
- See Also:
addUtf8(java.lang.String)
-
addConstant
public int addConstant(int value)
- See Also:
addConstant(java.lang.String)
-
addConstant
public int addConstant(float value)
- See Also:
addConstant(java.lang.String)
-
addConstant
public int addConstant(long value)
- See Also:
addConstant(java.lang.String)
-
addConstant
public int addConstant(double value)
- See Also:
addConstant(java.lang.String)
-
getConstantPoolIndex
public int getConstantPoolIndex()
- See Also:
ClassMember
-
addAttribute
public void addAttribute(java.lang.String attributeName, ClassFormatOutput info)
-
getSuperClassName
public java.lang.String getSuperClassName()
-
addClassReference
public int addClassReference(java.lang.String fullyQualifiedName)
Add a class entry to the pool.
-
getEntry
public ConstantPoolEntry getEntry(int index)
-
findClass
public int findClass(java.lang.String fullyQualifiedName)
Find a class descriptor (section 4.4.1) and return its index, returns -1 if not found.
-
findNameAndType
public 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.returns -1 if not found.
-
isExternalClassName
public static boolean isExternalClassName(java.lang.String className)
-
convertToInternalClassName
public static java.lang.String convertToInternalClassName(java.lang.String externalName)
-
convertToInternalDescriptor
public static java.lang.String convertToInternalDescriptor(java.lang.String externalName)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG