net.datacrow.core.modules.xml
Class XmlField

java.lang.Object
  extended by net.datacrow.core.modules.xml.XmlObject
      extended by net.datacrow.core.modules.xml.XmlField

public class XmlField
extends XmlObject

A XML definition of a DcField.

Author:
Robert Jan van der Waals

Constructor Summary
XmlField()
          Creates an empty instance.
XmlField(XmlField template)
          Creates a new field based on an existing one.
XmlField(XmlModule xmlModule, org.w3c.dom.Element element)
          Creates a new instances.
 
Method Summary
 boolean canBeConverted()
           
 boolean canConvertTo(int fieldType, int valueType)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getColumn()
          The database column name
 DcFieldDefinition getDefinition()
           
 int getFieldType()
          The field type.
 int getIndex()
          The unique field index.
 int getMaximumLength()
          Returns the maximum field length (characters positions).
 int getModule()
           
 int getModuleReference()
          The module reference (module index).
 java.lang.String getName()
          The field's system name.
 int getValueType()
          The value type.
 int hashCode()
           
 boolean isEnabled()
          Indicates if the field is enabled by default.
 boolean isNew()
           
 boolean isOverwritable()
          Indicates if this field can be removed using the module wizard.
 boolean isReadonly()
          Indicates whether this field is editable or not.
 boolean isSearchable()
          Indicates whether a user can search on this field.
 boolean isUiOnly()
          Indicates if the value is actually stored in the database or that the value is calculated.
 void setColumn(java.lang.String column)
          Sets the database column name.
 void setDefinition(DcFieldDefinition definition)
           
 void setEnabled(boolean enabled)
          Indicates whether this field is enabled by default.
 void setFieldType(int fieldType)
          Sets the field type.
 void setIndex(int index)
          Sets the unique field index.
 void setMaximumLength(int maximumLength)
          Sets the maximum length for the value of this field.
 void setModule(int module)
           
 void setModuleReference(int moduleReference)
          Sets the module reference.
 void setName(java.lang.String name)
          Sets the system name.
 void setOverwritable(boolean overwritable)
          Indicate if this field can be removed using the module wizard.
 void setReadonly(boolean readonly)
          Marks the field as readonly.
 void setSearchable(boolean searchable)
          Indicate if a user can search on this field.
 void setUiOnly(boolean uiOnly)
          Indicate if the value of this field is stored in the database or that it is calculated.
 void setValueType(int valueType)
          Sets the value type.
 java.lang.String toString()
           
 
Methods inherited from class net.datacrow.core.modules.xml.XmlObject
getClass
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlField

public XmlField()
Creates an empty instance.


XmlField

public XmlField(XmlField template)
Creates a new field based on an existing one.

Parameters:
template -

XmlField

public XmlField(XmlModule xmlModule,
                org.w3c.dom.Element element)
         throws InvalidValueException
Creates a new instances.

Parameters:
xmlModule - The XML module to which the field belongs.
element - The XML element to parse.
Throws:
InvalidValueException
Method Detail

getDefinition

public DcFieldDefinition getDefinition()

setDefinition

public void setDefinition(DcFieldDefinition definition)

setModule

public void setModule(int module)

getModule

public int getModule()

isNew

public boolean isNew()

canBeConverted

public boolean canBeConverted()

canConvertTo

public boolean canConvertTo(int fieldType,
                            int valueType)

getColumn

public java.lang.String getColumn()
The database column name


isEnabled

public boolean isEnabled()
Indicates if the field is enabled by default.


getFieldType

public int getFieldType()
The field type.

See Also:
ComponentFactory

getIndex

public int getIndex()
The unique field index.


getMaximumLength

public int getMaximumLength()
Returns the maximum field length (characters positions). In case the field is of type long text field the maximum value will be the maximum integer (Integer.MAX_VALUE) value (maximum field setting is thus overruled).


getModuleReference

public int getModuleReference()
The module reference (module index). Can be any module for reference fields.


getName

public java.lang.String getName()
The field's system name.


isReadonly

public boolean isReadonly()
Indicates whether this field is editable or not.


isSearchable

public boolean isSearchable()
Indicates whether a user can search on this field.


isUiOnly

public boolean isUiOnly()
Indicates if the value is actually stored in the database or that the value is calculated.


getValueType

public int getValueType()
The value type.

See Also:
DcRepository.ValueTypes

setColumn

public void setColumn(java.lang.String column)
Sets the database column name.

Parameters:
column -

setEnabled

public void setEnabled(boolean enabled)
Indicates whether this field is enabled by default.

Parameters:
enabled -

setFieldType

public void setFieldType(int fieldType)
Sets the field type.

Parameters:
fieldType -
See Also:
ComponentFactory

setIndex

public void setIndex(int index)
Sets the unique field index.

Parameters:
index -

setMaximumLength

public void setMaximumLength(int maximumLength)
Sets the maximum length for the value of this field.

Parameters:
maximumLength -

setModuleReference

public void setModuleReference(int moduleReference)
Sets the module reference.

Parameters:
moduleReference -

setName

public void setName(java.lang.String name)
Sets the system name.

Parameters:
name -

setReadonly

public void setReadonly(boolean readonly)
Marks the field as readonly.

Parameters:
readonly -

setSearchable

public void setSearchable(boolean searchable)
Indicate if a user can search on this field.

Parameters:
searchable -

setUiOnly

public void setUiOnly(boolean uiOnly)
Indicate if the value of this field is stored in the database or that it is calculated.

Parameters:
uiOnly -

setValueType

public void setValueType(int valueType)
Sets the value type.

Parameters:
valueType -
See Also:
DcRepository.ValueTypes

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isOverwritable

public boolean isOverwritable()
Indicates if this field can be removed using the module wizard.


setOverwritable

public void setOverwritable(boolean overwritable)
Indicate if this field can be removed using the module wizard.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object