|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.commons.constraint.ConstraintValidator
public class ConstraintValidator
A class for storing constraints in the context of classes for which the constraint applies. Additionally it provides methods for checking all matching constraints for a given class.
Constructor Summary | |
---|---|
ConstraintValidator()
|
Method Summary | ||
---|---|---|
|
addConstraint(java.lang.Class<? extends T> clazz,
ILocalConstraint<T> constraint)
Adds a constraint for a class. |
|
void |
checkConstaints(java.lang.Object o)
Checks all constraints to the given object which are applicable to it. |
|
|
checkConstaints(java.lang.Object o,
IExceptionHandler<ConstraintViolationException,X> handler)
Checks all constraints to the given object which are applicable to it. |
|
|
validateMesh(T start,
IMeshWalker<T,X_WALKER> walker)
Validates all reachable elements of a mesh. |
|
|
validateMesh(T start,
IMeshWalker<T,X_WALKER> walker,
IExceptionHandler<ConstraintViolationException,X> handler)
Validates all reachable elements of a mesh. |
|
|
validateTree(T root,
ITreeWalker<T,X_WALKER> walker)
Validates all nodes of a tree. |
|
|
validateTree(T root,
ITreeWalker<T,X_WALKER> walker,
IExceptionHandler<ConstraintViolationException,X> handler)
Validates all nodes of a tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstraintValidator()
Method Detail |
---|
public <T> void addConstraint(java.lang.Class<? extends T> clazz, ILocalConstraint<T> constraint)
public void checkConstaints(java.lang.Object o) throws ConstraintViolationException
ConstraintViolationException
- if any constraint is violatedpublic <X extends java.lang.Exception> void checkConstaints(java.lang.Object o, IExceptionHandler<ConstraintViolationException,X> handler) throws X extends java.lang.Exception
X extends java.lang.Exception
public <T,X_WALKER extends java.lang.Exception> void validateTree(T root, ITreeWalker<T,X_WALKER> walker) throws ConstraintViolationException, X_WALKER extends java.lang.Exception
ConstraintViolationException
.
root
- the root of the tree.walker
- the walker used to navigate the tree.
ConstraintViolationException
- if a constraint violation was found.
X_WALKER
- if the walker throws an exception.
X_WALKER extends java.lang.Exception
public <T,X extends java.lang.Exception,X_WALKER extends java.lang.Exception> void validateTree(T root, ITreeWalker<T,X_WALKER> walker, IExceptionHandler<ConstraintViolationException,X> handler) throws X extends java.lang.Exception, X_WALKER extends java.lang.Exception
root
- the root of the tree.walker
- the walker used to navigate the tree.handler
- the exception handler used for dealing with constraint
violations.
X
- if the constraint violation handler throws it.
X_WALKER
- if the walker throws an exception.
X extends java.lang.Exception
public <T,X_WALKER extends java.lang.Exception> void validateMesh(T start, IMeshWalker<T,X_WALKER> walker) throws ConstraintViolationException, X_WALKER extends java.lang.Exception
ConstraintViolationException
.
start
- the start element of the mesh.walker
- the walker used to navigate the mesh.
ConstraintViolationException
- if a constraint violation was found.
X_WALKER
- if the walker throws an exception.
X_WALKER extends java.lang.Exception
public <T,X extends java.lang.Exception,X_WALKER extends java.lang.Exception> void validateMesh(T start, IMeshWalker<T,X_WALKER> walker, IExceptionHandler<ConstraintViolationException,X> handler) throws X extends java.lang.Exception, X_WALKER extends java.lang.Exception
start
- the start element of the mesh.walker
- the walker used to navigate the mesh.handler
- the exception handler used for dealing with constraint
violations.
X
- if the constraint violation handler throws it.
X_WALKER
- if the walker throws an exception.
X extends java.lang.Exception
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |