You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

package.html 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <html>
  3. <head>
  4. </head>
  5. <body bgcolor="white">
  6. <p>Provides interfaces for the data layer which contains classes
  7. for typed data values, data collections, and handlers. A
  8. {@link com.itmill.toolkit.data.Property Property} is a simple typed data
  9. value; an {@link com.itmill.toolkit.data.Item Item} is a collection of
  10. Properties, each corresponding to a unique identifier; a
  11. {@link com.itmill.toolkit.data.Container Container} is a collection of
  12. identified Items with special constraints; a
  13. {@link com.itmill.toolkit.data.Buffered Buffered} class is able to track
  14. its changes and to commit or discard them later.</p>
  15. <h2>Package Specification</h2>
  16. <p>The package contains a three-tiered structure for typed data objects and
  17. collections of them:</p>
  18. <center>
  19. <p><a href=Property.html target="classFrame"><img src=doc-files/Property.gif></a></p>
  20. <p><a href=Item.html target="classFrame"><img src=doc-files/Item.gif></a></p>
  21. <p><a href=Container.html target="classFrame"><img src=doc-files/Container_simple.gif></a></p>
  22. </center>
  23. <ul>
  24. <li>The simplest of these is the
  25. {@link com.itmill.toolkit.data.Property Property} which represents a
  26. single typed data value. A Property may be read-only in which
  27. case attempts to modify its contents will throw an exception.
  28. <li>The second level of the data layer is represented by the
  29. {@link com.itmill.toolkit.data.Item Item} which embodies a set of
  30. <i>Properties</i>. Each Property in an Item corresponds to a locally
  31. unique(that is, inside the Item) identifier.
  32. <li>The third level is called the
  33. {@link com.itmill.toolkit.data.Container Container} which can be
  34. visualized as a set of Items, each corresponding to a locally unique
  35. identifier. Note that the Container imposes a few restrictions on the
  36. data stored in it, see further documentation in the
  37. <a href=Container.html target="classFrame">class specification</a>.
  38. </ul>
  39. <p>In addition to these interfaces the package contains the
  40. {@link com.itmill.toolkit.data.Buffered Buffered} interface, which defines
  41. the methods to make an object buffered, that is, track the changes to an
  42. object and allow committing or discarding them at a later time.</p>
  43. <p>Provides interfaces for the validation framework. The framework
  44. defines two interfaces; one for classes that need to support external
  45. validation, and another one for the validators themselves.</p>
  46. <h2>Validation</h2>
  47. <p>The most important method defined by the
  48. {@link com.itmill.toolkit.data.Validatable Validatable} interface is
  49. {@link com.itmill.toolkit.data.Validatable#isValid() isValid()}. It
  50. asks all registered validators to verify if the object's value is valid
  51. or not. Note that it depends on the validators registered for a object which
  52. values are valid and which are not. For example, a <code>null</code> value
  53. can be valid value for one validator but invalid for another.<p>
  54. <p>In addition to <code>isValid()</code>, <code>Validatable</code> defines
  55. methods to add, remove and list validators of a validatable object.</p>
  56. <p>{@link com.itmill.toolkit.data.Validator Validator} defines the
  57. interface for an external validator. These validators may be added to
  58. any <code>Validatable</code> object, and their task is to check, when
  59. requested, that the object which they are attached to contains a valid
  60. value. The actual validation logic is hidden in the
  61. {@link com.itmill.toolkit.data.Validator#validate(Object) validate(Object)}
  62. method.</p>
  63. <p>In addition to <code>check(Object)</code>, <code>Validator</code> defines
  64. the <code>InvalidValueException</code> which is used to signal that a
  65. checked value is invalid, and the
  66. {@link com.itmill.toolkit.data.Validator.Suggestive Suggestive}
  67. subinterface which includes functionality to suggest a valid value for
  68. the validated object.</p><!-- Put @see and @since tags down here. -->
  69. </body>
  70. </html>