gov.nasa.arc.brahms.common.data
Class MethodInvocation

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
      extended by gov.nasa.arc.brahms.common.data.ModelElement
          extended by gov.nasa.arc.brahms.common.data.Invocation
              extended by gov.nasa.arc.brahms.common.data.MethodInvocation
All Implemented Interfaces:
IExpression, gov.nasa.arc.brahms.common.IConstants, java.io.Serializable
Direct Known Subclasses:
VMMethodInvocation

public class MethodInvocation
extends Invocation

A MethodInvocation is a reference to an Java method made in a workframe. When a workframe is executing its actions and finds an Java method reference it will execute the referenced Java method. It will pass the referenced Java method the argument values specified for the reference (if any).

Version:
$Revision: 1.1 $ $Date: 2009/11/23 18:28:40 $ $Author: rnado $
Author:
Bob Nado
See Also:
Serialized Form

Field Summary
static org.apache.log4j.Logger LOGGER
          The logger used to log messages
 
Fields inherited from interface gov.nasa.arc.brahms.common.IConstants
ABORT, ACTIVECLASS, ACTIVECONCEPT, ACTIVEINSTANCE, AGENT, ANONYMOUS, ANYAGENT, AREA, AREADEF, ASSIGNED, ATTRIBUTE, BASEAREADEF, BASECLASS, BASECONCEPTUALCLASS, BASEGROUP, BASELIBRARY, BOOLEAN, BROADCAST, BUILDING, BYTE, CCLOCK, CDATE, CHAR, CITY, CLASS, CLOCK, COLLECTALL, COMMUNICATE, COMPLETE, COMPOSITE, COMPUTER, CONCEPT, CONCEPTUALCLASS, CONCEPTUALCONCEPT, CONCEPTUALOBJECT, CONTINUE, COPY, CREATEAGENT, CREATEAREA, CREATEOBJECT, current, CURRENT, DATAFRAME, DATE, DB, DETECTABLE, DIV, DOUBLE, EMAIL, EMPTY_STRING, END, ENDACTIVITY, ENTAGENT, EQ, EXCEPTION, EXPR, FACE2FACE, FACTFRAME, FALSE, FAX, FLOAT, FOREACH, FORONE, G2, GE, GEOGRAPHYCONCEPT, GESTURE, GET, GROUP, GT, IMPASSE, INT, INVALID, JAVA, JAVA_TYPE, KNOWN_MODIFIER, KNOWNVAL_MODIFIER, LE, LOCAL, LONG, LT, MAP, MINUS, MOD, MOVE, MULT, NE, NEW, NONE, NOT_MODIFIER, NOWORK, O, OA, OBJECT, ONTOLOGY, PAGER, PARAMETER, PATH, PHONE, PLUS, PRIMITIVE, PRIVATE, PROAGENT, PROTECTED, PRSAGENT, PUBLIC, PUT, RECEIVE, RELATION, sACTIVECLASS, sACTIVECONCEPT, sACTIVEINSTANCE, sAGENT, sARCHIVE, sAREA, sAREADEF, sBOOLEAN, sBYTE, sBYTECODEEXT, sCHAR, sCLASS, sCOMPUTER, sCONCEPT, sCONCEPTUALCLASS, sCONCEPTUALCONCEPT, sCONCEPTUALOBJECT, sCOPY, sCURRENT, sDETECTABLE, sDOUBLE, sEMAIL, sEND, SEND, sFACE2FACE, sFAX, sFILEEXT, sFLOAT, sGEOGRAPHYCONCEPT, sGROUP, SHORT, SIMAGENT, sINT, sJAVA_TYPE, sLONG, sMAP, sNEW, sNONE, sNOWORK, sOBJECT, SOURCECODE, sPAGER, sPARAMETER, sPATH, sPHONE, sPRIVATE, sPROJECTEXT, sPROTECTED, sPUBLIC, sSHORT, sSTART, sSTRING, sSYMBOL, START, STRING, sUNKNOWN, sVOID, SYMBOL, TRUE, UDT, UML, UNASSIGNED, UNDEFINED, unknown, UNKNOWN, UNKNOWN_MODIFIER, V, VARIABLE, VOID, WHENEVER, WORKFRAME, WORLD, XML
 
Constructor Summary
MethodInvocation()
          Constructor, creates a new Java method invocation with no reference to a method.
MethodInvocation(java.lang.String name)
          Constructor, creates a new Java method invocation with the specified name.
MethodInvocation(java.lang.String file, int line)
          Constructor, creates a new Java method invocation specified in the given file at the given line number.
MethodInvocation(java.lang.String name, java.lang.String file, int line)
          Constructor, creates a new method invocation with the specified name and specified in the given file at the given line number.
 
