public interface DatatypeConverterInterface
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 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.
DatatypeConverter
,
ParseConversionEvent
,
PrintConversionEvent
Modifier and Type | Method and Description |
---|---|
String |
parseAnySimpleType(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 primitive
boolean value. |
byte |
parseByte(String pLexicalXSDByte)
Parses the lexical representation of the given 8 bit integer value and converts it into a
primitive
byte value. |
Calendar |
parseDate(String pLexicalXSDDate)
Parses the lexical representation of the given date value and converts it into an instance of
Calendar . |
Calendar |
parseDateTime(String pLexicalXSDDateTime)
Parses the lexical representation of the given dateTime value and converts it into an
instance of
Calendar . |
BigDecimal |
parseDecimal(String pLexicalXSDDecimal)
Parses the lexical representation of the given decimal value (arbitrary precision) and
converts it into an instance of
BigDecimal . |
double |
parseDouble(String pLexicalXSDDouble)
Parses the lexical representation of the given 64 bit floating point value and converts it
into a primitive
double value. |
float |
parseFloat(String pLexicalXSDFloat)
Parses the lexical representation of the given 32 bit floating point value and converts it
into a primitive
float value. |
byte[] |
parseHexBinary(String pLexicalXSDHexBinary)
Parses the lexical representation of the given byte array, which is encoded in hex digits.
|
int |
parseInt(String pLexicalXSDInt)
Parses the lexical representation of the given 32 bit integer value and converts it into a
primitive
int value. |
BigInteger |
parseInteger(String pLexicalXSDInteger)
Parses the lexical representation of the given integer value (arbitrary precision) and
converts it into an instance of
BigInteger . |
long |
parseLong(String pLexicalXSDLong)
Parses the lexical representation of the given 64 bit integer value and converts it into a
primitive
long value. |
QName |
parseQName(String pLexicalXSDQName,
NamespaceContext pNamespaceContext)
Parses the lexical representation of the given qualified name and converts it into an
instance of
QName . |
short |
parseShort(String pLexicalXSDShort)
Parses the lexical representation of the given 16 bit integer value and converts it into a
primitive
short value. |
String |
parseString(String pLexicalXSDString)
Parses the lexical representation and converts it into a String.
|
Calendar |
parseTime(String pLexicalXSDTime)
Parses the lexical representation of the given time value and converts it into an instance of
Calendar . |
long |
parseUnsignedInt(String pLexicalXSDUnsignedInt)
Parses the lexical representation of the given 32 bit unsignet integer value and converts it
into a primitive
long value. |
int |
parseUnsignedShort(String pLexicalXSDUnsignedShort)
Parses the lexical representation of the given 16 bit unsignet integer value and converts it
into a primitive
int value. |
String |
printAnySimpleType(String pValue)
Returns a lexical representation of the given input string, which is the unmodified input
string.
|
String |
printBase64Binary(byte[] pValue)
Returns a lexical representation of the given byte array.
|
String |
printBoolean(boolean pValue)
Returns a lexical representation of the given primitive boolean value.
|
String |
printByte(byte pValue)
Returns a lexical representation of the given primitive 8 bit integer.
|
String |
printDate(Calendar pValue)
Returns a lexical representation of the given date value.
|
String |
printDateTime(Calendar pValue)
Returns a lexical representation of the given dateTime value.
|
String |
printDecimal(BigDecimal pValue)
Returns a lexical representation of the given instance of
BigDecimal , which is a
decimal number in arbitrary precision. |
String |
printDouble(double pValue)
Returns a lexical representation of the given primitive 64 bit floating point number.
|
String |
printFloat(float pValue)
Returns a lexical representation of the given primitive 32 bit floating point number.
|
String |
printHexBinary(byte[] pValue)
Returns a lexical representation of the given byte array.
|
String |
printInt(int pValue)
Returns a lexical representation of the given primitive 32 bit integer.
|
String |
printInteger(BigInteger pValue)
Returns a lexical representation of the given instance of
BigInteger , which is an
integer in arbitrary precision. |
String |
printLong(long pValue)
Returns a lexical representation of the given primitive 64 bit integer.
|
String |
printQName(QName pValue,
NamespaceContext pNamespaceContext)
Returns a lexical representation of the given qualified name, which is a combination of
namespace URI and local name.
|
String |
printShort(short pValue)
Returns a lexical representation of the given primitive 16 bit integer.
|
String |
printString(String pValue)
Returns a lexical representation of the given input string, which is the unmodified input
string.
|
String |
printTime(Calendar pValue)
Returns a lexical representation of the given time value.
|
String |
printUnsignedInt(long pValue)
Returns a lexical representation of the given primitive, unsigned 32 bit integer.
|
String |
printUnsignedShort(int pValue)
Returns a lexical representation of the given primitive, unsigned 16 bit integer.
|
String parseString(String pLexicalXSDString)
pLexicalXSDString
- The input string being parsed.ParseConversionEvent
BigInteger parseInteger(String pLexicalXSDInteger)
BigInteger
.pLexicalXSDInteger
- The input string being parsed.BigInteger
.ParseConversionEvent
int parseInt(String pLexicalXSDInt)
int
value.pLexicalXSDInt
- The input string being parsed.int
.ParseConversionEvent
long parseLong(String pLexicalXSDLong)
long
value.pLexicalXSDLong
- The input string being parsed.long
.ParseConversionEvent
short parseShort(String pLexicalXSDShort)
short
value.pLexicalXSDShort
- The input string being parsed.short
.ParseConversionEvent
BigDecimal parseDecimal(String pLexicalXSDDecimal)
BigDecimal
.pLexicalXSDDecimal
- The input string being parsed.BigDecimal
.ParseConversionEvent
float parseFloat(String pLexicalXSDFloat)
float
value.pLexicalXSDFloat
- The input string being parsed.float
.ParseConversionEvent
double parseDouble(String pLexicalXSDDouble)
double
value.pLexicalXSDDouble
- The input string being parsed.double
.ParseConversionEvent
boolean parseBoolean(String pLexicalXSDBoolean)
boolean
value.pLexicalXSDBoolean
- The input string being parsed.boolean
.ParseConversionEvent
byte parseByte(String pLexicalXSDByte)
byte
value.pLexicalXSDByte
- The input string being parsed.byte
.ParseConversionEvent
QName parseQName(String pLexicalXSDQName, NamespaceContext pNamespaceContext)
QName
. The QName
consists
of a namespace URI and a local name.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.QName
.ParseConversionEvent
Calendar parseDateTime(String pLexicalXSDDateTime)
Calendar
. Valid lexical representations of a dateTime value
include
YYYY-MM-DDThh:mm:ss YYYY-MM-DDThh:mm:ss.sss YYYY-MM-DDThh:mm:ssZ YYYY-MM-DDThh:mm:ss-01:00The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
pLexicalXSDDateTime
- The input string being parsed.Calendar
.ParseConversionEvent
byte[] parseBase64Binary(String pLexicalXSDBase64Binary)
pLexicalXSDBase64Binary
- The input string being parsed, a base 64 encoded array of
bytes.ParseConversionEvent
byte[] parseHexBinary(String pLexicalXSDHexBinary)
pLexicalXSDHexBinary
- The input string being parsed, an array of bytes encoded in hex
digits.ParseConversionEvent
long parseUnsignedInt(String pLexicalXSDUnsignedInt)
long
value.pLexicalXSDUnsignedInt
- The input string being parsed.long
.ParseConversionEvent
int parseUnsignedShort(String pLexicalXSDUnsignedShort)
int
value.pLexicalXSDUnsignedShort
- The input string being parsed.int
.ParseConversionEvent
Calendar parseTime(String pLexicalXSDTime)
Calendar
. Valid lexical representations of a time value include
hh:mm:ss hh:mm:ss.sss hh:mm:ssZ hh:mm:ss-01:00The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
pLexicalXSDTime
- The input string being parsed.Calendar
.ParseConversionEvent
Calendar parseDate(String pLexicalXSDDate)
Calendar
. Valid lexical representations of a date value include
YYYY-MM-DD YYYY-MM-DDZ YYYY-MM-DD-01:00The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
pLexicalXSDDate
- The input string being parsed.Calendar
.ParseConversionEvent
String parseAnySimpleType(String pLexicalXSDAnySimpleType)
pLexicalXSDAnySimpleType
- An input string in lexical representation.ParseConversionEvent
String printString(String pValue)
pValue
- The input string.PrintConversionEvent
String printInteger(BigInteger pValue)
BigInteger
, which is an
integer in arbitrary precision.pValue
- The integer value being converted.PrintConversionEvent
String printInt(int pValue)
pValue
- The int
value being converted.PrintConversionEvent
String printLong(long pValue)
pValue
- The long
value being converted.PrintConversionEvent
String printShort(short pValue)
pValue
- The short
value being converted.PrintConversionEvent
String printDecimal(BigDecimal pValue)
BigDecimal
, which is a
decimal number in arbitrary precision.pValue
- The decimal value being converted.PrintConversionEvent
String printFloat(float pValue)
pValue
- The float
value being converted.PrintConversionEvent
String printDouble(double pValue)
pValue
- The double
value being converted.PrintConversionEvent
String printBoolean(boolean pValue)
pValue
- The boolean
value being converted.PrintConversionEvent
String printByte(byte pValue)
pValue
- The byte
value being converted.PrintConversionEvent
String printQName(QName pValue, NamespaceContext pNamespaceContext)
pValue
- The qualified name being converted.pNamespaceContext
- A mapping of prefixes to namespace URI's which may be used to
determine a valid prefix.PrintConversionEvent
String printDateTime(Calendar pValue)
YYYY-MM-DDThh:mm:ss YYYY-MM-DDThh:mm:ss.sss YYYY-MM-DDThh:mm:ssZ YYYY-MM-DDThh:mm:ss-01:00The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
pValue
- The dateTime value being convertedPrintConversionEvent
String printBase64Binary(byte[] pValue)
pValue
- The byte array being converted.PrintConversionEvent
String printHexBinary(byte[] pValue)
pValue
- The byte array being converted.PrintConversionEvent
String printUnsignedInt(long pValue)
pValue
- The long
value being converted.PrintConversionEvent
String printUnsignedShort(int pValue)
pValue
- The short
value being converted.PrintConversionEvent
String printTime(Calendar pValue)
hh:mm:ss hh:mm:ss.sss hh:mm:ssZ hh:mm:ss-01:00The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
pValue
- The time value being convertedPrintConversionEvent
String printDate(Calendar pValue)
YYYY-MM-DD YYYY-MM-DDZ YYYY-MM-DD-01:00The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
pValue
- The date value being convertedPrintConversionEvent
String printAnySimpleType(String pValue)
pValue
- The input string.PrintConversionEvent
Copyright © 1996–2023 Geotools. All rights reserved.