|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--openjava.mop.OJMethod
| Field Summary | |
private OJMethodImp |
substance
|
private static Hashtable |
table
|
| Fields inherited from interface openjava.mop.OJMember |
DECLARED, PUBLIC |
| Constructor Summary | |
|
OJMethod(Environment env,
OJClass declarer,
MethodDeclaration d)
|
(package private) |
OJMethod(Method m)
|
|
OJMethod(OJClass declarer,
OJModifier modif,
OJClass returnType,
String name,
OJClass[] parameterTypes,
OJClass[] exceptionTypes,
StatementList body)
Constructs a new OJMethod object. |
|
OJMethod(OJClass declarer,
OJModifier modif,
OJClass returnType,
String name,
OJClass[] parameterTypes,
String[] parameterNames,
OJClass[] exceptionTypes,
StatementList body)
Constructs a new OJMethod object. |
|
OJMethod(OJClass declarer,
OJModifier modif,
OJClass returnType,
String name,
ParameterList params,
OJClass[] exceptionTypes,
StatementList body)
Constructs a new OJMethod object. |
| Method Summary | |
void |
addExceptionType(OJClass type)
|
static OJMethod[] |
arrayForMethods(Method[] jmethods)
|
private boolean |
compareParameters(OJClass[] params2)
|
private boolean |
compareParameters(OJMethod other)
|
boolean |
equals(Object obj)
Compares this method against the given object. |
static OJMethod |
forMethod(Method java_method)
|
StatementList |
getBody()
|
Method |
getByteCode()
|
OJClass |
getDeclaringClass()
|
Environment |
getEnvironment()
|
OJClass[] |
getExceptionTypes()
|
String |
getIdentifiableName()
|
OJModifier |
getModifiers()
|
String |
getName()
|
String[] |
getParameters()
|
OJClass[] |
getParameterTypes()
|
ExpressionList |
getParameterVariables()
|
OJClass |
getReturnType()
|
MethodDeclaration |
getSourceCode()
|
ParseTree |
getSuffix(String keyword)
Obtains an parse tree of suffix in extended syntax starting with the specified keyword. |
int |
hashCode()
Computes a hashcode for this method. |
Object |
invoke(Object obj,
Object[] args)
Invokes this method on the given object with the given parameters. |
boolean |
isAlterable()
|
boolean |
isExecutable()
|
static OJMethod |
makePrototype(OJMethod original)
Generates a method object which has the same attributes as the model method except its body. |
StatementList |
setBody(StatementList stmts)
|
(package private) void |
setDeclaringClass(OJClass parent)
|
void |
setExceptionTypes(OJClass[] types)
|
void |
setModifiers(int mods)
|
void |
setModifiers(OJModifier mods)
|
void |
setName(String name)
|
void |
setReturnType(OJClass type)
|
Signature |
signature()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private OJMethodImp substance
private static Hashtable table
| Constructor Detail |
OJMethod(Method m)
public OJMethod(OJClass declarer,
OJModifier modif,
OJClass returnType,
String name,
OJClass[] parameterTypes,
OJClass[] exceptionTypes,
StatementList body)
OJMethod object.
This constructor automatically generates parameter variables.
public OJMethod(OJClass declarer,
OJModifier modif,
OJClass returnType,
String name,
OJClass[] parameterTypes,
String[] parameterNames,
OJClass[] exceptionTypes,
StatementList body)
OJMethod object.
public OJMethod(OJClass declarer,
OJModifier modif,
OJClass returnType,
String name,
ParameterList params,
OJClass[] exceptionTypes,
StatementList body)
OJMethod object.
public OJMethod(Environment env,
OJClass declarer,
MethodDeclaration d)
| Method Detail |
public static OJMethod makePrototype(OJMethod original)
The body of generated method is to be set to null.
original - the base model for generating method object.public static OJMethod forMethod(Method java_method)
public static OJMethod[] arrayForMethods(Method[] jmethods)
public Signature signature()
signature in interface OJMemberpublic OJClass getDeclaringClass()
getDeclaringClass in interface OJMemberpublic String getName()
getName in interface OJMemberpublic String getIdentifiableName()
public OJModifier getModifiers()
getModifiers in interface OJMemberpublic OJClass getReturnType()
public OJClass[] getParameterTypes()
public OJClass[] getExceptionTypes()
public ExpressionList getParameterVariables()
throws CannotAlterException
CannotAlterException
public String[] getParameters()
throws CannotAlterException
CannotAlterExceptionpublic ParseTree getSuffix(String keyword)
openjava.ptree.ParseTree object has a structure
built by an openjava.syntax.SyntaxRule object
returned via the method getDeclSuffixRule(String).
OJClass.getDeclSuffixRule(String),
SyntaxRulepublic boolean equals(Object obj)
equals in class ObjectMethod.equals(java.lang.Object)private boolean compareParameters(OJMethod other)
private boolean compareParameters(OJClass[] params2)
public int hashCode()
hashCode in class ObjectMethod.hashCode()public String toString()
toString in class Objectpublic Environment getEnvironment()
getEnvironment in interface OJMember
public Object invoke(Object obj,
Object[] args)
throws IllegalAccessException,
IllegalArgumentException,
InvocationTargetException,
CannotExecuteException
CannotExecuteException - if this method is not compiled yet.
IllegalAccessException
IllegalArgumentException
InvocationTargetExceptionpublic final boolean isExecutable()
public final boolean isAlterable()
public final Method getByteCode()
throws CannotExecuteException
CannotExecuteException
public final MethodDeclaration getSourceCode()
throws CannotAlterException
CannotAlterException
public final StatementList getBody()
throws CannotAlterException
CannotAlterException
void setDeclaringClass(OJClass parent)
throws CannotAlterException
CannotAlterException
public final void setName(String name)
throws CannotAlterException
CannotAlterException
public final void setModifiers(int mods)
throws CannotAlterException
CannotAlterException
public final void setModifiers(OJModifier mods)
throws CannotAlterException
CannotAlterException
public final void setReturnType(OJClass type)
throws CannotAlterException
CannotAlterException
public final void setExceptionTypes(OJClass[] types)
throws CannotAlterException
CannotAlterException
public final void addExceptionType(OJClass type)
throws CannotAlterException
CannotAlterException
public final StatementList setBody(StatementList stmts)
throws CannotAlterException
CannotAlterException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||