public class XBSimpleType
extends java.lang.Object
Constructor and Description |
---|
XBSimpleType() |
Modifier and Type | Method and Description |
---|---|
static void |
formatBase64BinaryToStream(XBByteArray bytes,
java.io.Writer stream) |
static java.lang.String |
formatBase64BinaryToString(XBByteArray bytes) |
static java.lang.String |
formatDecimal(java.math.BigDecimal value)
Format the BigDecimal into a string without leading or trailing
zeros.
|
static java.lang.String |
formatDecimal(java.math.BigDecimal value,
int totalDigits,
int fractionDigits,
int fractionMinDigits,
int integerMinDigits,
boolean signPresent,
boolean pointPresent,
boolean validate) |
static XBByteArray |
parseBase64Binary(java.lang.String text)
Decode given base64Binary XML text into new XBByteArray.
|
static XBByteArray |
parseBase64Binary(java.lang.String text,
XBByteArray bytes)
Decode given base64Binary XML text into given bytes object.
|
static boolean |
parseBoolean(java.lang.String text)
Convert text to a boolean value.
|
static byte |
parseByte(java.lang.String value)
Parses a String into a byte.
|
static java.math.BigDecimal |
parseDecimal(java.lang.String text)
Convert XML text to a decimal value.
|
static java.math.BigDecimal |
parseDecimalAndValidate(java.lang.String text,
int totalDigits,
int fractionDigits)
Parses an xsd:decimal value and validates the given facets.
|
static double |
parseDouble(java.lang.String text)
Convert XML text to a double value.
|
static float |
parseFloat(java.lang.String text)
Convert XML text to a float value.
|
static int |
parseInteger(java.lang.String value)
Parses a String into an int
The string may have a leading +/-, otherwise all characters must be
'0' - '9'.
|
static long |
parseLong(java.lang.String value)
Parses a String into a long
The string may have a leading +/-, otherwise all characters must be
'0' - '9'.
|
static short |
parseShort(java.lang.String value)
Parses a String into a short.
|
static java.lang.String[] |
splitList(java.lang.String value)
Return the items from an XSD list type in an array.
|
static java.lang.String |
whitespaceCollapse(java.lang.String value)
Apply the whitespace="collapse" facet.
|
static java.lang.String |
whitespaceReplace(java.lang.String value)
Apply the whitespace="replace" facet.
|
public static java.lang.String formatBase64BinaryToString(XBByteArray bytes)
public static void formatBase64BinaryToStream(XBByteArray bytes, java.io.Writer stream)
public static java.lang.String formatDecimal(java.math.BigDecimal value)
value
- public static java.lang.String formatDecimal(java.math.BigDecimal value, int totalDigits, int fractionDigits, int fractionMinDigits, int integerMinDigits, boolean signPresent, boolean pointPresent, boolean validate) throws XBTotalDigitsVioException
totalDigits
- The maximum totalDigits. Values < 1 are ignored.
If validate is false, totalDigits may be exceeded, but if so, no
fraction part will show. If validate is true, and the given number
of totalDigits is exceeded, an exception will be thrown.
Leading zeros in the integer part are not counted.
Trailing zeros in the fraction part are not counted.fractionDigits
- The maximum number of fraction digits. Values < 0
are ignored. Extra fraction digits are rounded off.
Trailing zeros are not counted.fractionMinDigits
- Minimum digits in fraction. Trailing zeros will
be added if needed.integerMinDigits
- Minimum digits in integer part. Leading zeros
will be added if needed.signPresent
- If true, a positive sign is shown.pointPresent
- If true, the decimal point will be shown.validate
- If true, an exception occurs if totalDigits is violated.value
- XBTotalDigitsVioException
public static XBByteArray parseBase64Binary(java.lang.String text)
text
- public static XBByteArray parseBase64Binary(java.lang.String text, XBByteArray bytes)
text
- bytes
- XBByteArray to decode into, starting at 0 offset.
If null, a new object will be created to decode into.public static boolean parseBoolean(java.lang.String text)
text
- A valid XML Schema lexical representation of a boolean.public static java.math.BigDecimal parseDecimal(java.lang.String text)
public static java.math.BigDecimal parseDecimalAndValidate(java.lang.String text, int totalDigits, int fractionDigits)
totalDigits
- Values < 1 are ignoredfractionDigits
- Values < 0 are ignoredpublic static double parseDouble(java.lang.String text)
XBNumberFormatException
- if the text is not a valid xsd:doublepublic static float parseFloat(java.lang.String text)
XBNumberFormatException
- if the text is not a valid xsd:double *public static byte parseByte(java.lang.String value)
value
- XBNumberFormatException
- if any of the following:
The string represents an integer out of range of a byte.
The string is otherwise not valid, as described above.public static int parseInteger(java.lang.String value)
value
- XBNumberFormatException
- if any of the following:
The string represents an integer out of range of a byte.
The string is otherwise not valid, as described above.public static long parseLong(java.lang.String value)
value
- XBNumberFormatException
- if any of the following:
The string represents an integer out of range of a byte.
The string is otherwise not valid, as described above.public static short parseShort(java.lang.String value)
value
- XBNumberFormatException
- if any of the following:
The string represents an integer out of range of a byte.
The string is otherwise not valid, as described above.public static java.lang.String[] splitList(java.lang.String value)
value
- public static java.lang.String whitespaceReplace(java.lang.String value)
public static java.lang.String whitespaceCollapse(java.lang.String value)
value
-