|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.outerj.xreporter.datatype.DataTypeImpl
Implementation of DataType. This class should not be instantiated immediately, use the
DataTypeManagerImpl
to retrieve and create object of this class. Functionality
specific to a certain base type (string, long, date, ...) is delegated to an implementation
of Type
.
Field Summary | |
protected static java.lang.String |
ARGCOUNT_ATTR
|
protected static java.lang.String |
BASE_ATTR
|
protected org.apache.avalon.framework.component.ComponentManager |
componentManager
|
protected static java.lang.String |
DATATYPE_EL
|
protected static java.lang.String |
DESCRIPTION_ATTR
|
protected Expression |
expressionForDefault
|
protected java.lang.String |
id
|
protected static java.lang.String |
ID_ATTR
|
protected java.lang.String |
info
|
protected static java.lang.String |
OPERATOR_EL
|
protected static java.lang.String |
OPERATORS_EL
|
protected DataTypeImpl |
parentDataType
|
protected java.lang.String |
prompt
|
protected static java.lang.String |
PROMPT_EL
|
protected SearchlistDefinition |
searchlist
|
protected java.lang.String |
title
|
protected static java.lang.String |
TITLE_EL
|
protected static java.lang.String |
TYPE_EL
|
protected Type |
typeDelegate
|
Constructor Summary | |
protected |
DataTypeImpl()
|
protected |
DataTypeImpl(DataTypeImpl parentDataType)
|
Method Summary | |
void |
bind(java.sql.PreparedStatement statement,
int pos,
java.lang.Object value)
Bind a value of this type to a JDBC PreparedStatement at the given position. |
void |
compose(org.apache.avalon.framework.component.ComponentManager componentManager)
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
java.lang.Object |
convert(java.lang.Object object)
Checks that the given object is of the kind that this Type expects. |
java.lang.Object |
fetch(java.sql.ResultSet resultSet,
java.lang.String fieldName)
Gets a value from a ResultSet using the appropriate methods according to the data type. |
java.lang.String |
format(java.lang.Object value,
ResourceHandle resourceHandle,
FormatCache formatCache)
Creates a string representation of the value, based on the locale. |
java.lang.String |
formatRaw(java.lang.Object value)
Formats the value using US Locale rules. |
void |
generateInputInfoSaxFragment(org.xml.sax.ContentHandler contentHandler,
ExecutionContext executionContext,
ResourceHandle resourceHandle)
Generates a piece of SAX representing this data type. |
void |
generateOutputInfoSaxFragment(org.xml.sax.ContentHandler contentHandler,
ResourceHandle resourceHandle)
Generates a piece of SAX containing certain information about the datatype. |
java.lang.String |
getDefaultValue(ExecutionContext executionContext,
ResourceHandle resourceHandle)
Determines the default value for this data type. |
Operator |
getOperatorById(java.lang.String id)
Retrieves the operator with the specified id. |
java.lang.String |
getPrompt(Resources dataTypeUserBundle)
|
protected SearchlistDefinition |
getSearchListDefinition()
|
java.lang.String |
getTitle(ResourceHandle resourceHandle)
|
protected java.lang.String |
getTitle(Resources dataTypeUserBundle)
|
java.lang.String |
getTypeName()
Returns a name identifying the underlying built-in type. |
ValidationResult |
validate(java.lang.String value,
ExecutionContext executionContext)
Same as validate(value, executionContext, false); |
ValidationResult |
validate(java.lang.String value,
ExecutionContext executionContext,
boolean rawLocale)
Validates the given value. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String id
protected java.lang.String prompt
protected java.lang.String title
protected java.lang.String info
protected Expression expressionForDefault
protected Type typeDelegate
protected DataTypeImpl parentDataType
protected SearchlistDefinition searchlist
protected org.apache.avalon.framework.component.ComponentManager componentManager
protected static final java.lang.String DATATYPE_EL
protected static final java.lang.String PROMPT_EL
protected static final java.lang.String TITLE_EL
protected static final java.lang.String OPERATORS_EL
protected static final java.lang.String OPERATOR_EL
protected static final java.lang.String ID_ATTR
protected static final java.lang.String DESCRIPTION_ATTR
protected static final java.lang.String ARGCOUNT_ATTR
protected static final java.lang.String TYPE_EL
protected static final java.lang.String BASE_ATTR
Constructor Detail |
protected DataTypeImpl()
protected DataTypeImpl(DataTypeImpl parentDataType)
parentDataType
- can be nullMethod Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager componentManager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
org.apache.avalon.framework.component.ComponentException
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
public ValidationResult validate(java.lang.String value, ExecutionContext executionContext)
DataType
validate
in interface DataType
public ValidationResult validate(java.lang.String value, ExecutionContext executionContext, boolean rawLocale)
DataType
validate
in interface DataType
rawLocale
- ignore the user locale for parsing values and use the built-in default localepublic java.lang.String getTitle(ResourceHandle resourceHandle)
getTitle
in interface DataType
protected java.lang.String getTitle(Resources dataTypeUserBundle)
public java.lang.String getPrompt(Resources dataTypeUserBundle)
public void generateInputInfoSaxFragment(org.xml.sax.ContentHandler contentHandler, ExecutionContext executionContext, ResourceHandle resourceHandle) throws java.lang.Exception
DataType
The generated output will contain everything about the datatype, includes selection lists etc, thus
everything needed for inputing values of this datatype. If you only need some output metadata, use
DataType.generateOutputInfoSaxFragment(org.xml.sax.ContentHandler, org.outerj.xreporter.resource.ResourceHandle)
.
generateInputInfoSaxFragment
in interface DataType
java.lang.Exception
protected SearchlistDefinition getSearchListDefinition()
public java.lang.String getDefaultValue(ExecutionContext executionContext, ResourceHandle resourceHandle)
DataType
getDefaultValue
in interface DataType
public void generateOutputInfoSaxFragment(org.xml.sax.ContentHandler contentHandler, ResourceHandle resourceHandle) throws org.xml.sax.SAXException
DataType
DataType.generateInputInfoSaxFragment(org.xml.sax.ContentHandler, org.outerj.xreporter.report.definition.ExecutionContext, org.outerj.xreporter.resource.ResourceHandle)
generateOutputInfoSaxFragment
in interface DataType
org.xml.sax.SAXException
public Operator getOperatorById(java.lang.String id)
DataType
getOperatorById
in interface DataType
public java.lang.String format(java.lang.Object value, ResourceHandle resourceHandle, FormatCache formatCache)
DataType
format
in interface DataType
formatCache
- optional parameter, can be null. See FormatCache
for more info.public java.lang.String formatRaw(java.lang.Object value)
DataType
formatRaw
in interface DataType
public void bind(java.sql.PreparedStatement statement, int pos, java.lang.Object value) throws java.sql.SQLException
DataType
bind
in interface DataType
value
- an object of the correct type, depending on the base type of this data type.
java.sql.SQLException
public java.lang.Object fetch(java.sql.ResultSet resultSet, java.lang.String fieldName) throws java.sql.SQLException
DataType
ResultSet
using the appropriate methods according to the data type.
fetch
in interface DataType
java.sql.SQLException
public java.lang.Object convert(java.lang.Object object) throws UnconvertibleException
DataType
convert
in interface DataType
UnconvertibleException
public java.lang.String getTypeName()
DataType
getTypeName
in interface DataType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |