openjava.mop
Class OJConstructor
java.lang.Object
|
+--openjava.mop.OJConstructor
- All Implemented Interfaces:
- OJMember
- public final class OJConstructor
- extends Object
- implements OJMember
Constructor Summary |
(package private) |
OJConstructor(Constructor m)
|
|
OJConstructor(Environment env,
OJClass declarer,
ConstructorDeclaration d)
|
|
OJConstructor(OJClass declarer,
OJModifier modif,
OJClass[] parameterTypes,
OJClass[] exceptionTypes,
ConstructorInvocation ci,
StatementList body)
|
|
OJConstructor(OJClass declarer,
OJModifier modif,
OJClass[] parameterTypes,
String[] parameterNames,
OJClass[] exceptionTypes,
ConstructorInvocation ci,
StatementList body)
|
|
OJConstructor(OJClass declarer,
OJModifier modif,
ParameterList params,
OJClass[] exceptionTypes,
ConstructorInvocation ci,
StatementList body)
|
substance
private OJConstructorImp substance
table
private static Hashtable table
OJConstructor
OJConstructor(Constructor m)
OJConstructor
public OJConstructor(OJClass declarer,
OJModifier modif,
OJClass[] parameterTypes,
OJClass[] exceptionTypes,
ConstructorInvocation ci,
StatementList body)
OJConstructor
public OJConstructor(OJClass declarer,
OJModifier modif,
OJClass[] parameterTypes,
String[] parameterNames,
OJClass[] exceptionTypes,
ConstructorInvocation ci,
StatementList body)
OJConstructor
public OJConstructor(OJClass declarer,
OJModifier modif,
ParameterList params,
OJClass[] exceptionTypes,
ConstructorInvocation ci,
StatementList body)
OJConstructor
public OJConstructor(Environment env,
OJClass declarer,
ConstructorDeclaration d)
forConstructor
public static OJConstructor forConstructor(Constructor java_constr)
arrayForConstructors
public static OJConstructor[] arrayForConstructors(Constructor[] jconstrs)
signature
public Signature signature()
- Specified by:
signature
in interface OJMember
getDeclaringClass
public OJClass getDeclaringClass()
- Specified by:
getDeclaringClass
in interface OJMember
getName
public String getName()
- Specified by:
getName
in interface OJMember
getIdentifiableName
public String getIdentifiableName()
getModifiers
public OJModifier getModifiers()
- Specified by:
getModifiers
in interface OJMember
getParameterTypes
public OJClass[] getParameterTypes()
getExceptionTypes
public OJClass[] getExceptionTypes()
getSuffix
public ParseTree getSuffix(String keyword)
getParameterVariables
public ExpressionList getParameterVariables()
throws CannotAlterException
CannotAlterException
getParameters
public String[] getParameters()
throws CannotAlterException
CannotAlterException
equals
public boolean equals(Object obj)
- Compares this method against the given object.
The algorithm is borrowed by java.lang.reflect.Constructor.equals().
- Overrides:
equals
in class Object
- See Also:
Constructor.equals(java.lang.Object)
compareParameters
private boolean compareParameters(OJConstructor other)
compareParameters
private boolean compareParameters(OJClass[] params2)
hashCode
public int hashCode()
- Computes a hashcode for this method. The algorithm is borrowed
by java.lang.reflect.Constructor.hashCode().
- Overrides:
hashCode
in class Object
- See Also:
Constructor.hashCode()
toString
public String toString()
- Overrides:
toString
in class Object
getEnvironment
public Environment getEnvironment()
- Specified by:
getEnvironment
in interface OJMember
newInstance
public Object newInstance(Object[] initargs)
throws InstantiationException,
IllegalAccessException,
IllegalArgumentException,
InvocationTargetException,
InstantiationException,
CannotExecuteException
- Creates a new instance of the constructor's declaring class
- Throws:
CannotExecuteException
- if the constructor is not
compiled yet.
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
isExecutable
public final boolean isExecutable()
isAlterable
public final boolean isAlterable()
getByteCode
public final Constructor getByteCode()
throws CannotExecuteException
CannotExecuteException
getSourceCode
public final ConstructorDeclaration getSourceCode()
throws CannotAlterException
CannotAlterException
getBody
public final StatementList getBody()
throws CannotAlterException
CannotAlterException
getTransference
public final ConstructorInvocation getTransference()
throws CannotAlterException
CannotAlterException
setDeclaringClass
void setDeclaringClass(OJClass parent)
throws CannotAlterException
CannotAlterException
setModifiers
public final void setModifiers(int mods)
throws CannotAlterException
CannotAlterException
setExceptionTypes
public final void setExceptionTypes(OJClass[] types)
throws CannotAlterException
CannotAlterException
addExceptionType
public final void addExceptionType(OJClass type)
throws CannotAlterException
CannotAlterException
setTransference
public final ConstructorInvocation setTransference(ConstructorInvocation invocation)
throws CannotAlterException
CannotAlterException
setBody
public final StatementList setBody(StatementList stmts)
throws CannotAlterException
CannotAlterException