public final class XsTypeConverter extends Object
| Constructor and Description |
|---|
XsTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
static GDateSpecification |
getGDateValue(Calendar c,
int builtin_type_code) |
static GDateSpecification |
getGDateValue(CharSequence v,
int builtin_type_code) |
static GDateSpecification |
getGDateValue(Date d,
int builtin_type_code) |
static String |
getQNameString(String uri,
String localpart,
String prefix) |
static CharSequence |
lexAnyURI(CharSequence lexical_value)
Checks the regular expression of URI, defined by RFC2369 http://www.ietf.org/rfc/rfc2396.txt Appendix B.
|
static boolean |
lexBoolean(CharSequence v) |
static boolean |
lexBoolean(CharSequence value,
Collection<XmlError> errors) |
static byte |
lexByte(CharSequence cs) |
static byte |
lexByte(CharSequence cs,
Collection<XmlError> errors) |
static XmlCalendar |
lexDateTime(CharSequence v) |
static BigDecimal |
lexDecimal(CharSequence cs) |
static BigDecimal |
lexDecimal(CharSequence cs,
boolean allowExponent)
Parses an xsd:decimal lexical value.
|
static double |
lexDouble(CharSequence cs) |
static double |
lexDouble(CharSequence cs,
boolean strict,
int maxNumberOfChars)
Parses an xsd:double lexical value.
|
static double |
lexDouble(CharSequence cs,
Collection<XmlError> errors) |
static float |
lexFloat(CharSequence cs) |
static float |
lexFloat(CharSequence cs,
boolean strict,
int maxNumberOfChars)
Parses an xsd:float lexical value.
|
static float |
lexFloat(CharSequence cs,
Collection<XmlError> errors) |
static GDate |
lexGDate(CharSequence charSeq) |
static GDate |
lexGDate(String xsd_gdate,
Collection<XmlError> errors) |
static int |
lexInt(CharSequence cs) |
static int |
lexInt(CharSequence cs,
Collection<XmlError> errors) |
static BigInteger |
lexInteger(CharSequence cs) |
static BigInteger |
lexInteger(CharSequence cs,
Collection<XmlError> errors) |
static long |
lexLong(CharSequence cs) |
static long |
lexLong(CharSequence cs,
Collection<XmlError> errors) |
static QName |
lexQName(CharSequence charSeq,
NamespaceContext nscontext) |
static QName |
lexQName(String xsd_qname,
Collection<XmlError> errors,
NamespaceContext nscontext) |
static short |
lexShort(CharSequence cs) |
static short |
lexShort(CharSequence cs,
Collection<XmlError> errors) |
static String |
printBoolean(boolean value) |
static String |
printByte(byte value) |
static String |
printDate(Calendar c) |
static String |
printDate(Date d) |
static String |
printDateTime(Calendar c) |
static String |
printDateTime(Calendar c,
int type_code) |
static String |
printDateTime(Date c) |
static String |
printDecimal(BigDecimal value) |
static String |
printDouble(double value) |
static String |
printFloat(float value) |
static String |
printGDate(GDate gdate,
Collection<XmlError> errors) |
static CharSequence |
printHexBinary(byte[] val) |
static String |
printInt(int value) |
static String |
printInteger(BigInteger value) |
static String |
printLong(long value) |
static String |
printQName(QName qname,
NamespaceContext nsContext,
Collection<XmlError> errors) |
static String |
printShort(short value) |
static String |
printString(String value) |
static String |
printTime(Calendar c) |
public static float lexFloat(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static float lexFloat(CharSequence cs, boolean strict, int maxNumberOfChars) throws NumberFormatException
cs - the lexical valuestrict - when true, lexical forms that Float.parseFloat(java.lang.String) accepts
but XSD does not are rejected: hexadecimal floats (0x1p4), the
Java Infinity token, and a trailing type suffix
(f/F/d/D). When false the
long-standing lenient behaviour applies. Driven by
XmlOptions.setLoadStrictFloatingPoint().maxNumberOfChars - the maximum number of characters allowed in the stringNumberFormatException - if the value is not a valid xsd:floatpublic static float lexFloat(CharSequence cs, Collection<XmlError> errors)
public static String printFloat(float value)
public static double lexDouble(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static double lexDouble(CharSequence cs, boolean strict, int maxNumberOfChars) throws NumberFormatException
cs - the lexical valuestrict - when true, lexical forms that Double.parseDouble(java.lang.String) accepts
but XSD does not are rejected: hexadecimal floats (0x1p4), the
Java Infinity token, and a trailing type suffix
(f/F/d/D). When false the
long-standing lenient behaviour applies. Driven by
XmlOptions.setLoadStrictFloatingPoint().maxNumberOfChars - the maximum number of characters allowed in the stringNumberFormatException - if the value is not a valid xsd:doublepublic static double lexDouble(CharSequence cs, Collection<XmlError> errors)
public static String printDouble(double value)
public static BigDecimal lexDecimal(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static BigDecimal lexDecimal(CharSequence cs, boolean allowExponent) throws NumberFormatException
cs - the lexical valueallowExponent - when false (the default) scientific/exponent notation
such as 1E5 is rejected: it is outside the xsd:decimal
lexical space (that form belongs to xsd:double/xsd:float) and
BigDecimal would otherwise parse it to a wrong value
(1E5 -> 100000). When true the long-standing
lenient behaviour applies and an exponent is accepted. Driven by
XmlOptions.setLoadAllowDecimalExponent().NumberFormatException - if the value is not a valid xsd:decimalpublic static String printDecimal(BigDecimal value)
public static BigInteger lexInteger(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static BigInteger lexInteger(CharSequence cs, Collection<XmlError> errors)
public static String printInteger(BigInteger value)
public static long lexLong(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static long lexLong(CharSequence cs, Collection<XmlError> errors)
public static String printLong(long value)
public static short lexShort(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static short lexShort(CharSequence cs, Collection<XmlError> errors)
public static String printShort(short value)
public static int lexInt(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static int lexInt(CharSequence cs, Collection<XmlError> errors)
public static String printInt(int value)
public static byte lexByte(CharSequence cs) throws NumberFormatException
NumberFormatExceptionpublic static byte lexByte(CharSequence cs, Collection<XmlError> errors)
public static String printByte(byte value)
public static boolean lexBoolean(CharSequence v)
public static boolean lexBoolean(CharSequence value, Collection<XmlError> errors)
public static String printBoolean(boolean value)
public static QName lexQName(CharSequence charSeq, NamespaceContext nscontext)
public static QName lexQName(String xsd_qname, Collection<XmlError> errors, NamespaceContext nscontext)
public static String printQName(QName qname, NamespaceContext nsContext, Collection<XmlError> errors)
public static GDate lexGDate(CharSequence charSeq)
public static GDate lexGDate(String xsd_gdate, Collection<XmlError> errors)
public static String printGDate(GDate gdate, Collection<XmlError> errors)
public static XmlCalendar lexDateTime(CharSequence v)
public static CharSequence printHexBinary(byte[] val)
public static GDateSpecification getGDateValue(Date d, int builtin_type_code)
public static GDateSpecification getGDateValue(Calendar c, int builtin_type_code)
public static GDateSpecification getGDateValue(CharSequence v, int builtin_type_code)
public static CharSequence lexAnyURI(CharSequence lexical_value)
lexical_value - the lexical value