org.teiid.query.processor.xml
Class XMLValueTranslator
java.lang.Object
org.teiid.query.processor.xml.XMLValueTranslator
public final class XMLValueTranslator
- extends java.lang.Object
This class will make a minimal effort to output xsd formatted values for a given
built-in type. It will not attempt to narrow or otherwise fit most values into
their output space (months can be greater than 12, nonNegative numbers can be
negative, etc.)
|
Field Summary |
static java.lang.String |
DATETIME
|
static java.lang.String |
DOUBLE
|
static java.lang.String |
FLOAT
|
static java.lang.String |
GDAY
|
static java.lang.String |
GMONTH
|
static java.lang.String |
GMONTHDAY
|
static java.lang.String |
GYEAR
|
static java.lang.String |
GYEARMONTH
|
static java.lang.String |
STRING
|
|
Method Summary |
static java.lang.String |
translateToXMLValue(java.lang.Object value,
java.lang.Class<?> runtimeType,
java.lang.String builtInType)
Translate the value object coming from the mapping class into the string that will be
placed in the XML document for a tag. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATETIME
public static final java.lang.String DATETIME
- See Also:
- Constant Field Values
DOUBLE
public static final java.lang.String DOUBLE
- See Also:
- Constant Field Values
FLOAT
public static final java.lang.String FLOAT
- See Also:
- Constant Field Values
GDAY
public static final java.lang.String GDAY
- See Also:
- Constant Field Values
GMONTH
public static final java.lang.String GMONTH
- See Also:
- Constant Field Values
GMONTHDAY
public static final java.lang.String GMONTHDAY
- See Also:
- Constant Field Values
GYEAR
public static final java.lang.String GYEAR
- See Also:
- Constant Field Values
GYEARMONTH
public static final java.lang.String GYEARMONTH
- See Also:
- Constant Field Values
STRING
public static final java.lang.String STRING
- See Also:
- Constant Field Values
XMLValueTranslator
public XMLValueTranslator()
translateToXMLValue
public static java.lang.String translateToXMLValue(java.lang.Object value,
java.lang.Class<?> runtimeType,
java.lang.String builtInType)
throws FunctionExecutionException,
TransformationException
- Translate the value object coming from the mapping class into the string that will be
placed in the XML document for a tag. Usually, the value.toString() method is just called
to translate to a string. In some special cases, the runtimeType and builtInType
will be used to determine a custom translation to string where the Java object toString()
does not comply with the XML Schema spec.
NOTE: date objects are not checked for years less than 1
- Parameters:
value - The valueruntimeType - The runtime typebuiltInType - The design-time atomic built-in type (or null if none)
- Returns:
- String representing the value
- Throws:
FunctionExecutionException
TransformationException- Since:
- 5.0
Copyright © 2010. All Rights Reserved.