Dresden OCL Toolkit

tudresden.ocl.injection.ocl.lib
Class Invariant

java.lang.Object
  extended bytudresden.ocl.injection.ocl.lib.Invariant
All Implemented Interfaces:
FeatureListener, Serializable

public final class Invariant
extends Object
implements FeatureListener, Serializable

See Also:
Serialized Form

Field Summary
static HashSet allInvariants
           
static boolean checking_flag
           
static String CHECKING_FLAG
           
static String CHECKING_OPERATION
           
static String INVARIANT_METHOD
           
static String INVARIANT_OBJECT
           
private  Method method
           
private  String name
           
static String NOTIFY_OBSERVING_INVARIANTS
           
private  Object object
           
static String OBSERVER_SUFFIX
           
private static HashSet vacantInvariants
           
 
Constructor Summary
Invariant(String name, Object object)
           
 
Method Summary
private  void addObserver(String featurename, Object o)
           
static void checkVacantInvariants()
           
 void invoke()
           
static void notifyObservingInvariants(HashSet observers)
          Notifies the invariants observing an attribute, that the attribute has changed.
 void onField(Field f, Object o)
          Is called, when the ocl library accesses an attribute of an application object.
 void onMethod(Method m, Object o)
          Is called, when the ocl library accesses a method of an application object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private String name

object

private Object object

allInvariants

public static HashSet allInvariants

OBSERVER_SUFFIX

public static final String OBSERVER_SUFFIX
See Also:
Constant Field Values

INVARIANT_METHOD

public static final String INVARIANT_METHOD
See Also:
Constant Field Values

INVARIANT_OBJECT

public static final String INVARIANT_OBJECT
See Also:
Constant Field Values

method

private transient Method method

vacantInvariants

private static HashSet vacantInvariants

CHECKING_FLAG

public static final String CHECKING_FLAG
See Also:
Constant Field Values

checking_flag

public static boolean checking_flag

CHECKING_OPERATION

public static final String CHECKING_OPERATION
See Also:
Constant Field Values

NOTIFY_OBSERVING_INVARIANTS

public static final String NOTIFY_OBSERVING_INVARIANTS
See Also:
Constant Field Values
Constructor Detail

Invariant

public Invariant(String name,
                 Object object)
Method Detail

addObserver

private final void addObserver(String featurename,
                               Object o)

onField

public final void onField(Field f,
                          Object o)
Description copied from interface: FeatureListener
Is called, when the ocl library accesses an attribute of an application object.

Specified by:
onField in interface FeatureListener
See Also:
OclAnyImpl.getFeature(String), OclAnyImpl.getFeatureQualified(String,Object), OclAnyImpl.getFeatureAsSequence(String)

onMethod

public final void onMethod(Method m,
                           Object o)
Description copied from interface: FeatureListener
Is called, when the ocl library accesses a method of an application object. Note, that the ocl library should access query methods (side effect free methods) only, but this is not enforced in any way.

Specified by:
onMethod in interface FeatureListener
See Also:
OclAnyImpl.getFeature(String,Object[])

invoke

public final void invoke()

checkVacantInvariants

public static final void checkVacantInvariants()

notifyObservingInvariants

public static final void notifyObservingInvariants(HashSet observers)
Notifies the invariants observing an attribute, that the attribute has changed. There is no notify method in class Invariant, instead the observing invariants are included into a set of vacant invariants. After notifying, the observer set is cleared. Next time, the invariant runs, the observers are registered again.


Dresden OCL Toolkit

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