org.mmbase.datatypes.util.xml
Class DataTypeDefinition

java.lang.Object
  extended by org.mmbase.datatypes.util.xml.DataTypeDefinition

public class DataTypeDefinition
extends Object

This utility class contains methods to instantiate the right DataType instance. It is used by DataTypeReader. XXX MM: This class does the actual datatype reading, so more correctly this one would be called DatatypeReader?

Since:
MMBase-1.8
Version:
$Id: DataTypeDefinition.java 42557 2010-06-15 09:18:45Z michiel $
Author:
Pierre van Rooden, Michiel Meeuwissen

Field Summary
protected  DataTypeCollector collector
          The data type collector that contains the data datatype with this definition.
 BasicDataType<?> dataType
          The data type which will be produced
 
Constructor Summary
DataTypeDefinition(DataTypeCollector collector)
          Constructor.
 
Method Summary
protected  void addCommitProcessor(Element processorElement)
           
protected  boolean addComparableCondition(Element conditionElement)
          Considers the condition elements associated with 'Comparables' (minInclusive, maxInclusive, minExclusive, maxExclusive).
protected  boolean addCondition(Element childElement)
          Uses one subelement of a datatype xml configuration element and interpret it.
protected  boolean addDecimalCondition(Element conditionElement)
           
protected  void addDefaultProcessor(Element processorElement)
           
protected  void addDeleteProcessor(Element processorElement)
           
protected  void addEnumeration(Element enumerationElement)
          Used the enumeration element.
protected  boolean addLengthDataCondition(Element conditionElement)
          Considers length related condition elements ('minLength', 'maxLength' , 'length')
protected  boolean addPasswordProperty(Element propertyElement)
           
protected  boolean addPatternCondition(Element conditionElement)
          Considers the 'pattern' condition element.
protected  void addProcessor(int action, Element processorElement, Collection<Integer> unsetTypes)
           
(package private)  DataTypeDefinition configure(Element dataTypeElement, BasicDataType<?> requestBaseDataType)
          Configures the data type definition, using data from a DOM element
protected  void configureConditions(Element dataTypeElement)
          Configures the conditions of a datatype definition, using data from a DOM element
protected  void configureHandlers(Element dataTypeElement)
           
protected  void configureProcessors(Element dataTypeElement)
           
protected  void configureStyleClasses(Element dataTypeElement)
           
protected  boolean setProperty(Element element)
           
protected  void setRestrictionData(DataType.Restriction restriction, Element element)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataType

public BasicDataType<?> dataType
The data type which will be produced


collector

protected final DataTypeCollector collector
The data type collector that contains the data datatype with this definition.

Constructor Detail

DataTypeDefinition

public DataTypeDefinition(DataTypeCollector collector)
Constructor.

Method Detail

configure

DataTypeDefinition configure(Element dataTypeElement,
                             BasicDataType<?> requestBaseDataType)
                       throws DependencyException
Configures the data type definition, using data from a DOM element

Throws:
DependencyException

configureConditions

protected void configureConditions(Element dataTypeElement)
Configures the conditions of a datatype definition, using data from a DOM element


configureHandlers

protected void configureHandlers(Element dataTypeElement)
Since:
MMBase-1.9

configureStyleClasses

protected void configureStyleClasses(Element dataTypeElement)
Since:
MMBase-1.9.1

configureProcessors

protected void configureProcessors(Element dataTypeElement)
Since:
MMBase-1.9.2

addCondition

protected boolean addCondition(Element childElement)
Uses one subelement of a datatype xml configuration element and interpret it. Possibly this method is a good candidate to override.

Returns:
whether successfully read the element.

addProcessor

protected void addProcessor(int action,
                            Element processorElement,
                            Collection<Integer> unsetTypes)

addCommitProcessor

protected void addCommitProcessor(Element processorElement)

addDeleteProcessor

protected void addDeleteProcessor(Element processorElement)

addDefaultProcessor

protected void addDefaultProcessor(Element processorElement)

setRestrictionData

protected void setRestrictionData(DataType.Restriction restriction,
                                  Element element)

addEnumeration

protected void addEnumeration(Element enumerationElement)
Used the enumeration element.


setProperty

protected boolean setProperty(Element element)

addLengthDataCondition

protected boolean addLengthDataCondition(Element conditionElement)
Considers length related condition elements ('minLength', 'maxLength' , 'length')

Returns:
true if element was used

addDecimalCondition

protected boolean addDecimalCondition(Element conditionElement)
Since:
MMBase-1.9.1

addPasswordProperty

protected boolean addPasswordProperty(Element propertyElement)

addPatternCondition

protected boolean addPatternCondition(Element conditionElement)
Considers the 'pattern' condition element.

Returns:
true if element was used

addComparableCondition

protected boolean addComparableCondition(Element conditionElement)
Considers the condition elements associated with 'Comparables' (minInclusive, maxInclusive, minExclusive, maxExclusive).

Returns:
true if element was used

toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null