|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjas.ClassEnv
This is the place where all information about the class to be created resides.
| Field Summary |
| Constructor Summary | |
ClassEnv()
|
|
| Method Summary | |
void |
addCPItem(CP cp)
This is the method to add CPE items to a class. |
void |
addField(Var v)
|
void |
addGenericAttr(GenericAttr g)
Add a generic attribute to the class file. |
void |
addInterface(CP ifc)
Add this CP to the list of interfaces supposedly implemented by this class. |
void |
addInterface(CP[] ilist)
Add this to the list of interfaces supposedly implemented by this class. |
void |
addMethod(Method m)
This allows more control over generating CP's for methods if you feel so inclined. |
void |
addMethod(short acc,
String name,
String sig,
CodeAttr code,
ExceptAttr ex)
Here is where code gets added to a class. |
void |
setClass(CP name)
Define this class to have this name. |
void |
setClassAccess(short access)
Set the class access for this class. |
void |
setSource(SourceAttr source)
Add an attribute specifying the name of the source file for the class |
void |
setSource(String source)
Add an attribute specifying the name of the source file for the clas. |
void |
setSuperClass(CP name)
Define this class to have this superclass |
void |
write(DataOutputStream out)
Write the contents of the class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ClassEnv()
| Method Detail |
public void setClass(CP name)
name - CPE representing name for class. (This is usually
a ClassCP)public void setSuperClass(CP name)
name - CPE representing name for class. (This is usually
a ClassCP)public void setClassAccess(short access)
access - number representing access permissions for
the entire class.RuntimeConstantspublic void addInterface(CP ifc)
public void addInterface(CP[] ilist)
ilist - An array of CP items representing the
interfaces implemented by this class.public void addField(Var v)
public void write(DataOutputStream out)
throws IOException,
jasError
out - DataOutputStream on which the contents are written.
IOException
jasErrorpublic void addCPItem(CP cp)
cp - Item to be added to the class
public void addMethod(short acc,
String name,
String sig,
CodeAttr code,
ExceptAttr ex)
acc - method_access permissions, expressed with some combination
of the values defined in RuntimeConstantsname - Name of the methodsig - Signature for the methodcode - Actual code for the methodex - Any exception attribute to be associated with methodpublic void setSource(SourceAttr source)
source - SourceAttribute specifying the source for the filepublic void setSource(String source)
source - String with the name of the classpublic void addGenericAttr(GenericAttr g)
public void addMethod(Method m)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||