krieger.oclruntime
Class MethodBody

java.lang.Object
  extended by krieger.oclruntime.MethodBody
All Implemented Interfaces:
java.io.Serializable

public class MethodBody
extends java.lang.Object

Represents a Java method body generated from an OCL operation contract.

See Also:
Serialized Form

Constructor Summary
MethodBody(ClassifierFactory<java.lang.String> classifierFactory, PropertyContainer<PropertyID,java.lang.String> translatedProperties, java.util.Collection<PropertyID> extraProperties, Constant<?> selfVar, java.util.List<Constant<? extends Expression>> inParams, Variable<? extends Expression> returnValue, Problem problem, QueryEvaluator<PropertyID> evaluator)
          Constructs a new method body.
 
Method Summary
 java.lang.Object call(java.lang.Object self, java.lang.Object... arguments)
          Calls this method body.
static java.lang.Object call(java.lang.String resourceName, java.lang.Object self, java.lang.Class<?> returnType, java.lang.Object... arguments)
          Calls a method body stored in a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodBody

public MethodBody(ClassifierFactory<java.lang.String> classifierFactory,
                  PropertyContainer<PropertyID,java.lang.String> translatedProperties,
                  java.util.Collection<PropertyID> extraProperties,
                  Constant<?> selfVar,
                  java.util.List<Constant<? extends Expression>> inParams,
                  Variable<? extends Expression> returnValue,
                  Problem problem,
                  QueryEvaluator<PropertyID> evaluator)
Constructs a new method body.

Method Detail

call

public static java.lang.Object call(java.lang.String resourceName,
                                    java.lang.Object self,
                                    java.lang.Class<?> returnType,
                                    java.lang.Object... arguments)
Calls a method body stored in a resource.

Parameters:
resourceName - The name of the resource holding the serialized method body.
self - The object to call the method on.
returnType - A Class representing the return type of the method.
Returns:
The value returned by the method.

call

public java.lang.Object call(java.lang.Object self,
                             java.lang.Object... arguments)
Calls this method body.

Parameters:
self - The object to call the method on.
Returns:
The value returned by the method.