|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.bytecode.JAnnotationObject
com.caucho.bytecode.JClass
com.caucho.bytecode.JavaClass
public class JavaClass
Represents a java class.
| Field Summary | |
|---|---|
static int |
ACC_FINAL
|
static int |
ACC_PRIVATE
|
static int |
ACC_PROTECTED
|
static int |
ACC_PUBLIC
|
static int |
ACC_STATIC
|
static int |
ACC_SUPER
|
static int |
MAGIC
|
| Fields inherited from class com.caucho.bytecode.JClass |
|---|
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, OBJECT, SHORT, STRING, VOID |
| Constructor Summary | |
|---|---|
JavaClass()
|
|
JavaClass(JavaClassLoader loader)
|
|
| Method Summary | |
|---|---|
void |
addAttribute(Attribute attr)
Adds an attribute |
void |
addField(JavaField field)
Adds a field |
void |
addInterface(java.lang.String className)
Adds an interface. |
void |
addMethod(JavaMethod method)
Adds a method |
JavaField |
createField(java.lang.String name,
java.lang.String descriptor)
|
JavaMethod |
createMethod(java.lang.String name,
java.lang.String descriptor)
|
JavaMethod |
findMethod(java.lang.String name,
java.lang.String descriptor)
Finds a method. |
int |
getAccessFlags()
Gets the access flags. |
JAnnotation |
getAnnotation(java.lang.String className)
Returns the annotation. |
Attribute |
getAttribute(java.lang.String name)
Returns the attribute. |
java.util.ArrayList<Attribute> |
getAttributeList()
Returns the methods. |
JavaClassLoader |
getClassLoader()
Returns the loader. |
ConstantPool |
getConstantPool()
Returns the class's constant pool. |
JMethod[] |
getConstructors()
Returns the array of declared methods. |
JAnnotation[] |
getDeclaredAnnotations()
Returns the declared annotations. |
JField[] |
getDeclaredFields()
Returns the array of declared fields. |
JMethod[] |
getDeclaredMethods()
Returns the array of declared methods. |
JavaField |
getField(java.lang.String name)
Returns a fields. |
java.util.ArrayList<JavaField> |
getFieldList()
Returns the fields. |
JField[] |
getFields()
Returns the array of fields. |
java.util.ArrayList<java.lang.String> |
getInterfaceNames()
Adds an interface. |
JClass[] |
getInterfaces()
Gets the interfaces. |
int |
getMajor()
Gets the major identifier of the class file. |
JavaMethod |
getMethod(java.lang.String name)
Returns a method. |
JMethod |
getMethod(java.lang.String name,
JClass[] paramTypes)
Returns the matching method |
java.util.ArrayList<JavaMethod> |
getMethodList()
Returns the methods. |
JMethod[] |
getMethods()
Returns the matching method |
int |
getMinor()
Gets the minor identifier of the class file. |
java.lang.String |
getName()
Returns the class-equivalent name. |
JClass |
getSuperClass()
Gets the super class name. |
java.lang.String |
getSuperClassName()
Gets the super class name. |
java.lang.String |
getThisClass()
Gets this class name. |
boolean |
isAbstract()
Returns true for an abstract class. |
boolean |
isArray()
Returns true for an array. |
boolean |
isAssignableFrom(java.lang.Class cl)
Returns true if the class is assignable from the argument. |
boolean |
isAssignableFrom(JClass cl)
Returns true if the class is assignable from the argument. |
boolean |
isAssignableTo(java.lang.Class cl)
Returns true if the class is assignable from the argument. |
boolean |
isFinal()
Returns true for a final class. |
boolean |
isInterface()
Returns true for an interface. |
boolean |
isPrimitive()
Returns true for a primitive class. |
boolean |
isPublic()
Returns true for a public class. |
void |
setAccessFlags(int flags)
Sets the access flags. |
void |
setMajor(int major)
Sets the major identifier of the class file. |
void |
setMinor(int minor)
Sets the minor identifier of the class file. |
void |
setSuperClass(java.lang.String className)
Sets the super class. |
void |
setThisClass(java.lang.String className)
Sets this class. |
void |
setURL(java.net.URL url)
Sets the URL. |
void |
setWrite(boolean isWrite)
|
java.lang.String |
toString()
|
void |
write(WriteStream os)
Writes the class to the output. |
| Methods inherited from class com.caucho.bytecode.JClass |
|---|
equals, getActualTypeArguments, getComponentType, getConstructor, getJavaClass, getPrintName, getRawType, getShortName, getSimpleName, hashCode |
| Methods inherited from class com.caucho.bytecode.JAnnotationObject |
|---|
getAnnotation, isAnnotationPresent, isAnnotationPresent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAGIC
public static final int ACC_PUBLIC
public static final int ACC_PRIVATE
public static final int ACC_PROTECTED
public static final int ACC_STATIC
public static final int ACC_FINAL
public static final int ACC_SUPER
| Constructor Detail |
|---|
public JavaClass()
public JavaClass(JavaClassLoader loader)
| Method Detail |
|---|
public JavaClassLoader getClassLoader()
public void setWrite(boolean isWrite)
public void setURL(java.net.URL url)
public void setMajor(int major)
public int getMajor()
public void setMinor(int minor)
public int getMinor()
public ConstantPool getConstantPool()
public void setAccessFlags(int flags)
public int getAccessFlags()
public void setThisClass(java.lang.String className)
public java.lang.String getThisClass()
public void setSuperClass(java.lang.String className)
public java.lang.String getSuperClassName()
public JClass getSuperClass()
getSuperClass in interface JTypegetSuperClass in class JClasspublic boolean isFinal()
isFinal in interface JTypeisFinal in class JClasspublic boolean isAbstract()
isAbstract in interface JTypeisAbstract in class JClasspublic boolean isPublic()
isPublic in interface JTypeisPublic in class JClasspublic boolean isPrimitive()
isPrimitive in interface JTypeisPrimitive in class JClasspublic void addInterface(java.lang.String className)
public java.util.ArrayList<java.lang.String> getInterfaceNames()
public JClass[] getInterfaces()
getInterfaces in interface JTypegetInterfaces in class JClasspublic void addField(JavaField field)
public JavaField createField(java.lang.String name,
java.lang.String descriptor)
public java.util.ArrayList<JavaField> getFieldList()
public JavaField getField(java.lang.String name)
public void addMethod(JavaMethod method)
public JavaMethod createMethod(java.lang.String name,
java.lang.String descriptor)
public java.util.ArrayList<JavaMethod> getMethodList()
public boolean isArray()
isArray in interface JTypeisArray in class JClasspublic boolean isInterface()
isInterface in interface JTypeisInterface in class JClasspublic JavaMethod getMethod(java.lang.String name)
public JavaMethod findMethod(java.lang.String name,
java.lang.String descriptor)
public void addAttribute(Attribute attr)
public java.util.ArrayList<Attribute> getAttributeList()
public Attribute getAttribute(java.lang.String name)
public java.lang.String getName()
getName in interface JTypegetName in class JClasspublic boolean isAssignableFrom(JClass cl)
isAssignableFrom in interface JTypeisAssignableFrom in class JClasspublic boolean isAssignableFrom(java.lang.Class cl)
isAssignableFrom in interface JTypeisAssignableFrom in class JClasspublic boolean isAssignableTo(java.lang.Class cl)
isAssignableTo in interface JTypeisAssignableTo in class JClasspublic JMethod[] getDeclaredMethods()
getDeclaredMethods in interface JTypegetDeclaredMethods in class JClasspublic JMethod[] getConstructors()
getConstructors in class JClass
public JMethod getMethod(java.lang.String name,
JClass[] paramTypes)
getMethod in interface JTypegetMethod in class JClasspublic JMethod[] getMethods()
getMethods in interface JTypegetMethods in class JClasspublic JField[] getDeclaredFields()
getDeclaredFields in interface JTypegetDeclaredFields in class JClasspublic JField[] getFields()
getFields in interface JTypegetFields in class JClasspublic JAnnotation[] getDeclaredAnnotations()
getDeclaredAnnotations in class JAnnotationObjectpublic JAnnotation getAnnotation(java.lang.String className)
getAnnotation in class JAnnotationObject
public void write(WriteStream os)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class JClass
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||