org.outerj.xreporter.datatype.type
Class AbstractDateTimeType

java.lang.Object
  extended byorg.outerj.xreporter.datatype.type.Type
      extended byorg.outerj.xreporter.datatype.type.AbstractDateTimeType
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable
Direct Known Subclasses:
DateTimeType, DateType, TimeType

public abstract class AbstractDateTimeType
extends Type

An abstract base class for date, time and date-time types.

It supports configurable, locale-specific, patterns for parsing and formatting. The implementation uses the IBM ICU4J library classes.


Field Summary
protected static org.outerj.xreporter.datatype.type.OperatorSupport operatorSupport
           
 
Fields inherited from class org.outerj.xreporter.datatype.type.Type
expressionManager, formattingPatterns, validationRules
 
Constructor Summary
AbstractDateTimeType()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 java.lang.Object convert(java.lang.Object object)
           
 java.lang.String format(java.lang.Object value, ResourceHandle resourceHandle, FormatCache formatCache)
          See DataType.format
 java.lang.String formatRaw(java.lang.Object value)
          Format a value as simple as possible.
 java.util.List getAllowedOperators()
          Returns a list of Operators supported by this datatype.
protected abstract  DateFormat getDateFormat(java.util.Locale locale)
          Returns an appropriate default DateFormat (usually the SHORT variant).
 Operator getOperatorById(java.lang.String id)
           
protected abstract  java.lang.String getParseErrorResourceKey()
          Returns the resource key for the validation error message in case the input string was not parseable.
 java.lang.Object parseRawValue(java.lang.String value)
          Parses a value that was serialized using formatRaw(java.lang.Object).
 ValidationResult validate(java.lang.String value, ExecutionContext executionContext)
          See DataType.validate
 ValidationResult validate(java.lang.String value, ExecutionContext executionContext, boolean rawLocale)
           
 
Methods inherited from class org.outerj.xreporter.datatype.type.Type
addExpressionValidationRule, addValidationRule, bind, compose, configureFormattingPatterns, fetch, getName, validateValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operatorSupport

protected static org.outerj.xreporter.datatype.type.OperatorSupport operatorSupport
Constructor Detail

AbstractDateTimeType

public AbstractDateTimeType()
Method Detail

getDateFormat

protected abstract DateFormat getDateFormat(java.util.Locale locale)
Returns an appropriate default DateFormat (usually the SHORT variant).


getParseErrorResourceKey

protected abstract java.lang.String getParseErrorResourceKey()
Returns the resource key for the validation error message in case the input string was not parseable.


configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

getAllowedOperators

public java.util.List getAllowedOperators()
Description copied from class: Type
Returns a list of Operators supported by this datatype.

Specified by:
getAllowedOperators in class Type

validate

public ValidationResult validate(java.lang.String value,
                                 ExecutionContext executionContext,
                                 boolean rawLocale)
Specified by:
validate in class Type

validate

public ValidationResult validate(java.lang.String value,
                                 ExecutionContext executionContext)
Description copied from class: Type
See DataType.validate

Specified by:
validate in class Type

format

public java.lang.String format(java.lang.Object value,
                               ResourceHandle resourceHandle,
                               FormatCache formatCache)
Description copied from class: Type
See DataType.format

Specified by:
format in class Type

formatRaw

public java.lang.String formatRaw(java.lang.Object value)
Description copied from class: Type
Format a value as simple as possible.

Specified by:
formatRaw in class Type

getOperatorById

public Operator getOperatorById(java.lang.String id)
Specified by:
getOperatorById in class Type

convert

public java.lang.Object convert(java.lang.Object object)
                         throws UnconvertibleException
Specified by:
convert in class Type
Throws:
UnconvertibleException

parseRawValue

public java.lang.Object parseRawValue(java.lang.String value)
                               throws java.text.ParseException
Description copied from class: Type
Parses a value that was serialized using Type.formatRaw(java.lang.Object).

Specified by:
parseRawValue in class Type
Throws:
java.text.ParseException