Dresden OCL Toolkit

tudresden.ocl.lib
Class DefaultOclFactory

java.lang.Object
  extended bytudresden.ocl.lib.DefaultOclFactory
All Implemented Interfaces:
OclFactory

public class DefaultOclFactory
extends Object
implements OclFactory

This class is the default implementation of the OclFactory interface. It is suitable for Java code generated by Argo and Rational Rose.

Author:
Frank Finger

Constructor Summary
DefaultOclFactory()
           
 
Method Summary
 OclBoolean getOclRepresentationFor(boolean b)
          In contrast to all other methods, this one is restricted to return OclBoolean objects.
 OclRoot getOclRepresentationFor(byte b)
           
 OclRoot getOclRepresentationFor(char c)
           
 OclRoot getOclRepresentationFor(double d)
           
 OclRoot getOclRepresentationFor(float f)
           
 OclRoot getOclRepresentationFor(int i)
           
 OclRoot getOclRepresentationFor(long l)
           
 OclRoot getOclRepresentationFor(Object o)
          A sensible implementing class will implement this operation using the instanceof operator to return the correct OCL representation for the object depending on its type.
 OclRoot getOclRepresentationFor(short s)
           
 OclRoot getOclRepresentationForNull(Class c)
          Return an OCL representation of the null value of the given type.
 OclSequence getOclSequenceFor(Object o)
           
 OclState getOclStateFor(String s)
           
 Object reconvert(Class targetType, OclRoot oclObject)
          re-transform oclObject into an object of an application type; an implementing class should adapt this method to the transformation implemented in other methods of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOclFactory

public DefaultOclFactory()
Method Detail

getOclRepresentationFor

public OclRoot getOclRepresentationFor(Object o)
Description copied from interface: OclFactory
A sensible implementing class will implement this operation using the instanceof operator to return the correct OCL representation for the object depending on its type. Collections, Strings, and application objects will propably result in OclCollection, OclString and OclAny respectively. It might be necessary to take special care of arrays of different type.

Specified by:
getOclRepresentationFor in interface OclFactory
See Also:
OclAny, OclCollection, OclString

getOclRepresentationForNull

public OclRoot getOclRepresentationForNull(Class c)
Return an OCL representation of the null value of the given type. These are usually empty values, such as empty strings or collections. Returns null, if a suitable null value is not known.

Specified by:
getOclRepresentationForNull in interface OclFactory

getOclRepresentationFor

public OclBoolean getOclRepresentationFor(boolean b)
Description copied from interface: OclFactory
In contrast to all other methods, this one is restricted to return OclBoolean objects.

Specified by:
getOclRepresentationFor in interface OclFactory

getOclRepresentationFor

public OclRoot getOclRepresentationFor(byte b)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclInteger object

getOclRepresentationFor

public OclRoot getOclRepresentationFor(short s)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclInteger object

getOclRepresentationFor

public OclRoot getOclRepresentationFor(int i)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclInteger object

getOclRepresentationFor

public OclRoot getOclRepresentationFor(long l)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclInteger object

getOclRepresentationFor

public OclRoot getOclRepresentationFor(float f)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclReal object

getOclRepresentationFor

public OclRoot getOclRepresentationFor(double d)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclReal object

getOclRepresentationFor

public OclRoot getOclRepresentationFor(char c)
Specified by:
getOclRepresentationFor in interface OclFactory
Returns:
an OclString object

getOclStateFor

public OclState getOclStateFor(String s)
Specified by:
getOclStateFor in interface OclFactory
Returns:
an OclState object with s as state description; this method might be implemented differently to increase performance with frequent state queries
See Also:
OclStateAdapter

reconvert

public Object reconvert(Class targetType,
                        OclRoot oclObject)
Description copied from interface: OclFactory
re-transform oclObject into an object of an application type; an implementing class should adapt this method to the transformation implemented in other methods of this class

Specified by:
reconvert in interface OclFactory
Returns:
an object of type targetType

getOclSequenceFor

public OclSequence getOclSequenceFor(Object o)
Specified by:
getOclSequenceFor in interface OclFactory
Returns:
an OclSequence representation for the given Object

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.