org.mindswap.ocl.impl
Class OCLMethodImpl

java.lang.Object
  extended byResourceImpl
      extended byorg.mindswap.ocl.impl.OCLResourceImpl
          extended byorg.mindswap.ocl.impl.OCLMethodImpl
All Implemented Interfaces:
OCLMethod
Direct Known Subclasses:
OCLConstructorImpl, OCLStaticMethodImpl

public class OCLMethodImpl
extends OCLResourceImpl
implements OCLMethod

Title: OCLMethodImpl

Description: Implementation of the OCLMethod interface

Copyright: Copyright (c) 2005

Company: Mindswap (http://www.mindswap.org)

See Also:
Serialized Form

Field Summary
static Implementation factory
           
 
Constructor Summary
protected OCLMethodImpl(Node n, EnhGraph eg)
           
 
Method Summary
 void addParameter(OCLParameter theParam)
          Adds the specified parameter to the list of parameters for this method
 Literal getMethodName()
          Returns the name of the method
 OCLObject getOnObject()
          The object on which this method is to be invoked
 OCLParameterIterator getParameters()
          Returns the list of parameters for this method
 java.lang.Object invoke()
          Invokes this method and returns its result
 java.lang.Object invoke(java.lang.Object theObject)
          Invokes this method on the specifed object and returns the result
 void removeParameter(OCLParameter theParam)
          Removes the specified parameter from the list of parameters for this method
 void setMethodName(Literal theLiteral)
          Sets the method name
 
Methods inherited from class org.mindswap.ocl.impl.OCLResourceImpl
mustBeValidModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

public static Implementation factory
Constructor Detail

OCLMethodImpl

protected OCLMethodImpl(Node n,
                        EnhGraph eg)
Method Detail

addParameter

public void addParameter(OCLParameter theParam)
Description copied from interface: OCLMethod
Adds the specified parameter to the list of parameters for this method

Specified by:
addParameter in interface OCLMethod
Parameters:
theParam - OCLParameter

removeParameter

public void removeParameter(OCLParameter theParam)
Description copied from interface: OCLMethod
Removes the specified parameter from the list of parameters for this method

Specified by:
removeParameter in interface OCLMethod
Parameters:
theParam - OCLParameter

getParameters

public OCLParameterIterator getParameters()
Description copied from interface: OCLMethod
Returns the list of parameters for this method

Specified by:
getParameters in interface OCLMethod
Returns:
OCLParameterIterator an iterator over the parameters of the method

getMethodName

public Literal getMethodName()
Description copied from interface: OCLMethod
Returns the name of the method

Specified by:
getMethodName in interface OCLMethod
Returns:
Literal the method name

getOnObject

public OCLObject getOnObject()
Description copied from interface: OCLMethod
The object on which this method is to be invoked

Specified by:
getOnObject in interface OCLMethod
Returns:
OCLObject the object to invoke this method on

setMethodName

public void setMethodName(Literal theLiteral)
Description copied from interface: OCLMethod
Sets the method name

Specified by:
setMethodName in interface OCLMethod
Parameters:
theLiteral - Literal the new method name

invoke

public java.lang.Object invoke()
                        throws java.lang.IllegalArgumentException,
                               java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Description copied from interface: OCLMethod
Invokes this method and returns its result

Specified by:
invoke in interface OCLMethod
Returns:
Object the value returned by the method, or null if no value returned
Throws:
java.lang.IllegalArgumentException - if there is no object to invoke this method on
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

invoke

public java.lang.Object invoke(java.lang.Object theObject)
                        throws java.lang.IllegalArgumentException,
                               java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Description copied from interface: OCLMethod
Invokes this method on the specifed object and returns the result

Specified by:
invoke in interface OCLMethod
Parameters:
theObject - Object the object to invoke this method on
Returns:
Object the value returned by the function, or null if none
Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException