openjava.mop
Class OJConstructor

java.lang.Object
  |
  +--openjava.mop.OJConstructor

public final class OJConstructor
extends java.lang.Object
implements OJMember


Fields inherited from interface openjava.mop.OJMember
DECLARED, PUBLIC
 
Constructor Summary
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, java.lang.String[] parameterNames, OJClass[] exceptionTypes, ConstructorInvocation ci, StatementList body)
           
OJConstructor(OJClass declarer, OJModifier modif, ParameterList params, OJClass[] exceptionTypes, ConstructorInvocation ci, StatementList body)
           
 
Method Summary
 void addExceptionType(OJClass type)
           
static OJConstructor[] arrayForConstructors(java.lang.reflect.Constructor[] jconstrs)
           
 boolean equals(java.lang.Object obj)
          Compares this method against the given object.
static OJConstructor forConstructor(java.lang.reflect.Constructor java_constr)
           
 StatementList getBody()
           
 java.lang.reflect.Constructor getByteCode()
           
 OJClass getDeclaringClass()
           
 Environment getEnvironment()
           
 OJClass[] getExceptionTypes()
           
 java.lang.String getIdentifiableName()
           
 OJModifier getModifiers()
           
 java.lang.String getName()
           
 java.lang.String[] getParameters()
           
 OJClass[] getParameterTypes()
           
 ExpressionList getParameterVariables()
           
 ConstructorDeclaration getSourceCode()
           
 ParseTree getSuffix(java.lang.String keyword)
           
 ConstructorInvocation getTransference()
           
 int hashCode()
          Computes a hashcode for this method.
 boolean isAlterable()
           
 boolean isExecutable()
           
 java.lang.Object newInstance(java.lang.Object[] initargs)
          Creates a new instance of the constructor's declaring class
 StatementList setBody(StatementList stmts)
           
 void setExceptionTypes(OJClass[] types)
           
 void setModifiers(int mods)
           
 ConstructorInvocation setTransference(ConstructorInvocation invocation)
           
 Signature signature()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OJConstructor

public OJConstructor(OJClass declarer,
                     OJModifier modif,
                     OJClass[] parameterTypes,
                     OJClass[] exceptionTypes,
                     ConstructorInvocation ci,
                     StatementList body)

OJConstructor

public OJConstructor(OJClass declarer,
                     OJModifier modif,
                     OJClass[] parameterTypes,
                     java.lang.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)
Method Detail

forConstructor

public static OJConstructor forConstructor(java.lang.reflect.Constructor java_constr)

arrayForConstructors

public static OJConstructor[] arrayForConstructors(java.lang.reflect.Constructor[] jconstrs)

signature

public Signature signature()
Specified by:
signature in interface OJMember

getDeclaringClass

public OJClass getDeclaringClass()
Specified by:
getDeclaringClass in interface OJMember

getName

public java.lang.String getName()
Specified by:
getName in interface OJMember

getIdentifiableName

public java.lang.String getIdentifiableName()

getModifiers

public OJModifier getModifiers()
Specified by:
getModifiers in interface OJMember

getParameterTypes

public OJClass[] getParameterTypes()

getExceptionTypes

public OJClass[] getExceptionTypes()

getSuffix

public ParseTree getSuffix(java.lang.String keyword)

getParameterVariables

public ExpressionList getParameterVariables()
                                     throws CannotAlterException

getParameters

public java.lang.String[] getParameters()
                                 throws CannotAlterException

equals

public boolean equals(java.lang.Object obj)
Compares this method against the given object. The algorithm is borrowed by java.lang.reflect.Constructor.equals().
Overrides:
equals in class java.lang.Object
See Also:
Constructor.equals(java.lang.Object)

hashCode

public int hashCode()
Computes a hashcode for this method. The algorithm is borrowed by java.lang.reflect.Constructor.hashCode().
Overrides:
hashCode in class java.lang.Object
See Also:
Constructor.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getEnvironment

public Environment getEnvironment()
Specified by:
getEnvironment in interface OJMember

newInstance

public java.lang.Object newInstance(java.lang.Object[] initargs)
                             throws java.lang.InstantiationException,
                                    java.lang.IllegalAccessException,
                                    java.lang.IllegalArgumentException,
                                    java.lang.reflect.InvocationTargetException,
                                    java.lang.InstantiationException,
                                    CannotExecuteException
Creates a new instance of the constructor's declaring class
Throws:
CannotExecuteException - if the constructor is not compiled yet.

isExecutable

public final boolean isExecutable()

isAlterable

public final boolean isAlterable()

getByteCode

public final java.lang.reflect.Constructor getByteCode()
                                                throws CannotExecuteException

getSourceCode

public final ConstructorDeclaration getSourceCode()
                                           throws CannotAlterException

getBody

public final StatementList getBody()
                            throws CannotAlterException

getTransference

public final ConstructorInvocation getTransference()
                                            throws CannotAlterException

setModifiers

public final void setModifiers(int mods)
                        throws CannotAlterException

setExceptionTypes

public final void setExceptionTypes(OJClass[] types)
                             throws CannotAlterException

addExceptionType

public final void addExceptionType(OJClass type)
                            throws CannotAlterException

setTransference

public final ConstructorInvocation setTransference(ConstructorInvocation invocation)
                                            throws CannotAlterException

setBody

public final StatementList setBody(StatementList stmts)
                            throws CannotAlterException