| com.uwyn.rife.site.Constrained
Constrained | public interface Constrained (Code) | | 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:
- a HTML form builder can create a field that doesn't allow the entry of
longer text,
- a SQL query builder can limit the size of the column in which the text
will stored when the table creation SQL is generated,
- a validation system can check if the text isn't longer than 30
characters and provide appropriate information when the length is exceeded.
There are two types of constraints:
- those that are related to the entire bean (
ConstrainedBean
constraints)
- those that only apply to a single property (
ConstrainedProperty
constraints)
author: Geert Bevin (gbevin[remove] at uwyn dot com) See Also: ConstrainedBean See Also: ConstrainedProperty version: $Revision: 3717 $ since: 1.0 |
Method Summary | |
public void | addConstraint(B constrainedBean) Add a new constrained bean.
When several constrained beans are added, they are merged at
constraint-level. | public void | addConstraint(P constrainedProperty) Add a new constrained property.
When several of the same constrained properties are added, they are
merged at constraint-level. | public B | getConstrainedBean() Retrieves the constrained bean that has been set for this
Constrained instance. | public Collection<P> | getConstrainedProperties() Returns a collection with all the constrained properties that have
been registered.
A Collection with all theConstrainedProperty objects that are registered. | public P | getConstrainedProperty(String propertyName) Retrieve a registered ConstrainedProperty according to
its name. | public boolean | hasPropertyConstraint(String name) Indicates whether this constrained bean contains a particular constraint
on at least one of its properties. |
addConstraint | public void addConstraint(B constrainedBean)(Code) | | Add a new constrained bean.
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.
Parameters: constrainedBean - the ConstrainedBean instancethat has to be added See Also: ConstrainedBean since: 1.0 |
addConstraint | public void addConstraint(P constrainedProperty)(Code) | | Add a new constrained property.
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.
Parameters: constrainedProperty - the ConstrainedProperty instance that has to be added See Also: ConstrainedProperty since: 1.0 |
getConstrainedBean | public B getConstrainedBean()(Code) | | Retrieves the constrained bean that has been set for this
Constrained instance.
the requested ConstrainedBean; or null if no ConstrainedBean isavailable. See Also: ConstrainedProperty since: 1.0
|
getConstrainedProperties | public Collection<P> getConstrainedProperties()(Code) | | Returns a collection with all the constrained properties that have
been registered.
A Collection with all theConstrainedProperty objects that are registered. If noconstrained properties are available, an empty collection will bereturned, not null . See Also: ConstrainedProperty since: 1.0 |
getConstrainedProperty | public P getConstrainedProperty(String propertyName)(Code) | | Retrieve a registered ConstrainedProperty according to
its name.
Parameters: propertyName - the name of theConstrainedProperty that has to be retrieved the requested ConstrainedProperty; or null if no such ConstrainedProperty isavailable. See Also: ConstrainedProperty since: 1.0
|
hasPropertyConstraint | public boolean hasPropertyConstraint(String name)(Code) | | Indicates whether this constrained bean contains a particular constraint
on at least one of its properties.
true if this constraint is present on at least oneof the properties; orfalse otherwise See Also: ConstrainedProperty since: 1.6
|
|
|