public abstract class ConstraintUtil extends Object
Constraint
annotation. Caches immutable default constraints that have
a default constructor.Constraint
,
Definition.getConstraint(Class)
Constructor and Description |
---|
ConstraintUtil() |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
getConstraintType(Class<?> type)
Determine the constraint type in the hierarchy of the given type, i.e.
|
static <T> T |
getDefaultConstraint(Class<T> constraintType,
Definition<?> definition)
Get the default constraint for the given constraint type.
|
static boolean |
isMutableConstraint(Class<?> type)
Determine if the constraint type in the hierarchy of the given type is
mutable.
|
public static <T> T getDefaultConstraint(Class<T> constraintType, Definition<?> definition) throws IllegalArgumentException
T
- the constraint typeconstraintType
- the concrete constraint type, i.e. a type annotated
with Constraint
and defining a default constructor
and/or a constructor taking a Definition
as an
argumentdefinition
- the definition the constraint will be associated toIllegalArgumentException
- if the given type is no constraint type
or creating the default constraint failsConstraint
,
Definition.getConstraint(Class)
public static Class<?> getConstraintType(Class<?> type) throws IllegalArgumentException
Constraint
type
- the type to determine the constraint type forIllegalArgumentException
- if no constraint type exists in the type
hierarchypublic static boolean isMutableConstraint(Class<?> type)
type
- the type to determine the constraint type forIllegalArgumentException
- if no constraint type exists in the type
hierarchyBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a