org.outerj.xreporter.datatype.type
Class BigDecimalType

java.lang.Object
  extended byorg.outerj.xreporter.datatype.type.Type
      extended byorg.outerj.xreporter.datatype.type.BigDecimalType
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable

public class BigDecimalType
extends Type

Implementation of Type supporting BigDecimals. Since the standard Java API's don't offer functionality to parse and format BigDecimal's, the ICU4J library from IBM is used.


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
BigDecimalType()
           
 
Method Summary
 void bind(java.sql.PreparedStatement statement, int pos, java.lang.Object value)
          Binds a value of this type to a PreparedStatement.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 java.lang.Object convert(java.lang.Object object)
           
 java.lang.Object fetch(java.sql.ResultSet resultSet, java.lang.String fieldName)
          See DataType.fetch
 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.
 java.lang.String getName()
          Returns a name that identifies this type
 Operator getOperatorById(java.lang.String id)
           
 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, compose, configureFormattingPatterns, 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

BigDecimalType

public BigDecimalType()
Method Detail

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

getOperatorById

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

bind

public void bind(java.sql.PreparedStatement statement,
                 int pos,
                 java.lang.Object value)
          throws java.sql.SQLException
Description copied from class: Type
Binds a value of this type to a PreparedStatement.

Specified by:
bind in class Type
Throws:
java.sql.SQLException

fetch

public java.lang.Object fetch(java.sql.ResultSet resultSet,
                              java.lang.String fieldName)
                       throws java.sql.SQLException
Description copied from class: Type
See DataType.fetch

Specified by:
fetch in class Type
Throws:
java.sql.SQLException

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

getName

public java.lang.String getName()
Description copied from class: Type
Returns a name that identifies this type

Specified by:
getName in class Type

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

convert

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