Provides interfaces for the MillStone data layer which contains classes
for typed data values, data collections, and handlers. A
{@link org.millstone.base.data.Property Property} is a simple typed data
value; an {@link org.millstone.base.data.Item Item} is a collection of
Properties, each corresponding to a unique identifier; a
{@link org.millstone.base.data.Container Container} is a collection of
identified Items with special constraints; a
{@link org.millstone.base.data.Buffered Buffered} class is able to track
its changes and to commit or discard them later.
Package Specification
The package contains a three-tiered structure for typed data objects and
collections of them:
- The simplest of these is the
{@link org.millstone.base.data.Property Property} which represents a
single typed data value. A Property may be read-only in which
case attempts to modify its contents will throw an exception.
- The second level of the data layer is represented by the
{@link org.millstone.base.data.Item Item} which embodies a set of
Properties. Each Property in an Item corresponds to a locally
unique(that is, inside the Item) identifier.
- The third level is called the
{@link org.millstone.base.data.Container Container} which can be
visualized as a set of Items, each corresponding to a locally unique
identifier. Note that the Container imposes a few restrictions on the
data stored in it, see further documentation in the
class specification.
In addition to these interfaces the package contains the
{@link org.millstone.base.data.Buffered Buffered} interface, which defines
the methods to make an object buffered, that is, track the changes to an
object and allow committing or discarding them at a later time.
Provides interfaces for the MillStone validation framework. The framework
defines two interfaces; one for classes that need to support external
validation, and another one for the validators themselves.
Validation
The most important method defined by the
{@link org.millstone.base.data.Validatable Validatable} interface is
{@link org.millstone.base.data.Validatable#isValid() isValid()}. It
asks all registered validators to verify if the object's value is valid
or not. Note that it depends on the validators registered for a object which
values are valid and which are not. For example, a null value
can be valid value for one validator but invalid for another.
In addition to isValid() , Validatable defines
methods to add, remove and list validators of a validatable object.
{@link org.millstone.base.data.Validator Validator} defines the
interface for an external validator. These validators may be added to
any Validatable object, and their task is to check, when
requested, that the object which they are attached to contains a valid
value. The actual validation logic is hidden in the
{@link org.millstone.base.data.Validator#validate(Object) validate(Object)}
method.
In addition to check(Object) , Validator defines
the InvalidValueException which is used to signal that a
checked value is invalid, and the
{@link org.millstone.base.data.Validator.Suggestive Suggestive}
subinterface which includes functionality to suggest a valid value for
the validated object.
|