|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjas.ClassEnv
public class ClassEnv
This is the place where all information about the class to be created resides.
Field Summary |
---|
Constructor Summary | |
---|---|
ClassEnv()
|
Method Summary | |
---|---|
Annotation |
addAnnotation(boolean visible,
String clsname)
|
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 |
addInnerClass(short iacc,
String name,
String inner,
String outer)
|
void |
addInterface(CP[] ilist)
Add this to the list of interfaces supposedly implemented by this class. |
void |
addInterface(CP ifc)
Add this CP 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 |
endHeader()
|
void |
setClassAccess(short access)
Set the class access for this class. |
void |
setClass(CP name)
Define this class to have this name. |
void |
setDeprecated(DeprecatedAttr depr)
|
void |
setEnclosingMethod(String cls,
String mtd,
String dsc)
Add an attribute specifying the enclosing method of this class |
void |
setSignature(String sig)
Add an attribute specifying the signature of this class |
void |
setSourceDebugExtension(String debug)
Add an attribute specifying extended debug information |
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 |
setVersion(short version_high,
short version_low)
Change the bytecode version of this class The version will be version_high.version_low |
void |
write(DataOutputStream out)
Write the contents of the class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notifyAll, notify, 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.RuntimeConstants
public 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
jasError
public void addCPItem(CP cp)
cp
- Item to be added to the classpublic 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 setSourceDebugExtension(String debug)
debug
- String the extended debug informationpublic void setEnclosingMethod(String cls, String mtd, String dsc)
cls
- String the enclosing classmtd
- String the enclosing methoddsc
- String the enclosing method descriptorpublic void setSignature(String sig)
sig
- String the signaturepublic void setDeprecated(DeprecatedAttr depr)
public void addGenericAttr(GenericAttr g)
public void addInnerClass(short iacc, String name, String inner, String outer)
public Annotation addAnnotation(boolean visible, String clsname)
public void endHeader()
public void addMethod(Method m)
public void setVersion(short version_high, short version_low)
version_high
- shortversion_low
- short
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |