public class ConstraintFactory
extends java.lang.Object
ConstraintGroup
to contains all constraints associated with
one class or one attribute in one class.
We scan all the interfaces and all the superclass of the class in order to be sure to include
all the needed constraints. This factory is basically creating via reflection some ConstraintDeclaration
instances which it use to create the ConstraintGroup
.
AbstractConstraintDeclaration.getInstance(String)
,
ConstraintDeclaration.createConstraints(int, int, CHECK_CATEGORY[], ValidationContext)
,
ConstraintDeclaration.createConstraints(int, int, String, ValidationContext)
,
ConstraintDeclaration.addErrorCodesForCheck(Set, int, int, CHECK_CATEGORY, ValidationContext)
,
ConstraintDeclaration.addErrorCodesForAttribute(Set, int, int, String, ValidationContext)
Constructor | Description |
---|---|
ConstraintFactory() |
Modifier and Type | Method | Description |
---|---|---|
<T> ConstraintGroup<T> |
getConstraintsForAttribute(java.lang.Class<?> clazz,
java.lang.String attributeName,
int level,
int version,
java.util.Set<java.lang.Class<?>> collectedClasses,
ValidationContext context) |
Returns all constraints necessary to validate the attribute of the specified class.
|
<T> ConstraintGroup<T> |
getConstraintsForAttribute(java.lang.Class<?> clazz,
java.lang.String attributeName,
int level,
int version,
ValidationContext context) |
Returns all constraints necessary to validate the attribute of the specified class.
|
<T> ConstraintGroup<T> |
getConstraintsForClass(java.lang.Class<?> clazz,
ValidationContext ctx) |
Gets all the constraints for one class.
|
<T> ConstraintGroup<T> |
getConstraintsForClass(java.lang.Class<?> clazz,
SBMLValidator.CHECK_CATEGORY[] categories,
int level,
int version,
ValidationContext context) |
Gets all the constraints for one class and some
SBMLValidator.CHECK_CATEGORY s. |
static ConstraintFactory |
getInstance() |
Returns the
ConstraintFactory singleton instance. |
public static ConstraintFactory getInstance()
ConstraintFactory
singleton instance.ConstraintFactory
singleton instance.public <T> ConstraintGroup<T> getConstraintsForClass(java.lang.Class<?> clazz, ValidationContext ctx)
clazz
- the class to get constraints forctx
- the validation contextpublic <T> ConstraintGroup<T> getConstraintsForClass(java.lang.Class<?> clazz, SBMLValidator.CHECK_CATEGORY[] categories, int level, int version, ValidationContext context)
SBMLValidator.CHECK_CATEGORY
s.clazz
- the class to get constraints forcategories
- the array of categories to consider to create the constraintslevel
- the SBML levelversion
- the SBML versioncontext
- the validation contextSBMLValidator.CHECK_CATEGORY
s.public <T> ConstraintGroup<T> getConstraintsForAttribute(java.lang.Class<?> clazz, java.lang.String attributeName, int level, int version, ValidationContext context)
clazz
- the class to get constraints forattributeName
- the attribute name to get constraint forlevel
- the SBML levelversion
- the SBML versioncontext
- the validation contextpublic <T> ConstraintGroup<T> getConstraintsForAttribute(java.lang.Class<?> clazz, java.lang.String attributeName, int level, int version, java.util.Set<java.lang.Class<?>> collectedClasses, ValidationContext context)
Returns null
if the class was already in the collectedClasses
set.
clazz
- the class to get constraints forattributeName
- the attribute name to get constraint forlevel
- the SBML levelversion
- the SBML versioncollectedClasses
- the set of classes that we already created constraints forcontext
- the validation contextcollectedClasses
set.