org.topbraid.spin.constraints
Class SPINConstraints

java.lang.Object
  extended by org.topbraid.spin.constraints.SPINConstraints

public class SPINConstraints
extends java.lang.Object

Performs SPIN constraint checking on one or more instances, based on the spin:constraints defined on the types of those instances.

Author:
Holger Knublauch

Constructor Summary
SPINConstraints()
           
 
Method Summary
static java.util.List<ConstraintViolation> check(Model model, ProgressMonitor monitor)
          Checks all instances in a given Model against all spin:constraints and returns a List of constraint violations.
static java.util.List<ConstraintViolation> check(Resource resource, ProgressMonitor monitor)
          Checks all spin:constraints for a given Resource.
static boolean isConstraintProperty(Property property)
          Checks if a given property is a SPIN constraint property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPINConstraints

public SPINConstraints()
Method Detail

check

public static java.util.List<ConstraintViolation> check(Resource resource,
                                                        ProgressMonitor monitor)
Checks all spin:constraints for a given Resource.

Parameters:
resource - the instance to run constraint checks on
monitor - an (optional) progress monitor (currently ignored)
Returns:
a List of ConstraintViolations (empty if all is OK)

check

public static java.util.List<ConstraintViolation> check(Model model,
                                                        ProgressMonitor monitor)
Checks all instances in a given Model against all spin:constraints and returns a List of constraint violations. A ProgressMonitor can be provided to enable the user to get intermediate status reports and to cancel the operation.

Parameters:
model - the Model to operate on
monitor - an optional ProgressMonitor
Returns:
a List of ConstraintViolations

isConstraintProperty

public static boolean isConstraintProperty(Property property)
Checks if a given property is a SPIN constraint property. This is defined as a property that is spin:constraint or a sub-property of it.

Parameters:
property - the property to check
Returns:
true if property is a constraint property