|
||||||||||
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.ConstructorReference
public class ConstructorReference
Class ConstructorReference is used to create a reference to a constructor. To create a constructor reference:
Or:
Or:
Do not use the constructor reference for anything until you have completed the above steps. Once you have completed the above steps and have begun using the constructor reference, do not add further argument types or set the method descriptor.
In the documentation below, the term "referenced constructor" means "the constructor referred to by this constructor reference object."
Constructor Summary | |
---|---|
ConstructorReference(ClassReference theClassReference)
Construct a new constructor reference object. |
|
ConstructorReference(ClassReference theClassReference,
String theMethodDescriptor)
Construct a new constructor reference object with the given method descriptor. |
Method Summary | |
---|---|
void |
addArgumentType(TypeReference theArgumentType)
Add an argument to the referenced constructor. |
void |
setMethodDescriptor(String theMethodDescriptor)
Specify the referenced constructor's method descriptor. |
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 ConstructorReference(ClassReference theClassReference)
theClassReference
- Class containing this constructor.
NullPointerException
- (unchecked exception) Thrown if theClassReference is null.public ConstructorReference(ClassReference theClassReference, String theMethodDescriptor)
theClassReference
- Class containing this constructor.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 theClassReference is null or
theMethodDescriptor is null.
IllegalArgumentException
- (unchecked exception) Thrown if theMethodDescriptor does not
obey the syntax of a method descriptor. Thrown if
theMethodDescriptor indicates that the return type is not
void. Thrown if the number of arguments in
theMethodDescriptor exceeds the limit (254).Method Detail |
---|
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 constructor reference is already in use.
ListFullException
- Thrown if adding theArgumentType would cause the referenced
constructor'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 constructor reference is already in use.
IllegalArgumentException
- (unchecked exception) Thrown if theMethodDescriptor does not
obey the syntax of a method descriptor. Thrown if
theMethodDescriptor indicates that the return type is not
void. Thrown if the number of arguments in
theMethodDescriptor exceeds the limit (254).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |