Package org.geotools.xml.impl
Interface DatatypeConverterInterface
- All Known Implementing Classes:
DatatypeConverterImpl
public interface DatatypeConverterInterface
The
DatatypeConverterInterface
is a helper class for implementation of custom
print()
and parse()
methods, as specified by jaxb:javaType/@printMethod and
jaxb:javaType/@parseMethod. However, the JAXB user won't be accessing this class directly. The JAXB
provider is required to create an instance of this class and pass it to the JAXB runtime by invoking
javax.xml.bind.DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
. The JAXB user may access
this instance via the static methods of DatatypeConverter
.
The interface provides methods parseFoo()
and printFoo()
for any XML Schema type
foo. The parseFoo()
method must accept any lexically valid value and convert it into the
corresponding canonical value. An error in the conversion routine must be mapped to a
ParseConversionEvent
.
The printFoo(foo pValue)
method must convert the value pValue into an arbitrary lexical
representation. It is recommended to use the default representation.
- Since:
- JAXB 1.0
- Author:
- JSR-31
- See Also:
-
DatatypeConverter
ParseConversionEvent
PrintConversionEvent
-
Method Summary
Modifier and TypeMethodDescriptionparseAnySimpleType
(String pLexicalXSDAnySimpleType) Returns the lexical representation of the input string, which is the unmodified input string.byte[]
parseBase64Binary
(String pLexicalXSDBase64Binary) Parses the lexical representation of the given byte array, which is encoded in base 64.boolean
parseBoolean
(String pLexicalXSDBoolean) Parses the lexical representation of the given boolean value and converts it into a primitiveboolean
value.byte
Parses the lexical representation of the given 8 bit integer value and converts it into a primitivebyte
value.Parses the lexical representation of the given date value and converts it into an instance ofCalendar
.parseDateTime
(String pLexicalXSDDateTime) Parses the lexical representation of the given dateTime value and converts it into an instance ofCalendar
.parseDecimal
(String pLexicalXSDDecimal) Parses the lexical representation of the given decimal value (arbitrary precision) and converts it into an instance ofBigDecimal
.double
parseDouble
(String pLexicalXSDDouble) Parses the lexical representation of the given 64 bit floating point value and converts it into a primitivedouble
value.float
parseFloat
(String pLexicalXSDFloat) Parses the lexical representation of the given 32 bit floating point value and converts it into a primitivefloat
value.byte[]
parseHexBinary
(String pLexicalXSDHexBinary) Parses the lexical representation of the given byte array, which is encoded in hex digits.int
Parses the lexical representation of the given 32 bit integer value and converts it into a primitiveint
value.parseInteger
(String pLexicalXSDInteger) Parses the lexical representation of the given integer value (arbitrary precision) and converts it into an instance ofBigInteger
.long
Parses the lexical representation of the given 64 bit integer value and converts it into a primitivelong
value.parseQName
(String pLexicalXSDQName, NamespaceContext pNamespaceContext) Parses the lexical representation of the given qualified name and converts it into an instance ofQName
.short
parseShort
(String pLexicalXSDShort) Parses the lexical representation of the given 16 bit integer value and converts it into a primitiveshort
value.parseString
(String pLexicalXSDString) Parses the lexical representation and converts it into a String.Parses the lexical representation of the given time value and converts it into an instance ofCalendar
.long
parseUnsignedInt
(String pLexicalXSDUnsignedInt) Parses the lexical representation of the given 32 bit unsignet integer value and converts it into a primitivelong
value.int
parseUnsignedShort
(String pLexicalXSDUnsignedShort) Parses the lexical representation of the given 16 bit unsignet integer value and converts it into a primitiveint
value.printAnySimpleType
(String pValue) Returns a lexical representation of the given input string, which is the unmodified input string.printBase64Binary
(byte[] pValue) Returns a lexical representation of the given byte array.printBoolean
(boolean pValue) Returns a lexical representation of the given primitive boolean value.printByte
(byte pValue) Returns a lexical representation of the given primitive 8 bit integer.Returns a lexical representation of the given date value.printDateTime
(Calendar pValue) Returns a lexical representation of the given dateTime value.printDecimal
(BigDecimal pValue) Returns a lexical representation of the given instance ofBigDecimal
, which is a decimal number in arbitrary precision.printDouble
(double pValue) Returns a lexical representation of the given primitive 64 bit floating point number.printFloat
(float pValue) Returns a lexical representation of the given primitive 32 bit floating point number.printHexBinary
(byte[] pValue) Returns a lexical representation of the given byte array.printInt
(int pValue) Returns a lexical representation of the given primitive 32 bit integer.printInteger
(BigInteger pValue) Returns a lexical representation of the given instance ofBigInteger
, which is an integer in arbitrary precision.printLong
(long pValue) Returns a lexical representation of the given primitive 64 bit integer.printQName
(QName pValue, NamespaceContext pNamespaceContext) Returns a lexical representation of the given qualified name, which is a combination of namespace URI and local name.printShort
(short pValue) Returns a lexical representation of the given primitive 16 bit integer.printString
(String pValue) Returns a lexical representation of the given input string, which is the unmodified input string.Returns a lexical representation of the given time value.printUnsignedInt
(long pValue) Returns a lexical representation of the given primitive, unsigned 32 bit integer.printUnsignedShort
(int pValue) Returns a lexical representation of the given primitive, unsigned 16 bit integer.
-
Method Details
-
parseString
Parses the lexical representation and converts it into a String.- Parameters:
pLexicalXSDString
- The input string being parsed.- Returns:
- The unmodified input string.
- See Also:
-
ParseConversionEvent
-
parseInteger
Parses the lexical representation of the given integer value (arbitrary precision) and converts it into an instance ofBigInteger
.- Parameters:
pLexicalXSDInteger
- The input string being parsed.- Returns:
- The input string converted into an instance of
BigInteger
. - See Also:
-
ParseConversionEvent
-
parseInt
Parses the lexical representation of the given 32 bit integer value and converts it into a primitiveint
value.- Parameters:
pLexicalXSDInt
- The input string being parsed.- Returns:
- The input string converted into a primitive
int
. - See Also:
-
ParseConversionEvent
-
parseLong
Parses the lexical representation of the given 64 bit integer value and converts it into a primitivelong
value.- Parameters:
pLexicalXSDLong
- The input string being parsed.- Returns:
- The input string converted into a primitive
long
. - See Also:
-
ParseConversionEvent
-
parseShort
Parses the lexical representation of the given 16 bit integer value and converts it into a primitiveshort
value.- Parameters:
pLexicalXSDShort
- The input string being parsed.- Returns:
- The input string converted into a primitive
short
. - See Also:
-
ParseConversionEvent
-
parseDecimal
Parses the lexical representation of the given decimal value (arbitrary precision) and converts it into an instance ofBigDecimal
.- Parameters:
pLexicalXSDDecimal
- The input string being parsed.- Returns:
- The input string converted into an instance of
BigDecimal
. - See Also:
-
ParseConversionEvent
-
parseFloat
Parses the lexical representation of the given 32 bit floating point value and converts it into a primitivefloat
value.- Parameters:
pLexicalXSDFloat
- The input string being parsed.- Returns:
- The input string converted into a primitive
float
. - See Also:
-
ParseConversionEvent
-
parseDouble
Parses the lexical representation of the given 64 bit floating point value and converts it into a primitivedouble
value.- Parameters:
pLexicalXSDDouble
- The input string being parsed.- Returns:
- The input string converted into a primitive
double
. - See Also:
-
ParseConversionEvent
-
parseBoolean
Parses the lexical representation of the given boolean value and converts it into a primitiveboolean
value.- Parameters:
pLexicalXSDBoolean
- The input string being parsed.- Returns:
- The input string converted into a primitive
boolean
. - See Also:
-
ParseConversionEvent
-
parseByte
Parses the lexical representation of the given 8 bit integer value and converts it into a primitivebyte
value.- Parameters:
pLexicalXSDByte
- The input string being parsed.- Returns:
- The input string converted into a primitive
byte
. - See Also:
-
ParseConversionEvent
-
parseQName
Parses the lexical representation of the given qualified name and converts it into an instance ofQName
. TheQName
consists of a namespace URI and a local name.- Parameters:
pLexicalXSDQName
- The input string being parsed, an optional namespace prefix, followed by the local name, if any. If a prefix is present, they are separated by a colon.pNamespaceContext
- The namespace context is used to query mappings between prefixes and namespace URI's.- Returns:
- The input string converted into an instance of
QName
. - See Also:
-
ParseConversionEvent
-
parseDateTime
Parses the lexical representation of the given dateTime value and converts it into an instance ofCalendar
. Valid lexical representations of a dateTime value includeYYYY-MM-DDThh:mm:ss YYYY-MM-DDThh:mm:ss.sss YYYY-MM-DDThh:mm:ssZ YYYY-MM-DDThh:mm:ss-01:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.- Parameters:
pLexicalXSDDateTime
- The input string being parsed.- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseBase64Binary
Parses the lexical representation of the given byte array, which is encoded in base 64.- Parameters:
pLexicalXSDBase64Binary
- The input string being parsed, a base 64 encoded array of bytes.- Returns:
- The decoded byte array.
- See Also:
-
ParseConversionEvent
-
parseHexBinary
Parses the lexical representation of the given byte array, which is encoded in hex digits.- Parameters:
pLexicalXSDHexBinary
- The input string being parsed, an array of bytes encoded in hex digits.- Returns:
- The decoded byte array.
- See Also:
-
ParseConversionEvent
-
parseUnsignedInt
Parses the lexical representation of the given 32 bit unsignet integer value and converts it into a primitivelong
value.- Parameters:
pLexicalXSDUnsignedInt
- The input string being parsed.- Returns:
- The input string converted into a primitive
long
. - See Also:
-
ParseConversionEvent
-
parseUnsignedShort
Parses the lexical representation of the given 16 bit unsignet integer value and converts it into a primitiveint
value.- Parameters:
pLexicalXSDUnsignedShort
- The input string being parsed.- Returns:
- The input string conve rted into a primitive
int
. - See Also:
-
ParseConversionEvent
-
parseTime
Parses the lexical representation of the given time value and converts it into an instance ofCalendar
. Valid lexical representations of a time value includehh:mm:ss hh:mm:ss.sss hh:mm:ssZ hh:mm:ss-01:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.- Parameters:
pLexicalXSDTime
- The input string being parsed.- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseDate
Parses the lexical representation of the given date value and converts it into an instance ofCalendar
. Valid lexical representations of a date value includeYYYY-MM-DD YYYY-MM-DDZ YYYY-MM-DD-01:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.- Parameters:
pLexicalXSDDate
- The input string being parsed.- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseAnySimpleType
Returns the lexical representation of the input string, which is the unmodified input string.- Parameters:
pLexicalXSDAnySimpleType
- An input string in lexical representation.- Returns:
- The unmodified input string.
- See Also:
-
ParseConversionEvent
-
printString
Returns a lexical representation of the given input string, which is the unmodified input string.- Parameters:
pValue
- The input string.- Returns:
- The unmodified input string.
- See Also:
-
PrintConversionEvent
-
printInteger
Returns a lexical representation of the given instance ofBigInteger
, which is an integer in arbitrary precision.- Parameters:
pValue
- The integer value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printInt
Returns a lexical representation of the given primitive 32 bit integer.- Parameters:
pValue
- Theint
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printLong
Returns a lexical representation of the given primitive 64 bit integer.- Parameters:
pValue
- Thelong
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printShort
Returns a lexical representation of the given primitive 16 bit integer.- Parameters:
pValue
- Theshort
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printDecimal
Returns a lexical representation of the given instance ofBigDecimal
, which is a decimal number in arbitrary precision.- Parameters:
pValue
- The decimal value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printFloat
Returns a lexical representation of the given primitive 32 bit floating point number.- Parameters:
pValue
- Thefloat
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printDouble
Returns a lexical representation of the given primitive 64 bit floating point number.- Parameters:
pValue
- Thedouble
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printBoolean
Returns a lexical representation of the given primitive boolean value.- Parameters:
pValue
- Theboolean
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printByte
Returns a lexical representation of the given primitive 8 bit integer.- Parameters:
pValue
- Thebyte
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printQName
Returns a lexical representation of the given qualified name, which is a combination of namespace URI and local name. The lexical representation is an optional prefix, which is currently mapped to namespace URI of the qualified name, followed by a colon and the local name. If the namespace URI is the current default namespace URI, then the prefix and the colon may be omitted.- Parameters:
pValue
- The qualified name being converted.pNamespaceContext
- A mapping of prefixes to namespace URI's which may be used to determine a valid prefix.- Returns:
- A lexical representation of the qualified name.
- See Also:
-
PrintConversionEvent
-
printDateTime
Returns a lexical representation of the given dateTime value. Valid lexical representations include:YYYY-MM-DDThh:mm:ss YYYY-MM-DDThh:mm:ss.sss YYYY-MM-DDThh:mm:ssZ YYYY-MM-DDThh:mm:ss-01:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.- Parameters:
pValue
- The dateTime value being converted- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printBase64Binary
Returns a lexical representation of the given byte array. The lexical representation is obtained by application of the base 64 encoding.- Parameters:
pValue
- The byte array being converted.- Returns:
- The converted byte array.
- See Also:
-
PrintConversionEvent
-
printHexBinary
Returns a lexical representation of the given byte array. The lexical representation is obtained by encoding any byte as two hex digits.- Parameters:
pValue
- The byte array being converted.- Returns:
- The converted byte array.
- See Also:
-
PrintConversionEvent
-
printUnsignedInt
Returns a lexical representation of the given primitive, unsigned 32 bit integer.- Parameters:
pValue
- Thelong
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printUnsignedShort
Returns a lexical representation of the given primitive, unsigned 16 bit integer.- Parameters:
pValue
- Theshort
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printTime
Returns a lexical representation of the given time value. Valid lexical representations include:hh:mm:ss hh:mm:ss.sss hh:mm:ssZ hh:mm:ss-01:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.- Parameters:
pValue
- The time value being converted- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printDate
Returns a lexical representation of the given date value. Valid lexical representations include:YYYY-MM-DD YYYY-MM-DDZ YYYY-MM-DD-01:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.- Parameters:
pValue
- The date value being converted- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printAnySimpleType
Returns a lexical representation of the given input string, which is the unmodified input string.- Parameters:
pValue
- The input string.- Returns:
- The unmodified input string.
- See Also:
-
PrintConversionEvent
-