openjava.mop
Class OJConstructor

java.lang.Object
  |
  +--openjava.mop.OJConstructor
All Implemented Interfaces:
OJMember

public final class OJConstructor
extends Object
implements OJMember


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

Field Detail

substance

private OJConstructorImp substance

table

private static Hashtable table
Constructor Detail

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)
Method Detail

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

SourceForge.net_Logo