com.ivata.mask.field
Interface Field

All Known Implementing Classes:
FieldImpl

public interface Field

Defines a single field within a mask or group of masks.

Since:
ivata masks 0.1 (2004-02-26)
Author:
Colin MacLeod colin.macleod@ivata.com

Field Summary
static java.lang.String TYPE_AMOUNT
          Indicates the fields contents should be formatted as an amount.
static java.lang.String TYPE_DATE
          Indicates the fields contents should be formatted as a date.
static java.lang.String TYPE_NUMBER
          Indicates the fields contents should be formatted as a number.
static java.lang.String TYPE_RADIO
          Indicates the field is an option to be displayed as a radio button.
static java.lang.String TYPE_SELECT
          Indicates the field is displayed as a choice combo box.
static java.lang.String TYPE_STRING
          Indicates the field is displayed as a short text.
static java.lang.String TYPE_TEXTAREA
          Indicates the field is displayed as a long text.
 
Method Summary
 java.util.Properties getChoiceProperties()
          If this field represents a combo (select) type, returns the choices as a Properties instance.
 java.util.List getChoicePropertyKeys()
          If this field represents a combo (select) type, returns the choice keys as a List of String instances.
 java.lang.String getDefaultValue()
          Get the default value for this field.
 java.lang.Class getDOClass()
          Get the data object class for this field, if appropriate.
 java.lang.String getName()
          Id of just this field.
 Field getParent()
           Get the field which contains this one.
 java.lang.String getPath()
           Return the full path to this field, including the names of parent fields separated by '.' characters.
 java.lang.String getType()
          Indicates what sort of data this field should hold.
 Mask getValueObjectMask()
           If this field represents a value object, get the mask associated with this value object.
 boolean isDisplayOnly()
          Get whether or not this field can be amended.
 boolean isHidden()
           Is this field hidden or displayed?
 boolean isMandatory()
           Is this field required or optional?
 boolean isOneToOne()
          If this field represents another value object, but the relationship with its container is one-to-one, then it can be included in the parent's mask directly.
 

Field Detail

TYPE_AMOUNT

public static final java.lang.String TYPE_AMOUNT
Indicates the fields contents should be formatted as an amount.

See Also:
Constant Field Values

TYPE_DATE

public static final java.lang.String TYPE_DATE
Indicates the fields contents should be formatted as a date.

See Also:
Constant Field Values

TYPE_NUMBER

public static final java.lang.String TYPE_NUMBER
Indicates the fields contents should be formatted as a number.

See Also:
Constant Field Values

TYPE_RADIO

public static final java.lang.String TYPE_RADIO
Indicates the field is an option to be displayed as a radio button.

See Also:
Constant Field Values

TYPE_SELECT

public static final java.lang.String TYPE_SELECT
Indicates the field is displayed as a choice combo box.

See Also:
Constant Field Values

TYPE_STRING

public static final java.lang.String TYPE_STRING
Indicates the field is displayed as a short text.

See Also:
Constant Field Values

TYPE_TEXTAREA

public static final java.lang.String TYPE_TEXTAREA
Indicates the field is displayed as a long text.

See Also:
Constant Field Values
Method Detail

getChoiceProperties

public java.util.Properties getChoiceProperties()
If this field represents a combo (select) type, returns the choices as a Properties instance.

Returns:
Properties instance representing the possible values.

getChoicePropertyKeys

public java.util.List getChoicePropertyKeys()
If this field represents a combo (select) type, returns the choice keys as a List of String instances.

Returns:
List of String instances representing the key values of all choice options.

getDefaultValue

public java.lang.String getDefaultValue()
Get the default value for this field. If no default has been defined for this field, is null.

Returns:
default value for this field, or null if none is defined.

getDOClass

public java.lang.Class getDOClass()
Get the data object class for this field, if appropriate.

Returns:
data object class if this field links to a data object, otherwise null.

getName

public java.lang.String getName()
Id of just this field.

Returns:
Id of just this field.

getParent

public Field getParent()

Get the field which contains this one.

Returns:
Field which contains this field, or null if this is a top-level field.

getPath

public java.lang.String getPath()

Return the full path to this field, including the names of parent fields separated by '.' characters.

Returns:
Full path to this field, to uniquely identify it within the system.

getType

public java.lang.String getType()
Indicates what sort of data this field should hold.

Returns:
type of the field, from one of the TYPE_ values in this interface.

getValueObjectMask

public Mask getValueObjectMask()

If this field represents a value object, get the mask associated with this value object. Note: this is not the mask the field is in!.

Returns:
Mask associated with this value object or null if this field is not a value object.

isDisplayOnly

public boolean isDisplayOnly()
Get whether or not this field can be amended. Useful for automatically generated fields such as timestamps.

Returns:
true if the field cannot be manually changed.

isHidden

public boolean isHidden()

Is this field hidden or displayed?

Returns:
true if this field is hidden.

isMandatory

public boolean isMandatory()

Is this field required or optional?

Returns:
true if this field is required and must have a non- null, non-empty value. Otherwise, false for an optional field.

isOneToOne

public boolean isOneToOne()
If this field represents another value object, but the relationship with its container is one-to-one, then it can be included in the parent's mask directly.

Returns:
true if this field should be displayed directly in the mask of the parent field.


Copyright © 2001-2005 ivata limited. All Rights Reserved.