|
|||||||||
| Home >> All >> javax >> xml >> [ bind overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.xml.bind
Interface DatatypeConverterInterface

- 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
DatatypeConverter.setDatatypeConverter(DatatypeConverterInterface) 55 .
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
| Method Summary | |
java.lang.String |
parseAnySimpleType(java.lang.String pLexicalXSDAnySimpleType)
Returns the lexical representation of the input string, which is the unmodified input string. |
byte[] |
parseBase64Binary(java.lang.String pLexicalXSDBase64Binary)
Parses the lexical representation of the given byte array, which is encoded in base 64. |
boolean |
parseBoolean(java.lang.String pLexicalXSDBoolean)
Parses the lexical representation of the given boolean value and converts it into a primitive boolean value. |
byte |
parseByte(java.lang.String pLexicalXSDByte)
Parses the lexical representation of the given 8 bit integer value and converts it into a primitive byte value. |
java.util.Calendar |
parseDate(java.lang.String pLexicalXSDDate)
Parses the lexical representation of the given date value and converts it into an instance of java.util.Calendar. |
java.util.Calendar |
parseDateTime(java.lang.String pLexicalXSDDateTime)
Parses the lexical representation of the given dateTime value and converts it into an instance of java.util.Calendar. |
java.math.BigDecimal |
parseDecimal(java.lang.String pLexicalXSDDecimal)
Parses the lexical representation of the given decimal value (arbitrary precision) and converts it into an instance of java.math.BigDecimal. |
double |
parseDouble(java.lang.String pLexicalXSDDouble)
Parses the lexical representation of the given 64 bit floating point value and converts it into a primitive double value. |
float |
parseFloat(java.lang.String pLexicalXSDFloat)
Parses the lexical representation of the given 32 bit floating point value and converts it into a primitive float value. |
byte[] |
parseHexBinary(java.lang.String pLexicalXSDHexBinary)
Parses the lexical representation of the given byte array, which is encoded in hex digits. |
int |
parseInt(java.lang.String pLexicalXSDInt)
Parses the lexical representation of the given 32 bit integer value and converts it into a primitive int value. |
java.math.BigInteger |
parseInteger(java.lang.String pLexicalXSDInteger)
Parses the lexical representation of the given integer value (arbitrary precision) and converts it into an instance of java.math.BigInteger. |
long |
parseLong(java.lang.String pLexicalXSDLong)
Parses the lexical representation of the given 64 bit integer value and converts it into a primitive long value. |
javax.xml.namespace.QName |
parseQName(java.lang.String pLexicalXSDQName,
javax.xml.namespace.NamespaceContext pNamespaceContext)
Parses the lexical representation of the given qualified name and converts it into an instance of javax.xml.namespace.QName. |
short |
parseShort(java.lang.String pLexicalXSDShort)
Parses the lexical representation of the given 16 bit integer value and converts it into a primitive short value. |
java.lang.String |
parseString(java.lang.String pLexicalXSDString)
Parses the lexical representation and converts it into a String. |
java.util.Calendar |
parseTime(java.lang.String pLexicalXSDTime)
Parses the lexical representation of the given time value and converts it into an instance of java.util.Calendar. |
long |
parseUnsignedInt(java.lang.String pLexicalXSDUnsignedInt)
Parses the lexical representation of the given 32 bit unsignet integer value and converts it into a primitive long
value. |
int |
parseUnsignedShort(java.lang.String pLexicalXSDUnsignedShort)
Parses the lexical representation of the given 16 bit unsignet integer value and converts it into a primitive int
value. |
java.lang.String |
printAnySimpleType(java.lang.String pValue)
Returns a lexical representation of the given input string, which is the unmodified input string. |
java.lang.String |
printBase64Binary(byte[] pValue)
Returns a lexical representation of the given byte array. |
java.lang.String |
printBoolean(boolean pValue)
Returns a lexical representation of the given primitive boolean value. |
java.lang.String |
printByte(byte pValue)
Returns a lexical representation of the given primitive 8 bit integer. |
java.lang.String |
printDate(java.util.Calendar pValue)
Returns a lexical representation of the given date value. |
java.lang.String |
printDateTime(java.util.Calendar pValue)
Returns a lexical representation of the given dateTime value. |
java.lang.String |
printDecimal(java.math.BigDecimal pValue)
Returns a lexical representation of the given instance of java.math.BigDecimal, which is a decimal number in arbitrary precision. |
java.lang.String |
printDouble(double pValue)
Returns a lexical representation of the given primitive 64 bit floating point number. |
java.lang.String |
printFloat(float pValue)
Returns a lexical representation of the given primitive 32 bit floating point number. |
java.lang.String |
printHexBinary(byte[] pValue)
Returns a lexical representation of the given byte array. |
java.lang.String |
printInt(int pValue)
Returns a lexical representation of the given primitive 32 bit integer. |
java.lang.String |
printInteger(java.math.BigInteger pValue)
Returns a lexical representation of the given instance of java.math.BigInteger, which is an integer in arbitrary precision. |
java.lang.String |
printLong(long pValue)
Returns a lexical representation of the given primitive 64 bit integer. |
java.lang.String |
printQName(javax.xml.namespace.QName pValue,
javax.xml.namespace.NamespaceContext pNamespaceContext)
Returns a lexical representation of the given qualified name, which is a combination of namespace URI and local name. |
java.lang.String |
printShort(short pValue)
Returns a lexical representation of the given primitive 16 bit integer. |
java.lang.String |
printString(java.lang.String pValue)
Returns a lexical representation of the given input string, which is the unmodified input string. |
java.lang.String |
printTime(java.util.Calendar pValue)
Returns a lexical representation of the given time value. |
java.lang.String |
printUnsignedInt(long pValue)
Returns a lexical representation of the given primitive, unsigned 32 bit integer. |
java.lang.String |
printUnsignedShort(int pValue)
Returns a lexical representation of the given primitive, unsigned 16 bit integer. |
| Method Detail |
parseString
public java.lang.String parseString(java.lang.String pLexicalXSDString)
Parses the lexical representation and converts it into a String.
parseInteger
public java.math.BigInteger parseInteger(java.lang.String pLexicalXSDInteger)
Parses the lexical representation of the given integer value (arbitrary precision) and converts it into an instance of java.math.BigInteger.
parseInt
public int parseInt(java.lang.String pLexicalXSDInt)
Parses the lexical representation of the given 32 bit integer value and converts it into a primitive
intvalue.
parseLong
public long parseLong(java.lang.String pLexicalXSDLong)
Parses the lexical representation of the given 64 bit integer value and converts it into a primitive
longvalue.
parseShort
public short parseShort(java.lang.String pLexicalXSDShort)
Parses the lexical representation of the given 16 bit integer value and converts it into a primitive
shortvalue.
parseDecimal
public java.math.BigDecimal parseDecimal(java.lang.String pLexicalXSDDecimal)
Parses the lexical representation of the given decimal value (arbitrary precision) and converts it into an instance of java.math.BigDecimal.
parseFloat
public float parseFloat(java.lang.String pLexicalXSDFloat)
Parses the lexical representation of the given 32 bit floating point value and converts it into a primitive
floatvalue.
parseDouble
public double parseDouble(java.lang.String pLexicalXSDDouble)
Parses the lexical representation of the given 64 bit floating point value and converts it into a primitive
doublevalue.
parseBoolean
public boolean parseBoolean(java.lang.String pLexicalXSDBoolean)
Parses the lexical representation of the given boolean value and converts it into a primitive
booleanvalue.
parseByte
public byte parseByte(java.lang.String pLexicalXSDByte)
Parses the lexical representation of the given 8 bit integer value and converts it into a primitive
bytevalue.
parseQName
public javax.xml.namespace.QName parseQName(java.lang.String pLexicalXSDQName, javax.xml.namespace.NamespaceContext pNamespaceContext)
Parses the lexical representation of the given qualified name and converts it into an instance of javax.xml.namespace.QName. The javax.xml.namespace.QName consists of a namespace URI and a local name.
parseDateTime
public java.util.Calendar parseDateTime(java.lang.String pLexicalXSDDateTime)
Parses the lexical representation of the given dateTime value and converts it into an instance of java.util.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:00
The former examples are all specified in UTC time. The last example uses a negatice offset of one hour to UTC.
parseBase64Binary
public byte[] parseBase64Binary(java.lang.String pLexicalXSDBase64Binary)
Parses the lexical representation of the given byte array, which is encoded in base 64.
parseHexBinary
public byte[] parseHexBinary(java.lang.String pLexicalXSDHexBinary)
Parses the lexical representation of the given byte array, which is encoded in hex digits.
parseUnsignedInt
public long parseUnsignedInt(java.lang.String pLexicalXSDUnsignedInt)
Parses the lexical representation of the given 32 bit unsignet integer value and converts it into a primitive
longvalue.
parseUnsignedShort
public int parseUnsignedShort(java.lang.String pLexicalXSDUnsignedShort)
Parses the lexical representation of the given 16 bit unsignet integer value and converts it into a primitive
intvalue.
parseTime
public java.util.Calendar parseTime(java.lang.String pLexicalXSDTime)
Parses the lexical representation of the given time value and converts it into an instance of java.util.Calendar. Valid lexical representations of a time value 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.
parseDate
public java.util.Calendar parseDate(java.lang.String pLexicalXSDDate)
Parses the lexical representation of the given date value and converts it into an instance of java.util.Calendar. Valid lexical representations of a date value 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.
parseAnySimpleType
public java.lang.String parseAnySimpleType(java.lang.String pLexicalXSDAnySimpleType)
Returns the lexical representation of the input string, which is the unmodified input string.
printString
public java.lang.String printString(java.lang.String pValue)
Returns a lexical representation of the given input string, which is the unmodified input string.
printInteger
public java.lang.String printInteger(java.math.BigInteger pValue)
Returns a lexical representation of the given instance of java.math.BigInteger, which is an integer in arbitrary precision.
printInt
public java.lang.String printInt(int pValue)
Returns a lexical representation of the given primitive 32 bit integer.
printLong
public java.lang.String printLong(long pValue)
Returns a lexical representation of the given primitive 64 bit integer.
printShort
public java.lang.String printShort(short pValue)
Returns a lexical representation of the given primitive 16 bit integer.
printDecimal
public java.lang.String printDecimal(java.math.BigDecimal pValue)
Returns a lexical representation of the given instance of java.math.BigDecimal, which is a decimal number in arbitrary precision.
printFloat
public java.lang.String printFloat(float pValue)
Returns a lexical representation of the given primitive 32 bit floating point number.
printDouble
public java.lang.String printDouble(double pValue)
Returns a lexical representation of the given primitive 64 bit floating point number.
printBoolean
public java.lang.String printBoolean(boolean pValue)
Returns a lexical representation of the given primitive boolean value.
printByte
public java.lang.String printByte(byte pValue)
Returns a lexical representation of the given primitive 8 bit integer.
printQName
public java.lang.String printQName(javax.xml.namespace.QName pValue, javax.xml.namespace.NamespaceContext pNamespaceContext)
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.
printDateTime
public java.lang.String printDateTime(java.util.Calendar pValue)
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.
printBase64Binary
public java.lang.String printBase64Binary(byte[] pValue)
Returns a lexical representation of the given byte array. The lexical representation is obtained by application of the base 64 encoding.
printHexBinary
public java.lang.String printHexBinary(byte[] pValue)
Returns a lexical representation of the given byte array. The lexical representation is obtained by encoding any byte as two hex digits.
printUnsignedInt
public java.lang.String printUnsignedInt(long pValue)
Returns a lexical representation of the given primitive, unsigned 32 bit integer.
printUnsignedShort
public java.lang.String printUnsignedShort(int pValue)
Returns a lexical representation of the given primitive, unsigned 16 bit integer.
printTime
public java.lang.String printTime(java.util.Calendar pValue)
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.
printDate
public java.lang.String printDate(java.util.Calendar pValue)
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.
printAnySimpleType
public java.lang.String printAnySimpleType(java.lang.String pValue)
Returns a lexical representation of the given input string, which is the unmodified input string.
|
|||||||||
| Home >> All >> javax >> xml >> [ bind overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC