Dresden OCL Toolkit

tudresden.ocl.lib
Class OclAnyImpl

java.lang.Object
  extended bytudresden.ocl.lib.OclAny
      extended bytudresden.ocl.lib.OclAnyImpl
All Implemented Interfaces:
Cloneable, OclRoot

public class OclAnyImpl
extends OclAny

This class represents the OCL type OclAny. It implements the properties defined for this type and gives access to fields of application objects using Java Reflection.

Author:
Frank Finger

Field Summary
private  Object applicationObject
          the application object that is encapsulated by this instance of OclAnyImpl
private static FeatureListener featurelistener
           
 
Fields inherited from class tudresden.ocl.lib.OclAny
 
Constructor Summary
OclAnyImpl(int dummy, String reason)
          constructor for the undefined OclAnyImpl
OclAnyImpl(Object o)
          A public constructor for OclAnyImpl.
 
Method Summary
static void clearFeatureListener()
           
 boolean equals(Object o)
           
static Method findMethod(Class myclass, String name, Class[] params)
           
 OclRoot getFeature(String attributeName)
          Calls getFeatureQualified without qualifiers.
 OclRoot getFeature(String methodName, Object[] params)
          To call side-effect free methods of an object, invoke this method with the method name as String and the appropriate parameters.
 OclSequence getFeatureAsSequence(String name)
           
 OclRoot getFeatureQualified(String attributeName, Object qualifier)
          The attributes of application objects can be queried through this method.
 Object getObject()
           
 int hashCode()
           
 OclBoolean isEqualTo(Object o)
          two OclAnyImpl objects are equal if their encapsulated application objects are identical (NOT equal)
 OclBoolean isNotEqualTo(Object o)
          Returns the negated result of isEqualTo.
 OclType oclType()
          This property is no longer present in OCL 1.3.
static void setFeatureListener(FeatureListener f)
           
 String toString()
           
 
Methods inherited from class tudresden.ocl.lib.OclAny
getFeatureAsCollection, getUndefinedReason, isUndefined, oclAsType, oclInState, oclIsKindOf, oclIsTypeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

applicationObject

private Object applicationObject
the application object that is encapsulated by this instance of OclAnyImpl


featurelistener

private static FeatureListener featurelistener
Constructor Detail

OclAnyImpl

public OclAnyImpl(Object o)
A public constructor for OclAnyImpl. Applications using the OCL class library should use the factory methods of the class Ocl to create instances of OclAnyImpl.


OclAnyImpl

public OclAnyImpl(int dummy,
                  String reason)
constructor for the undefined OclAnyImpl

Method Detail

isEqualTo

public OclBoolean isEqualTo(Object o)
two OclAnyImpl objects are equal if their encapsulated application objects are identical (NOT equal)

Specified by:
isEqualTo in interface OclRoot
Specified by:
isEqualTo in class OclAny

isNotEqualTo

public OclBoolean isNotEqualTo(Object o)
Description copied from interface: OclRoot
Returns the negated result of isEqualTo.

Specified by:
isNotEqualTo in interface OclRoot
Overrides:
isNotEqualTo in class OclAny
Returns:
the negated result of isEqualTo

getFeature

public OclRoot getFeature(String attributeName)
Calls getFeatureQualified without qualifiers.

Specified by:
getFeature in interface OclRoot
Specified by:
getFeature in class OclAny
See Also:
getFeatureQualified(java.lang.String, java.lang.Object)

getFeatureQualified

public OclRoot getFeatureQualified(String attributeName,
                                   Object qualifier)
The attributes of application objects can be queried through this method. Due to restrictions of the Java language, only public fields can be queried.

Parameters:
attributeName - the name of the feature, as a java.lang.String

findMethod

public static Method findMethod(Class myclass,
                                String name,
                                Class[] params)

getFeature

public OclRoot getFeature(String methodName,
                          Object[] params)
To call side-effect free methods of an object, invoke this method with the method name as String and the appropriate parameters. This method does not enforce that only side-effect free methods are called.

If an exception occurs in the called method or in accessing it, an undefined value is returned.


getFeatureAsSequence

public OclSequence getFeatureAsSequence(String name)

equals

public boolean equals(Object o)

hashCode

public int hashCode()

toString

public String toString()

oclType

public OclType oclType()
This property is no longer present in OCL 1.3. In spite of this, the library contains this method. The problems that lead to its cancellation do not occur in this Java implementation.

Overrides:
oclType in class OclAny

getObject

public Object getObject()
Returns:
the application object encapsulated by this OclAnyImpl

setFeatureListener

public static void setFeatureListener(FeatureListener f)

clearFeatureListener

public static void clearFeatureListener()

Dresden OCL Toolkit

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