net.sf.dc.core.objects
Class DCFieldDefinition

java.lang.Object
  extended bynet.sf.dc.core.objects.DCFieldDefinition

public class DCFieldDefinition
extends java.lang.Object

Definition of a field of a Data Crow Object. The label, length, value type, etc is described here

Since:
1.3
Version:
1.00
Author:
Robert-Jan van der Waals

Constructor Summary
DCFieldDefinition(java.lang.String label, boolean readonly, boolean searchable, int maximumLength, int fieldType, int valueType, java.lang.String databaseFieldName)
          Creates a new field definition.
 
Method Summary
 java.lang.String getDatabaseFieldName()
          Returns the database field name (used for queries)
 java.lang.String getDataBaseFieldType()
          Determines and returns the database field type
 int getFieldType()
          Returns the UI component type (@see ComponentFactory)
 java.lang.String getLabel()
          Returns the display value
 int getMaximumLength()
          Returns the maximum input length
 int getValueType()
          Returns the input value type (@see Repository.datatypes)
 boolean isHidden()
          Indicates whether this field is visible or not within the UI
 boolean isReadOnly()
          Is this field readonly (like the ID fields)
 boolean isRequired()
          Is this field required (must be filled)
 boolean isSearchable()
          Defines whether a search can be performed on this field.
 void setDatabaseFieldName(java.lang.String s)
          Sets the database column name (database mapping)
 void setFieldType(int index)
          Sets the UI field type @see ComponentFactory
 void setHidden(boolean b)
          Makes this field hidden (for UI purposes)
 void setLabel(java.lang.String s)
          Sets the display value for this field
 void setMaximumLength(int i)
          Sets the maximum input length
 void setReadOnly(boolean b)
          Sets this field to uneditable
 void setRequired(boolean b)
          Makes this field required
 void setSearchable(boolean searchable)
          Can there be searched on this field ?
 void setValueType(int index)
          Sets the input value type @see Repository.datatypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DCFieldDefinition

public DCFieldDefinition(java.lang.String label,
                         boolean readonly,
                         boolean searchable,
                         int maximumLength,
                         int fieldType,
                         int valueType,
                         java.lang.String databaseFieldName)
Creates a new field definition.

Parameters:
label - display value
readonly - writable or not
maximumLength - maximum inout length
fieldType - UI component type (@see ComponentFactory)
valueType - input value type (@see Repository.datatypes)
databaseFieldName - database column name
Method Detail

setSearchable

public void setSearchable(boolean searchable)
Can there be searched on this field ?

Parameters:
searchable -

getDatabaseFieldName

public java.lang.String getDatabaseFieldName()
Returns the database field name (used for queries)

Returns:
correct database field name

getFieldType

public int getFieldType()
Returns the UI component type (@see ComponentFactory)


getValueType

public int getValueType()
Returns the input value type (@see Repository.datatypes)


getLabel

public java.lang.String getLabel()
Returns the display value


isHidden

public boolean isHidden()
Indicates whether this field is visible or not within the UI


isRequired

public boolean isRequired()
Is this field required (must be filled)

Returns:
is required y/n

isReadOnly

public boolean isReadOnly()
Is this field readonly (like the ID fields)

Returns:
is readonly y/n

isSearchable

public boolean isSearchable()
Defines whether a search can be performed on this field. Example; on picture fields cannot be searched


getMaximumLength

public int getMaximumLength()
Returns the maximum input length


setLabel

public void setLabel(java.lang.String s)
Sets the display value for this field


setReadOnly

public void setReadOnly(boolean b)
Sets this field to uneditable

Parameters:
b - read only y/n

setRequired

public void setRequired(boolean b)
Makes this field required

Parameters:
b - required y/n

setHidden

public void setHidden(boolean b)
Makes this field hidden (for UI purposes)

Parameters:
b - hidden y/n

setMaximumLength

public void setMaximumLength(int i)
Sets the maximum input length

Parameters:
i - maximum input length

setFieldType

public void setFieldType(int index)
Sets the UI field type @see ComponentFactory

Parameters:
index - Component type index

setValueType

public void setValueType(int index)
Sets the input value type @see Repository.datatypes

Parameters:
index - the value type index

setDatabaseFieldName

public void setDatabaseFieldName(java.lang.String s)
Sets the database column name (database mapping)

Parameters:
s - database field name

getDataBaseFieldType

public java.lang.String getDataBaseFieldType()
Determines and returns the database field type