|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.classfile.SubroutineReference
edu.rit.classfile.SubroutineDescription
edu.rit.classfile.SynthesizedSubroutineDescription
edu.rit.classfile.SynthesizedInterfaceMethodDescription
public class SynthesizedInterfaceMethodDescription
Class SynthesizedInterfaceMethodDescription is used to synthesize a subroutine description for some actual interface method. All interface methods are public, abstract, non-final, and non-static. To synthesize an interface method:
Or:
Or:
In the documentation below, the term "described method" means "the synthesized interface method described by this synthesized interface method description object."
Constructor Summary | |
---|---|
SynthesizedInterfaceMethodDescription(SynthesizedInterfaceDescription theInterfaceDescription,
String theMethodName)
Construct a new synthesized interface method description object with the given name. |
|
SynthesizedInterfaceMethodDescription(SynthesizedInterfaceDescription theInterfaceDescription,
String theMethodName,
String theMethodDescriptor)
Construct a new synthesized interface method description object with the given name and method descriptor. |
Method Summary | |
---|---|
void |
addArgumentType(TypeReference theArgumentType)
Add an argument to the described method. |
void |
addThrownException(ClassReference theExceptionClass)
Add a thrown exception to the described method. |
void |
setMethodDescriptor(String theMethodDescriptor)
Specify the described method's method descriptor. |
void |
setReturnType(TypeReference theReturnType)
Specify the described method's return type. |
Methods inherited from class edu.rit.classfile.SubroutineDescription |
---|
getCodeLength, getExceptionHandlers, getInstructions, getMaxLocals, getMaxStack, getThrownExceptions, isAbstract, isFinal, isNative, isPackageScoped, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized |
Methods inherited from class edu.rit.classfile.SubroutineReference |
---|
equals, getArgumentTypes, getArgumentWordCount, getClassReference, getMethodDescriptor, getMethodName, getReturnType, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SynthesizedInterfaceMethodDescription(SynthesizedInterfaceDescription theInterfaceDescription, String theMethodName) throws ListFullException
theInterfaceDescription
- Interface containing this method.theMethodName
- Method name.
NullPointerException
- (unchecked exception) Thrown if theInterfaceDescription is
null or theMethodName is null.
IllegalArgumentException
- (unchecked exception) Thrown if theMethodName is zero
length.
ListFullException
- Thrown if theInterfaceDescription's subroutine list is full
(i.e., contains 65535 subroutines).public SynthesizedInterfaceMethodDescription(SynthesizedInterfaceDescription theInterfaceDescription, String theMethodName, String theMethodDescriptor) throws ListFullException
theInterfaceDescription
- Interface containing this method.theMethodName
- Method name.theMethodDescriptor
- Method descriptor in the format specified by Section 4.3.3 of the
Java Virtual Machine Specification, Second Edition.
NullPointerException
- (unchecked exception) Thrown if theInterfaceDescription is
null or theMethodName is null or
theMethodDescriptor is null.
IllegalArgumentException
- (unchecked exception) Thrown if theMethodName is zero
length. Thrown if theMethodDescriptor does not obey the
syntax of a method descriptor. Thrown if the number of arguments in
theMethodDescriptor exceeds the limit (254).
ListFullException
- Thrown if theInterfaceDescription's subroutine list is full
(i.e., contains 65535 subroutines).Method Detail |
---|
public void setReturnType(TypeReference theReturnType)
theReturnType
- Type reference for the return type, or null if the
described method returns void.
IllegalStateException
- (unchecked exception) Thrown if the return type cannot be altered
because this method description is already in use.public void addArgumentType(TypeReference theArgumentType) throws ListFullException
theArgumentType
- Argument's type reference.
NullPointerException
- (unchecked exception) Thrown if theArgumentType is null.
IllegalStateException
- (unchecked exception) Thrown if further argument types cannot be
added because this method description is already in use.
ListFullException
- Thrown if adding theArgumentType would cause the described
method's argument word count to exceed the limit (254).public void setMethodDescriptor(String theMethodDescriptor)
theMethodDescriptor
- Method descriptor in the format specified by Section 4.3.3 of the
Java Virtual Machine Specification, Second Edition.
NullPointerException
- (unchecked exception) Thrown if theMethodDescriptor is null.
IllegalStateException
- (unchecked exception) Thrown if the method descriptor cannot be
set because this method description is already in use.
IllegalArgumentException
- (unchecked exception) Thrown if theMethodDescriptor does not
obey the syntax of a method descriptor. Thrown if the number of
arguments in theMethodDescriptor exceeds the limit (254).public void addThrownException(ClassReference theExceptionClass) throws ListFullException
theExceptionClass
- Exception's class reference.
NullPointerException
- (unchecked exception) Thrown if theExceptionClass is null.
ListFullException
- Thrown if the requisite constant pool entries could not be added
because the constant pool is full. Also thrown if the described
method's thrown exception list is full (i.e., contains 65535 thrown
exceptions).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |