lumis.doui.source.field
Class BaseSourceField

Package class diagram package BaseSourceField
java.lang.Object
  extended by lumis.doui.source.field.BaseSourceField
All Implemented Interfaces:
ISourceField
Direct Known Subclasses:
BaseTabularSourceField

@StableMinor(version="5.5",
             sinceVersion="4.0")
public abstract class BaseSourceField
extends Object
implements ISourceField

The base implementation for a source field.

Since:
4.0.4

Field Summary
protected  IConverter converter
           
protected  ISourceFieldDataType dataType
           
protected  Object defaultValue
           
protected  Node definitionNode
           
protected  boolean display
           
protected  boolean doOptionLookup
           
protected  boolean externalData
           
protected  boolean getData
           
protected  String id
           
protected  boolean introduction
           
protected  boolean keywords
           
protected  boolean localize
           
protected  Object maximumValue
           
protected  Object minimumValue
           
protected  String name
           
protected  boolean parentId
           
protected  String pattern
           
protected  boolean primaryName
           
protected  boolean readOnly
           
protected  boolean required
           
protected  boolean requiredWhenVisible
           
protected  Source source
           
 
Constructor Summary
BaseSourceField()
           
 
Method Summary
protected  Object convertToFieldValueClass(Object value, Locale locale, String pattern)
          Converts the given object to the this field's value class.
protected  IConverter createConverter()
          Factory method that creates a converter instance for this field.
protected  ISourceFieldDataType createDataType()
          Factory method that creates a data type instance for this field.
 IConverter getConverter()
          Returns the default converter for this field's values.
 ISourceFieldDataType getDataType()
           
 Node getDefaultControlDefinition()
          Returns the default control definition to be used for this field.
 Node getDefaultInputControlDefinition()
          Returns the default input control definition to be used for editing this field's value.
 Object getDefaultValue()
           
 Node getDefaultViewControlDefinition()
          Returns the default control definition to be used for viewing this field's value.
 Node getDefinitionNode()
           
 String getId()
           
 Object getMaximumValue()
           
 Object getMinimumValue()
           
 String getName()
           
 Class<?> getValueClass()
          Returns the class this field's possible values are assignable to.
 void init(Source source, Node fieldNode)
          Initializes this source field.
 boolean isDisplay()
           
 boolean isExternalData()
           
 boolean isGetData()
           
 boolean isIntroduction()
           
 boolean isKeywords()
           
 boolean isLocalize()
           
 boolean isParentId()
           
 boolean isPrimaryName()
           
 boolean isReadOnly()
          Returns true if this field is read-only and should not be rendered editable.
 boolean isRequired()
           
 boolean isRequiredWhenVisible()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected Source source

definitionNode

protected Node definitionNode

id

protected String id

name

protected String name

primaryName

protected boolean primaryName

introduction

protected boolean introduction

keywords

protected boolean keywords

display

protected boolean display

externalData

protected boolean externalData

getData

protected boolean getData

required

protected boolean required

requiredWhenVisible

protected boolean requiredWhenVisible

parentId

protected boolean parentId

doOptionLookup

protected boolean doOptionLookup

readOnly

protected boolean readOnly

dataType

protected ISourceFieldDataType dataType

defaultValue

protected Object defaultValue

pattern

protected String pattern

converter

protected IConverter converter

minimumValue

protected Object minimumValue

maximumValue

protected Object maximumValue

localize

protected boolean localize
Constructor Detail

BaseSourceField

public BaseSourceField()
Method Detail

isIntroduction

public boolean isIntroduction()
Specified by:
isIntroduction in interface ISourceField

isKeywords

public boolean isKeywords()
Specified by:
isKeywords in interface ISourceField

getDataType

public ISourceFieldDataType getDataType()
Specified by:
getDataType in interface ISourceField

getId

public String getId()
Specified by:
getId in interface ISourceField

getName

public String getName()
Specified by:
getName in interface ISourceField

isDisplay

public boolean isDisplay()
Specified by:
isDisplay in interface ISourceField

isLocalize

public boolean isLocalize()

isPrimaryName

public boolean isPrimaryName()
Specified by:
isPrimaryName in interface ISourceField

isExternalData

public boolean isExternalData()
Specified by:
isExternalData in interface ISourceField

