|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Constrained<B extends ConstrainedBean,P extends ConstrainedProperty>
This interface defines methods for bean-centric constraining of data entities.
A constraint describes additional information about a data entity. Its main purpose is to alter the default behaviour of a data type and to clearly set the accepted limits. The meta-data that's provided through constraints can be used elsewhere to gather more information about how to correctly integrate the indicated data limits.
For example, a constraint specifies that a certain text's length is limited to 30 characters, parts of the system can query this information and act accordingly:
There are two types of constraints:
ConstrainedBean
constraints)
ConstrainedProperty
constraints)
ConstrainedBean,
ConstrainedProperty| Method Summary | |
|---|---|
void |
addConstraint(B constrainedBean)
Add a new constrained bean. |
void |
addConstraint(P constrainedProperty)
Add a new constrained property. |
B |
getConstrainedBean()
Retrieves the constrained bean that has been set for this Constrained instance. |
Collection<P> |
getConstrainedProperties()
Returns a collection with all the constrained properties that have been registered. |
P |
getConstrainedProperty(String propertyName)
Retrieve a registered ConstrainedProperty according to
its name. |
boolean |
hasPropertyConstraint(String name)
Indicates whether this constrained bean contains a particular constraint on at least one of its properties. |
| Method Detail |
|---|
void addConstraint(B constrainedBean)
When several constrained beans are added, they are merged at constraint-level. This means for instance that all previous unique constraints will be replaced by those of the new constrained bean, they will not be combined.
constrainedBean - the ConstrainedBean instance
that has to be addedConstrainedBeanvoid addConstraint(P constrainedProperty)
When several of the same constrained properties are added, they are merged at constraint-level. This means for instance that a previous inList constraint will be replaced by the one of the new constrained bean, they will not be combined.
constrainedProperty - the ConstrainedProperty
instance that has to be addedConstrainedPropertyB getConstrainedBean()
Constrained instance.
ConstrainedBean; or
null if no ConstrainedBean is
available.
ConstrainedPropertyCollection<P> getConstrainedProperties()
Collection with all the
ConstrainedProperty objects that are registered. If no
constrained properties are available, an empty collection will be
returned, not null.ConstrainedPropertyboolean hasPropertyConstraint(String name)
true if this constraint is present on at least one
of the properties; or
false otherwise
ConstrainedPropertyP getConstrainedProperty(String propertyName)
ConstrainedProperty according to
its name.
propertyName - the name of the
ConstrainedProperty that has to be retrieved
ConstrainedProperty; or
null if no such ConstrainedProperty is
available.
ConstrainedProperty
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||