01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.enterprise.datatypes;
16:
17: /** Definition of the generic Composite Data Type interface.
18: * This interface is a base interface, which must be implemented by all structures in enterprise.
19: */
20: public interface CompositeDataType {
21: /** Returns true if this instance is empty. (Empty means that all fields this data type is composed of are are null).
22: * In MetaBoss enterprise model if the reference to the datatype instance
23: * is null - it means that the instance has not been retrieved from storage or
24: * instance has not been specified by user. For the read functionality it
25: * means that reading of the field must be attempted, for the update functionality
26: * it means that the value of the field should be left intact during the update.
27: * If on the other hand if the reference to the datatype instance is not null, but
28: * contains empty instance (isEmpty() method returns true) it should be treated as
29: * meaningfull value (NULL value at the database). For the read functionality it
30: * means that reading of the field has already been done and the field is empty
31: * , for the update functionality it means that the value of the field should be set to empty
32: * during the update.
33: */
34: public boolean isEmpty();
35:
36: /**The java.lang.Object's public String toString() method must be implemented in each datatype.
37: * In words of java.lang.Object's javadoc <I>"toString() returns a string representation of the object.
38: * In general, the toString method returns a string that "textually represents" this object.
39: * The result should be a concise but informative representation that is easy for a person to read.
40: * It is recommended that all subclasses override this method."
41: * Note that this method should deal with empty values and not throw
42: * exceptions. This is necessary to enable presentation of data. Empty should
43: * result in empty string. */
44: public String toString();
45: }
|