public class ConstraintValidator extends java.lang.Object
Constructor and Description |
---|
ConstraintValidator() |
Modifier and Type | Method and Description |
---|---|
<T> void |
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.
|
<X extends java.lang.Exception> |
checkConstaints(java.lang.Object o,
IExceptionHandler<ConstraintViolationException,X> handler)
Checks all constraints to the given object which are applicable to it.
|
<T,X_WALKER extends java.lang.Exception> |
validateMesh(T start,
IMeshWalker<T,X_WALKER> walker)
Validates all reachable elements of a mesh.
|
<T,X extends java.lang.Exception,X_WALKER extends java.lang.Exception> |
validateMesh(T start,
IMeshWalker<T,X_WALKER> walker,
IExceptionHandler<ConstraintViolationException,X> handler)
Validates all reachable elements of a mesh.
|
<T,X_WALKER extends java.lang.Exception> |
validateTree(T root,
ITreeWalker<T,X_WALKER> walker)
Validates all nodes of a tree.
|
<T,X extends java.lang.Exception,X_WALKER extends java.lang.Exception> |
validateTree(T root,
ITreeWalker<T,X_WALKER> walker,
IExceptionHandler<ConstraintViolationException,X> handler)
Validates all nodes of a tree.
|
public ConstraintValidator()
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