Dresden OCL Toolkit

tudresden.ocl.lib
Interface OclFactory

All Known Implementing Classes:
DefaultOclFactory

public interface OclFactory

A interface defining operations expected of a OCL representation factory class. Such a factory can transform any piece of application data (Java basic values and objects) into the corresponding representation for the OCL class library. This interface has to be implemented directly or, more usually, through DefaultOclFactory, to adapt the class library to "different" application code. Application code can be "different" for example in the way it implements non-unary associations.

Such an adaption may be necessary if the class library is used with an other code generator, but usually the implementation given in DefaultOclFactory should be sufficient.

Author:
Frank Finger
See Also:
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)
           
 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
 

Method Detail

getOclRepresentationFor

public 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. 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.

See Also:
OclAny, OclCollection, OclString

getOclRepresentationForNull

public OclRoot getOclRepresentationForNull(Class c)

getOclRepresentationFor

public OclBoolean getOclRepresentationFor(boolean b)
In contrast to all other methods, this one is restricted to return OclBoolean objects.


getOclRepresentationFor

public OclRoot getOclRepresentationFor(byte b)

getOclRepresentationFor

public OclRoot getOclRepresentationFor(short s)

getOclRepresentationFor

public OclRoot getOclRepresentationFor(int i)

getOclRepresentationFor

public OclRoot getOclRepresentationFor(long l)

getOclRepresentationFor

public OclRoot getOclRepresentationFor(float f)

getOclRepresentationFor

public OclRoot getOclRepresentationFor(double d)

getOclRepresentationFor

public OclRoot getOclRepresentationFor(char c)

getOclStateFor

public OclState getOclStateFor(String s)
See Also:
DefaultOclFactory.getOclStateFor(String s)

reconvert

public 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

Returns:
an object of type targetType

getOclSequenceFor

public OclSequence getOclSequenceFor(Object o)
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.