com.ivata.mask.field
Class FieldImpl

java.lang.Object
  extended bycom.ivata.mask.field.FieldImpl
All Implemented Interfaces:
Field, java.io.Serializable

public class FieldImpl
extends java.lang.Object
implements Field, java.io.Serializable

This is the default implementation of an ivata masks field. Don't use this class directly, use the Fieldinterface.

Since:
ivata masks 0.1 (2004-05-15) colin.macleod@ivata.com
Author:
Colin MacLeod
See Also:
Field, Serialized Form

Field Summary
 
Fields inherited from interface com.ivata.mask.field.Field
TYPE_AMOUNT, TYPE_DATE, TYPE_NUMBER, TYPE_RADIO, TYPE_SELECT, TYPE_STRING, TYPE_TEXTAREA
 
Constructor Summary
FieldImpl(Field parentParam, Field extendedFieldParam, MaskFactory maskFactoryParam)
          Construct a field with the given parent or inherited field.
 
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 getLabelKey()
           
 java.lang.String getName()
          Id of just this field - equivalent to the field name.
 Field getParent()
           Get the field which contains this one.
 java.lang.String getPath()
           Return the full path to this field, including the ids 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()
          true if this field is hidden.
 boolean isMandatory()
           Is this field is 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.
 void setChoiceProperties(java.util.Properties choicePropertiesParam)
          Refer to getChoiceProperties().
 void setChoicePropertyKeys(java.util.List choicePropertyKeysParam)
          Refer to getChoicePropertyKeys().
 void setDefaultValue(java.lang.String defaultValueParam)
          Refer to getDefaultValue().
 void setDisplayOnly(boolean displayOnlyParam)
          Refer to isDisplayOnly().
 void setDOClass(java.lang.Class classParam)
          Refer to getDOClass().
 void setHidden(boolean hiddenParam)
          Refer to #getHidden.
 void setLabelKey(java.lang.String labelKeyParam)
          Refer to getLabelKey().
 void setMandatory(boolean mandatoryParam)
          Refer to #getMandatory.
 void setName(java.lang.String nameParam)
          Refer to getName().
 void setOneToOne(boolean oneToOneParam)
          Refer to isOneToOne().
 void setParent(Field parentParam)
          Refer to getParent().
 void setType(java.lang.String typeParam)
          Refer to getType().
 java.lang.String toString()
          Overridden to return the field name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldImpl

public FieldImpl(Field parentParam,
                 Field extendedFieldParam,
                 MaskFactory maskFactoryParam)
Construct a field with the given parent or inherited field.

Parameters:
parentParam - The field whose characteristics this one inherits, if they have not been set directly.
extendedFieldParam - field defined by an explicit "extends" attribute in the configuration.
maskFactoryParam - This mask factory is used to retrieve the mask for this field, if the field represents a value object.
Method Detail

getChoiceProperties

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

Specified by:
getChoiceProperties in interface Field
Returns:
Properties instance representing the possible values.

getChoicePropertyKeys

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

Specified by:
getChoicePropertyKeys in interface Field
Returns:
List of String instances representing the key values of all choice options.

getDefaultValue

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

Specified by:
getDefaultValue in interface Field
Returns:
default value for this field, or null if none is defined.

getDOClass

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

Specified by:
getDOClass in interface Field
Returns:
data object class if this field links to a data object, otherwise null.

getLabelKey

public java.lang.String getLabelKey()
Returns:
Returns the labelKey.

getName

public final java.lang.String getName()
Id of just this field - equivalent to the field name.

Specified by:
getName in interface Field
Returns:
Id of just this field - equivalent to the field name.

getParent

public final Field getParent()

Get the field which contains this one.

Specified by:
getParent in interface Field
Returns:
Field which contains this field, or null if this is a top-level field.

getPath

public final java.lang.String getPath()

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

Specified by:
getPath in interface Field
Returns:
Full path to this field, to uniquely identify it within the system.

getType

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

Specified by:
getType in interface Field
Returns:
type of the field, from one of the TYPE_ values in the Fieldinterface.

getValueObjectMask

public final Mask getValueObjectMask()

If this field represents a value object, get the mask associated with this value object.

Specified by:
getValueObjectMask in interface Field
Returns:
Mask associated with this value object or null if this field is not a value object.
See Also:
com.ivata.mask.field.Field#getMask

isDisplayOnly

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

Specified by:
isDisplayOnly in interface Field
Returns:
true if the field cannot be manually changed.

isHidden

public boolean isHidden()
true if this field is hidden. Otherwise, false.

Specified by:
isHidden in interface Field
Returns:
Returns whether or not the field is hidden.

isMandatory

public final boolean isMandatory()

Is this field is required or optional?

Specified by:
isMandatory in interface Field
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.

Specified by:
isOneToOne in interface Field
Returns:
true if this field should be displayed directly in the mask of the parent field.

setChoiceProperties

public void setChoiceProperties(java.util.Properties choicePropertiesParam)
Refer to getChoiceProperties().

Parameters:
choicePropertiesParam - Refer to getChoiceProperties().

setChoicePropertyKeys

public void setChoicePropertyKeys(java.util.List choicePropertyKeysParam)
Refer to getChoicePropertyKeys().

Parameters:
choicePropertyKeysParam - Refer to getChoicePropertyKeys().

setDefaultValue

public void setDefaultValue(java.lang.String defaultValueParam)
Refer to getDefaultValue().

Parameters:
defaultValueParam - Refer to getDefaultValue().

setDisplayOnly

public void setDisplayOnly(boolean displayOnlyParam)
Refer to isDisplayOnly().

Parameters:
displayOnlyParam - Refer to isDisplayOnly().

setDOClass

public void setDOClass(java.lang.Class classParam)
Refer to getDOClass().

Parameters:
classParam - Refer to getDOClass().

setHidden

public void setHidden(boolean hiddenParam)
Refer to #getHidden.

Parameters:
hiddenParam - Refer to #getHidden.

setLabelKey

public void setLabelKey(java.lang.String labelKeyParam)
Refer to getLabelKey().

Parameters:
labelKeyParam - Refer to getLabelKey().

setMandatory

public void setMandatory(boolean mandatoryParam)
Refer to #getMandatory.

Parameters:
mandatoryParam - Refer to #getMandatory.

setName

public void setName(java.lang.String nameParam)
Refer to getName().

Parameters:
nameParam - Refer to getName().

setOneToOne

public void setOneToOne(boolean oneToOneParam)
Refer to isOneToOne().

Parameters:
oneToOneParam - Refer to isOneToOne().

setParent

public void setParent(Field parentParam)
Refer to getParent().

Parameters:
parentParam - Refer to getParent().

setType

public void setType(java.lang.String typeParam)
Refer to getType().

Parameters:
typeParam - Refer to getType().

toString

public final java.lang.String toString()
Overridden to return the field name.

Returns:
the field name.


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