XBinder C# Runtime Library  2.8
Static Public Member Functions | List of all members
com.objsys.xbinder.runtime.XBSimpleType Class Reference

Helper class for dealing with XML simple types. More...

Static Public Member Functions

static System.String formatBase64BinaryToString (XBByteArray bytes)
 
static void formatBase64BinaryToStream (XBByteArray bytes, System.IO.StreamWriter stream)
 
static System.String formatDecimal (System.Decimal value_Renamed)
 Format the Decimal into a string without leading or trailing zeros. More...
 
static System.String formatDecimal (System.Decimal decValue, int totalMaxDigits, int fractionMaxDigits, int fractionMinDigits, int integerMinDigits, bool signAlwaysPresent, bool pointAlwaysPresent, bool validate)
 Format the Decimal according to caller's detailed instructions More...
 
static XBByteArray parseBase64Binary (System.String text)
 Decode given base64Binary XML text into new XBByteArray. More...
 
static XBByteArray parseBase64Binary (System.String text, XBByteArray bytes)
 Decode given base64Binary XML text into give bytes object. More...
 
static bool parseBoolean (System.String text)
 Convert text to a boolean value. Whitespace processing should have already been applied. More...
 
static System.Decimal parseDecimal (System.String text)
 Convert XML text to a decimal value. Whitespace processing should have already been applied. More...
 
static System.Decimal parseDecimalAndValidate (System.String text, int totalDigits, int fractionDigits)
 Parses an xsd:decimal value and validates the given facets. This behaves the same as parseDecimal(text), except for the additional validation of the facets. More...
 
static double parseDouble (System.String text)
 Convert XML text to a double value. Whitespace processing should have already been applied. More...
 
static float parseSingle (System.String text)
 Convert XML text to a float value. Whitespace processing should have already been applied. More...
 
static sbyte parseSByte (System.String value_Renamed)
 Parses a String into a byte. The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static byte parseByte (System.String value_Renamed)
 Parses a String into a byte. The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static int parseInt32 (System.String value_Renamed)
 Parses a String into an int The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static uint parseUInt32 (System.String value_Renamed)
 Parses a String into a uint The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static ulong parseUInt64 (System.String value_Renamed)
 Parses a String into a ulong The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static long parseInt64 (System.String value_Renamed)
 Parses a String into a long The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static short parseInt16 (System.String value_Renamed)
 Parses a String into a short. The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static ushort parseUInt16 (System.String value_Renamed)
 Parses a String into a ushort. The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable. More...
 
static System.String whitespaceReplace (System.String value_Renamed)
 Apply the whitespace="replace" facet. This rule replaces any
with a space. More...
 
static System.String whitespaceCollapse (System.String value_Renamed)
 Apply the whitespace="collapse" facet. This rule replaces
with space. It then replaces multiple spaces with a single space, and removes leading and trailing spaces. More...
 

Detailed Description

Helper class for dealing with XML simple types.

<author> Kevin

</author>

Member Function Documentation

◆ formatDecimal() [1/2]

static System.String com.objsys.xbinder.runtime.XBSimpleType.formatDecimal ( System.Decimal  value_Renamed)
static

Format the Decimal into a string without leading or trailing zeros.

Parameters
value

◆ formatDecimal() [2/2]

static System.String com.objsys.xbinder.runtime.XBSimpleType.formatDecimal ( System.Decimal  decValue,
int  totalMaxDigits,
int  fractionMaxDigits,
int  fractionMinDigits,
int  integerMinDigits,
bool  signAlwaysPresent,
bool  pointAlwaysPresent,
bool  validate 
)
static

Format the Decimal according to caller's detailed instructions

Parameters
decValueThe decimal value to format
totalMaxDigitsThe maximum totalDigits. Values less than 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.
fractionMaxDigitsThe maximum number of fraction digits. Values less than 0 are ignored. Extra fraction digits are rounded off. Trailing zeros are not counted.
fractionMinDigitsMinimum digits in fraction. Trailing zeros will be added if needed.
integerMinDigitsMinimum digits in integer part. Leading zeros will be added if needed.
signPresentIf true, a positive sign is shown.
pointPresentIf true, the decimal point will be shown.
validateIf true, an exception occurs if totalDigits is violated.
value

◆ parseBase64Binary() [1/2]

static XBByteArray com.objsys.xbinder.runtime.XBSimpleType.parseBase64Binary ( System.String  text)
static

Decode given base64Binary XML text into new XBByteArray.

Parameters
text
Returns
bytes

◆ parseBase64Binary() [2/2]

static XBByteArray com.objsys.xbinder.runtime.XBSimpleType.parseBase64Binary ( System.String  text,
XBByteArray  bytes 
)
static

Decode given base64Binary XML text into give bytes object.

Parameters
text
bytesXBByteArray to decode into, starting at 0 offset. If null, a new object will be created to decode into.
Returns
bytes