Method Summary
 void delete()
          Deletes this element from the model and removes all references to this element in other model elements.
 Type getCollectType()
          Returns the Brahms type of the expression when it contains one or more collectall variables and the values of the expression should be accumulated in a list before assigning to a variable or passing the result to a Java method, constructor, or array initializer.
 java.lang.String getMethodDescriptor()
          Returns the method descriptor for the method being referenced.
 java.lang.String getMethodName()
          Returns the name of the method to be invoked
 JavaType getOwnerType()
          Returns the JavaType representing the Java class or interface that has the static method to be invoked.
 Operand getTarget()
          Returns the Operand that will evaluate to the Java object that is the target for the method invocation.
 void setCollectType(Type type)
          Sets the Brahms type when this expression contains one or more collectall variables and the values of the expression should be accumulated in a list before assigning to a variable or passing the result to a Java method, constructor, or array initializer.
protected  void setID()
          Sets the unique identifier.
 void setMethodDescriptor(java.lang.String descriptor)
          Sets the method descriptor for the method being referenced.
 void setMethodName(java.lang.String name)
          Sets the name of the method to be invoked
 void setOwnerType(JavaType type)
          Sets the JavaType representing the Java class or interface that has the static method to be invoked.
 void setTarget(Operand target)
          For an instance method, sets the Operand that will evaluate to the Java object that is the target for the method invocation
 java.lang.String toString()
          Returns the source code representation for this Constructor invocation.
 
Methods inherited from class gov.nasa.arc.brahms.common.data.Invocation
addArgument, getArgumentNumber, getArguments, getBrahmsParameterTypes, getOwner, getParameterNumber, getParameters, getParameterTypes, getVariables, hasArguments, isVarArgs, parseParameterTypes, setBrahmsParameterTypes, setOwner, setParameterTypes, setVarArgs
 
Methods inherited from class gov.nasa.arc.brahms.common.data.BrahmsObject
export, getFile, getID, getLine, getSerialNumber, isBCC, isDynamic, isLoaded, isResolved, setBCC, setDynamic, setFile, setID, setLine, setLoaded, setResolved, setSerialNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.common.data.IExpression
export
 

Field Detail

LOGGER

public static final org.apache.log4j.Logger LOGGER
The logger used to log messages

Constructor Detail

MethodInvocation

public MethodInvocation()
Constructor, creates a new Java method invocation with no reference to a method.


MethodInvocation

public MethodInvocation(java.lang.String name)
Constructor, creates a new Java method invocation with the specified name. The name should be the same as the Java method to be invoked.

Parameters:
name - the name of the Java method invocation

MethodInvocation

public MethodInvocation(java.lang.String file,
                        int line)
Constructor, creates a new Java method invocation specified in the given file at the given line number.

Parameters:
file - the file in which the Java method invocation is specified
line - the line number in the file at which the Java method invocation is specified

MethodInvocation

public MethodInvocation(java.lang.String name,
                        java.lang.String file,
                        int line)
Constructor, creates a new method invocation with the specified name and specified in the given file at the given line number. The name should be the same as the Java method to be invoked.

Parameters:
name - the name of the Java method invocation
file - the file in which the Java method invocation is specified
line - the line number in the file at which the Java method invocation is specified
Method Detail

setMethodName

public void setMethodName(java.lang.String name)
Sets the name of the method to be invoked

Parameters:
name - the method name

getMethodName

public java.lang.String getMethodName()
Returns the name of the method to be invoked

Returns:
String the method name

setID

protected void setID()
Sets the unique identifier.

Overrides:
setID in class BrahmsObject

setMethodDescriptor

public void setMethodDescriptor(java.lang.String descriptor)
Sets the method descriptor for the method being referenced.

Parameters:
descriptor - the method descriptor

getMethodDescriptor

public java.lang.String getMethodDescriptor()
Returns the method descriptor for the method being referenced.

Returns:
String the method descriptor for the method being referenced

setTarget

public void setTarget(Operand target)
For an instance method, sets the Operand that will evaluate to the Java object that is the target for the method invocation

Parameters:
target - an Operand for the target of the invocation

getTarget

public Operand getTarget()
Returns the Operand that will evaluate to the Java object that is the target for the method invocation. Reurns null for a static method invocation.

Returns:
Operand the operand evaluating to target of the method invocation

getOwnerType

public JavaType getOwnerType()
Returns the JavaType representing the Java class or interface that has the static method to be invoked. Returns null fro an instance method invocation.

Returns:
JavaType the owning java type

setOwnerType

public void setOwnerType(JavaType type)
Sets the JavaType representing the Java class or interface that has the static method to be invoked.

Parameters:
type - the JavaType representing the owning Java type

setCollectType

public void setCollectType(Type type)
Sets the Brahms type when this expression contains one or more collectall variables and the values of the expression should be accumulated in a list before assigning to a variable or passing the result to a Java method, constructor, or array initializer.

Parameters:
type - the Brahms type for the expression

getCollectType

public Type getCollectType()
Returns the Brahms type of the expression when it contains one or more collectall variables and the values of the expression should be accumulated in a list before assigning to a variable or passing the result to a Java method, constructor, or array initializer.

Returns:
Type the Brahms type for the expression

delete

public void delete()
Deletes this element from the model and removes all references to this element in other model elements.

Overrides:
delete in class BrahmsObject

toString

public java.lang.String toString()
Returns the source code representation for this Constructor invocation.

Overrides:
toString in class java.lang.Object
Returns:
String the source code representation


Copyright © 1997-2012 All Rights Reserved.