isGetData

public boolean isGetData()
Specified by:
isGetData in interface ISourceField

isRequired

public boolean isRequired()
Specified by:
isRequired in interface ISourceField

isRequiredWhenVisible

public boolean isRequiredWhenVisible()
Specified by:
isRequiredWhenVisible in interface ISourceField

isParentId

public boolean isParentId()
Specified by:
isParentId in interface ISourceField

isReadOnly

public boolean isReadOnly()
Description copied from interface: ISourceField
Returns true if this field is read-only and should not be rendered editable.

Specified by:
isReadOnly in interface ISourceField
Returns:
true if this field is read-only, false otherwise.

getDefaultValue

public Object getDefaultValue()
Specified by:
getDefaultValue in interface ISourceField

getDefinitionNode

public Node getDefinitionNode()
Specified by:
getDefinitionNode in interface ISourceField
Returns:
the field's definition node.

getMinimumValue

public Object getMinimumValue()
Specified by:
getMinimumValue in interface ISourceField

getMaximumValue

public Object getMaximumValue()
Specified by:
getMaximumValue in interface ISourceField

init

public void init(Source source,
                 Node fieldNode)
          throws PortalException
Description copied from interface: ISourceField
Initializes this source field. This method is called by the source after the field is created and before it is used. The implementation of this method must initialize all of this instance's attributes.

Specified by:
init in interface ISourceField
Parameters:
source - the source this field will belong to.
fieldNode - the xml node that contains this field's definition.
Throws:
PortalException - if this field could not be initialized.

createDataType

protected ISourceFieldDataType createDataType()
                                       throws PortalException
Factory method that creates a data type instance for this field. This method is called during init(Source, Node).

Returns:
the data type instance created.
Throws:
PortalException
Since:
4.0.4

createConverter

protected IConverter createConverter()
                              throws PortalException
Factory method that creates a converter instance for this field. This method is called during init(Source, Node).

Returns:
the converter instance created.
Throws:
PortalException
Since:
4.0.4

getConverter

public IConverter getConverter()
Description copied from interface: ISourceField
Returns the default converter for this field's values.

Specified by:
getConverter in interface ISourceField
Returns:
the default converter for this field's values.

convertToFieldValueClass

protected Object convertToFieldValueClass(Object value,
                                          Locale locale,
                                          String pattern)
                                   throws PortalException
Converts the given object to the this field's value class.

Parameters:
value - the object to be converted.
locale - the locale to be used in conversion.
pattern - the pattern to be used in conversion.
Returns:
the converted value.
Throws:
PortalException
Since:
4.0.10
See Also:
#getValueClass()}

getValueClass

public Class<?> getValueClass()
Returns the class this field's possible values are assignable to.

This base implemetation defaults to this field's data type value class.

Specified by:
getValueClass in interface ISourceField
Returns:
the class this field's possible values are assignable to.
Since:
4.0.4
See Also:
IDouiDataType.getValueClass()

getDefaultControlDefinition

public Node getDefaultControlDefinition()
                                 throws PortalException
Description copied from interface: ISourceField
Returns the default control definition to be used for this field.

Specified by:
getDefaultControlDefinition in interface ISourceField
Returns:
the control definition node.
Throws:
PortalException
See Also:
ISourceField.getDefaultInputControlDefinition(), ISourceField.getDefaultViewControlDefinition()

getDefaultInputControlDefinition

public Node getDefaultInputControlDefinition()
                                      throws PortalException
Description copied from interface: ISourceField
Returns the default input control definition to be used for editing this field's value.

Specified by:
getDefaultInputControlDefinition in interface ISourceField
Returns:
the control definition node.
Throws:
PortalException
See Also:
ISourceField.getDefaultControlDefinition(), ISourceField.getDefaultViewControlDefinition()

getDefaultViewControlDefinition

public Node getDefaultViewControlDefinition()
                                     throws PortalException
Description copied from interface: ISourceField
Returns the default control definition to be used for viewing this field's value.

Specified by:
getDefaultViewControlDefinition in interface ISourceField
Returns:
the control definition node.
Throws:
PortalException
See Also:
ISourceField.getDefaultInputControlDefinition(), ISourceField.getDefaultControlDefinition()


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.