◆ parseBoolean()

static bool com.objsys.xbinder.runtime.XBSimpleType.parseBoolean ( System.String  text)
static

Convert text to a boolean value. Whitespace processing should have already been applied.

Parameters
textA valid XML Schema lexical representation of a boolean.
Returns

◆ parseByte()

static byte com.objsys.xbinder.runtime.XBSimpleType.parseByte ( System.String  value_Renamed)
static

Parses a String into a byte. The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a byte. The string is otherwise not valid, as described above.

◆ parseDecimal()

static System.Decimal com.objsys.xbinder.runtime.XBSimpleType.parseDecimal ( System.String  text)
static

Convert XML text to a decimal value. Whitespace processing should have already been applied.

◆ parseDecimalAndValidate()

static System.Decimal com.objsys.xbinder.runtime.XBSimpleType.parseDecimalAndValidate ( System.String  text,
int  totalDigits,
int  fractionDigits 
)
static

Parses an xsd:decimal value and validates the given facets. This behaves the same as parseDecimal(text), except for the additional validation of the facets.

<totalDigits> Values < 1 are ignored </totalDigits> <fractionDigits> Values < 0 are ignored </fractionDigits>

◆ parseDouble()

static double com.objsys.xbinder.runtime.XBSimpleType.parseDouble ( System.String  text)
static

Convert XML text to a double value. Whitespace processing should have already been applied.

This method accepts strings that are legal lexical representations of the XML Schema double data type. Note the following:

  • hex representation is not allowed
  • leading/trailing whitespace (incl. ASCII control chars) not allowed
  • a float type suffix is not allowed
  • "-0" returns 0, not -0.
  • "INF" or "-INF" is allowed, not "+Infinity", "-Infinity", "Infinity"
  • "NaN" is allowed, but not with any sign.

◆ parseInt16()

static short com.objsys.xbinder.runtime.XBSimpleType.parseInt16 ( System.String  value_Renamed)
static

Parses a String into a short. The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a byte. The string is otherwise not valid, as described above.

◆ parseInt32()

static int com.objsys.xbinder.runtime.XBSimpleType.parseInt32 ( System.String  value_Renamed)
static

Parses a String into an int The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a byte. The string is otherwise not valid, as described above.

◆ parseInt64()

static long com.objsys.xbinder.runtime.XBSimpleType.parseInt64 ( System.String  value_Renamed)
static

Parses a String into a long The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a byte. The string is otherwise not valid, as described above.

◆ parseSByte()

static sbyte com.objsys.xbinder.runtime.XBSimpleType.parseSByte ( System.String  value_Renamed)
static

Parses a String into a byte. The string may have a leading +/-, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a byte. The string is otherwise not valid, as described above.

◆ parseSingle()

static float com.objsys.xbinder.runtime.XBSimpleType.parseSingle ( System.String  text)
static

Convert XML text to a float value. Whitespace processing should have already been applied.

This method accepts strings that are legal lexical representations of the XML Schema float data type. Some differences from the standard Java Float.valueOf are:

  • hex representation is not allowed
  • leading/trailing whitespace (incl. ASCII control chars) not allowed
  • a float type suffix is not allowed
  • "-0" returns 0, not -0.
  • "INF" or "-INF" is allowed, not "+Infinity", "-Infinity", "Infinity"
  • "NaN" is allowed, but not with any sign.

◆ parseUInt16()

static ushort com.objsys.xbinder.runtime.XBSimpleType.parseUInt16 ( System.String  value_Renamed)
static

Parses a String into a ushort. The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a ushort. The string is otherwise not valid, as described above.

◆ parseUInt32()

static uint com.objsys.xbinder.runtime.XBSimpleType.parseUInt32 ( System.String  value_Renamed)
static

Parses a String into a uint The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a uint. The string is otherwise not valid, as described above.

◆ parseUInt64()

static ulong com.objsys.xbinder.runtime.XBSimpleType.parseUInt64 ( System.String  value_Renamed)
static

Parses a String into a ulong The string may have a leading +, otherwise all characters must be '0' - '9'. Leading zeros are acceptable.

Whitespace is not allowed.

Parameters
value
Returns

<throws> XBNumberFormatException if any of the following: </throws>

The string represents an integer out of range of a ulong. The string is otherwise not valid, as described above.

◆ whitespaceCollapse()

static System.String com.objsys.xbinder.runtime.XBSimpleType.whitespaceCollapse ( System.String  value_Renamed)
static

Apply the whitespace="collapse" facet. This rule replaces
with space. It then replaces multiple spaces with a single space, and removes leading and trailing spaces.

Parameters
value
Returns

◆ whitespaceReplace()

static System.String com.objsys.xbinder.runtime.XBSimpleType.whitespaceReplace ( System.String  value_Renamed)
static

Apply the whitespace="replace" facet. This rule replaces any
with a space.