org.mindswap.ocl
Interface OCLMethod

All Known Subinterfaces:
OCLConstructor, OCLStaticMethod
All Known Implementing Classes:
OCLConstructorImpl, OCLMethodImpl, OCLStaticMethodImpl

public interface OCLMethod

Title: OCLMethod

Description: A abstract representation of a java method

Copyright: Copyright (c) 2005

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


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
 

Method Detail

addParameter

public void addParameter(OCLParameter theParam)
Adds the specified parameter to the list of parameters for this method

Parameters:
theParam - OCLParameter

removeParameter

public void removeParameter(OCLParameter theParam)
Removes the specified parameter from the list of parameters for this method

Parameters:
theParam - OCLParameter

getParameters

public OCLParameterIterator getParameters()
Returns the list of parameters for this method

Returns:
OCLParameterIterator an iterator over the parameters of the method

getMethodName

public Literal getMethodName()
Returns the name of the method

Returns:
Literal the method name

setMethodName

public void setMethodName(Literal theLiteral)
Sets the method name

Parameters:
theLiteral - Literal the new method name

getOnObject

public OCLObject getOnObject()
The object on which this method is to be invoked

Returns:
OCLObject the object to invoke this method on

invoke

public java.lang.Object invoke()
                        throws java.lang.IllegalArgumentException,
                               java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Invokes this method and returns its result

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
Invokes this method on the specifed object and returns the result

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.IllegalArgumentException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException