java.lang.Object
openjava.ptree.ParseTreeObject
openjava.ptree.NonLeaf
openjava.ptree.MethodCall
- All Implemented Interfaces:
- java.lang.Cloneable, Expression, ParseTree, VariableInitializer
- public class MethodCall
- extends NonLeaf
- implements Expression
The MethodCall class represents
a method call expression.
| Fields inherited from class openjava.ptree.NonLeaf |
|
| Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, elementAt, equals, getComment, getContents, getLength, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt |
| Methods inherited from class openjava.ptree.ParseTreeObject |
clone, equal, getObjectID, getParent, hashCode, lastObjectID, makeCopy, replace, setParent, toFlattenString, toString |
MethodCall
public MethodCall(Expression expr,
java.lang.String name,
ExpressionList args)
- Allocates a new method call expression object.
MethodCall
public MethodCall(java.lang.String name,
ExpressionList args)
- Allocates a new method call expression for 'this'.
This is equivalent to:
new MethodCall( (Expression) null, name, args )
MethodCall
public MethodCall(TypeName type,
java.lang.String name,
ExpressionList args)
- Allocates a new method call expression object.
MethodCall
public MethodCall(openjava.mop.OJClass clazz,
java.lang.String name,
ExpressionList args)
MethodCall
MethodCall()
getReferenceExpr
public Expression getReferenceExpr()
- Gets the expression accessed.
setReferenceExpr
public void setReferenceExpr(Expression expr)
- Sets the expression accessed.
getReferenceType
public TypeName getReferenceType()
setReferenceType
public void setReferenceType(TypeName type)
getName
public java.lang.String getName()
- Gets the method name.
setName
public void setName(java.lang.String name)
- Sets the method name.
getArguments
public ExpressionList getArguments()
- Gets the arguments for this method.
setArguments
public void setArguments(ExpressionList exprs)
- Sets the arguments for this method.
accept
public void accept(openjava.ptree.util.ParseTreeVisitor v)
throws ParseTreeException
- Description copied from interface:
ParseTree
- Accepts a
ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit() method on the
accepted visitor.
- Specified by:
accept in interface ParseTree- Specified by:
accept in class ParseTreeObject
getType
public openjava.mop.OJClass getType(openjava.mop.Environment env)
throws java.lang.Exception
- Specified by:
getType in interface Expression
pickupMethod
private static openjava.mop.OJMethod pickupMethod(openjava.mop.OJClass reftype,
java.lang.String name,
openjava.mop.OJClass[] argtypes)