Package org.geotools.xml.impl
Class DatatypeConverterImpl
Object
DatatypeConverterImpl
- All Implemented Interfaces:
DatatypeConverterInterface
- Author:
- Jochen Wiedmann
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DatatypeConverterImpl
parseAnySimpleType
(String arg0) Returns the lexical representation of the input string, which is the unmodified input string.byte[]
parseBase64Binary
(String arg0) Parses the lexical representation of the given byte array, which is encoded in base 64.boolean
parseBoolean
(String arg0) 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 arg0) Parses the lexical representation of the given dateTime value and converts it into an instance ofCalendar
.parseDateTime
(String arg0, boolean lenient) Parses the lexical representation of the given dateTime value and converts it into an instance ofCalendar
.parseDecimal
(String arg0) Parses the lexical representation of the given decimal value (arbitrary precision) and converts it into an instance ofBigDecimal
.double
parseDouble
(String arg0) Parses the lexical representation of the given 64 bit floating point value and converts it into a primitivedouble
value.parseDuration
(String pDuration) float
parseFloat
(String arg0) Parses the lexical representation of the given 32 bit floating point value and converts it into a primitivefloat
value.byte[]
parseHexBinary
(String arg0) 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 arg0) 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 arg0, NamespaceContext arg1) Parses the lexical representation of the given qualified name and converts it into an instance ofQName
.short
parseShort
(String arg0) Parses the lexical representation of the given 16 bit integer value and converts it into a primitiveshort
value.parseString
(String arg0) 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 arg0) Parses the lexical representation of the given 32 bit unsignet integer value and converts it into a primitivelong
value.int
parseUnsignedShort
(String arg0) Parses the lexical representation of the given 16 bit unsignet integer value and converts it into a primitiveint
value.printAnySimpleType
(String arg0) Returns a lexical representation of the given input string, which is the unmodified input string.printBase64Binary
(byte[] arg0) Returns a lexical representation of the given byte array.printBoolean
(boolean arg0) Returns a lexical representation of the given primitive boolean value.printByte
(byte arg0) Returns a lexical representation of the given primitive 8 bit integer.Returns a lexical representation of the given date value.printDateTime
(Calendar arg0) Returns a lexical representation of the given dateTime value.printDecimal
(BigDecimal arg0) Returns a lexical representation of the given instance ofBigDecimal
, which is a decimal number in arbitrary precision.printDouble
(double arg0) Returns a lexical representation of the given primitive 64 bit floating point number.printDuration
(Duration pDuration) printFloat
(float arg0) Returns a lexical representation of the given primitive 32 bit floating point number.printHexBinary
(byte[] arg0) Returns a lexical representation of the given byte array.printInt
(int arg0) Returns a lexical representation of the given primitive 32 bit integer.printInteger
(BigInteger arg0) Returns a lexical representation of the given instance ofBigInteger
, which is an integer in arbitrary precision.printLong
(long arg0) Returns a lexical representation of the given primitive 64 bit integer.printQName
(QName arg0, NamespaceContext arg1) Returns a lexical representation of the given qualified name, which is a combination of namespace URI and local name.printShort
(short arg0) Returns a lexical representation of the given primitive 16 bit integer.printString
(String arg0) 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 arg0) Returns a lexical representation of the given primitive, unsigned 32 bit integer.printUnsignedShort
(int arg0) Returns a lexical representation of the given primitive, unsigned 16 bit integer.
-
Constructor Details
-
DatatypeConverterImpl
public DatatypeConverterImpl()
-
-
Method Details
-
getInstance
-
parseString
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation and converts it into a String.- Specified by:
parseString
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The unmodified input string.
- See Also:
-
ParseConversionEvent
-
parseInteger
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given integer value (arbitrary precision) and converts it into an instance ofBigInteger
.- Specified by:
parseInteger
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into an instance of
BigInteger
. - See Also:
-
ParseConversionEvent
-
parseInt
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 32 bit integer value and converts it into a primitiveint
value.- Specified by:
parseInt
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
int
. - See Also:
-
ParseConversionEvent
-
parseLong
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 64 bit integer value and converts it into a primitivelong
value.- Specified by:
parseLong
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
long
. - See Also:
-
ParseConversionEvent
-
parseShort
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 16 bit integer value and converts it into a primitiveshort
value.- Specified by:
parseShort
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
short
. - See Also:
-
ParseConversionEvent
-
parseDecimal
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given decimal value (arbitrary precision) and converts it into an instance ofBigDecimal
.- Specified by:
parseDecimal
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into an instance of
BigDecimal
. - See Also:
-
ParseConversionEvent
-
parseFloat
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 32 bit floating point value and converts it into a primitivefloat
value.- Specified by:
parseFloat
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
float
. - See Also:
-
ParseConversionEvent
-
parseDouble
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 64 bit floating point value and converts it into a primitivedouble
value.- Specified by:
parseDouble
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
double
. - See Also:
-
ParseConversionEvent
-
parseBoolean
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given boolean value and converts it into a primitiveboolean
value.- Specified by:
parseBoolean
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
boolean
. - See Also:
-
ParseConversionEvent
-
parseByte
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 8 bit integer value and converts it into a primitivebyte
value.- Specified by:
parseByte
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
byte
. - See Also:
-
ParseConversionEvent
-
parseQName
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
parseQName
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- 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.arg1
- 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 negative offset of one hour to UTC.- Parameters:
arg0
- The input string being parsed.lenient
- parameter used for allowing lenient parsing- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseDateTime
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
parseDateTime
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseBase64Binary
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given byte array, which is encoded in base 64.- Specified by:
parseBase64Binary
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed, a base 64 encoded array of bytes.- Returns:
- The decoded byte array.
- See Also:
-
ParseConversionEvent
-
parseHexBinary
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given byte array, which is encoded in hex digits.- Specified by:
parseHexBinary
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed, an array of bytes encoded in hex digits.- Returns:
- The decoded byte array.
- See Also:
-
ParseConversionEvent
-
parseUnsignedInt
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 32 bit unsignet integer value and converts it into a primitivelong
value.- Specified by:
parseUnsignedInt
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into a primitive
long
. - See Also:
-
ParseConversionEvent
-
parseUnsignedShort
Description copied from interface:DatatypeConverterInterface
Parses the lexical representation of the given 16 bit unsignet integer value and converts it into a primitiveint
value.- Specified by:
parseUnsignedShort
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string conve rted into a primitive
int
. - See Also:
-
ParseConversionEvent
-
parseTime
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
parseTime
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseDate
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
parseDate
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string being parsed.- Returns:
- The input string converted into an instance of
Calendar
. - See Also:
-
ParseConversionEvent
-
parseAnySimpleType
Description copied from interface:DatatypeConverterInterface
Returns the lexical representation of the input string, which is the unmodified input string.- Specified by:
parseAnySimpleType
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- An input string in lexical representation.- Returns:
- The unmodified input string.
- See Also:
-
ParseConversionEvent
-
parseDuration
-
printString
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given input string, which is the unmodified input string.- Specified by:
printString
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string.- Returns:
- The unmodified input string.
- See Also:
-
PrintConversionEvent
-
printInteger
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given instance ofBigInteger
, which is an integer in arbitrary precision.- Specified by:
printInteger
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The integer value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printInt
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive 32 bit integer.- Specified by:
printInt
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Theint
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printLong
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive 64 bit integer.- Specified by:
printLong
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Thelong
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printShort
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive 16 bit integer.- Specified by:
printShort
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Theshort
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printDecimal
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given instance ofBigDecimal
, which is a decimal number in arbitrary precision.- Specified by:
printDecimal
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The decimal value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printFloat
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive 32 bit floating point number.- Specified by:
printFloat
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Thefloat
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printDouble
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive 64 bit floating point number.- Specified by:
printDouble
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Thedouble
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printBoolean
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive boolean value.- Specified by:
printBoolean
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Theboolean
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printByte
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive 8 bit integer.- Specified by:
printByte
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Thebyte
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printQName
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
printQName
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The qualified name being converted.arg1
- 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
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
printDateTime
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The dateTime value being converted- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printBase64Binary
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given byte array. The lexical representation is obtained by application of the base 64 encoding.- Specified by:
printBase64Binary
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The byte array being converted.- Returns:
- The converted byte array.
- See Also:
-
PrintConversionEvent
-
printHexBinary
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given byte array. The lexical representation is obtained by encoding any byte as two hex digits.- Specified by:
printHexBinary
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The byte array being converted.- Returns:
- The converted byte array.
- See Also:
-
PrintConversionEvent
-
printUnsignedInt
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive, unsigned 32 bit integer.- Specified by:
printUnsignedInt
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Thelong
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printUnsignedShort
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given primitive, unsigned 16 bit integer.- Specified by:
printUnsignedShort
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- Theshort
value being converted.- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printTime
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
printTime
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The time value being converted- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printDate
Description copied from interface:DatatypeConverterInterface
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.- Specified by:
printDate
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The date value being converted- Returns:
- A lexical representation of the input value.
- See Also:
-
PrintConversionEvent
-
printAnySimpleType
Description copied from interface:DatatypeConverterInterface
Returns a lexical representation of the given input string, which is the unmodified input string.- Specified by:
printAnySimpleType
in interfaceDatatypeConverterInterface
- Parameters:
arg0
- The input string.- Returns:
- The unmodified input string.
- See Also:
-
PrintConversionEvent
-
printDuration
-