public class AXmlAdapterTNumber extends XmlAdapter<String,Number>
The maximum and minimum digit lengths plus inclusive values are identified in the constructor.
UN(x) is an unsigned (positive) integer number of maximum x digits
SN(x) is an integer number of maximum x digits (excluding minus sign)
UN(x.y) is a unsigned (positive) decimal number of maximum x digits (excluding decimal point as applicable) and with a maximum of y decimal digits.
SN(x.y) is a decimal number of maximum x digits (excluding minus sign and decimal point as applicable) and with a maximum of y decimal digits.
double is a number expressing either in floating point (e.g. 0.015) or scientific notation or using scientific notation (decimal number followed by an optional "E" for the power of 10, e.g. 1.5E-2 representing the same value 0.015).
Where applicable, the types UN and SN may be followed by an additional range constraint in the form [a .. b] meaning that the value is restricted to be between a and b inclusive. They may also be followed by an additional unit in parenthesis. Example: Sensitivity value: SN(5.2) [-140.00 .. -30.00] (dBm)
Constructor and Description |
---|
AXmlAdapterTNumber(Integer totalDigits,
Integer fractionDigits)
Deprecated.
Construct a new Number adapter.
|
AXmlAdapterTNumber(Integer totalDigits,
Integer fractionDigits,
Integer minInclusive,
Integer maxInclusive)
Deprecated.
Construct a new Number adapter.
|
Modifier and Type | Method and Description |
---|---|
Number |
getMaxValue()
Deprecated.
Get the maximum value allowed by this adapter.
|
Number |
getMinValue()
Deprecated.
Get the minimum value allowed by this adapter.
|
String |
marshal(Number v)
Deprecated.
Convert a bound type to a value type.
|
Number |
unmarshal(String v)
Deprecated.
Convert a value type to a bound type.
|
public AXmlAdapterTNumber(Integer totalDigits, Integer fractionDigits)
totalDigits
- The maximum number of total digits in the number,
inclusive of fraction digits. e.g. 123.456 contains 6
digits.fractionDigits
- The maximum number of fraction digits - number of
digits to the right of the decimal. e.g. 123.456
contains 3 fraction digits.public AXmlAdapterTNumber(Integer totalDigits, Integer fractionDigits, Integer minInclusive, Integer maxInclusive)
totalDigits
- The maximum number of total digits in the number,
inclusive of fraction digits. e.g. 123.456 contains 6
digits.fractionDigits
- The maximum number of fraction digits - number of
digits to the right of the decimal. e.g. 123.456
contains 3 fraction digits.minInclusive
- The minimum inclusive value.maxInclusive
- The maximum inclusive value.public String marshal(Number v) throws Exception
This is called when converting an object to XML.
marshal
in class XmlAdapter<String,Number>
v
- The value to be convereted. Can be null.Exception
- if there's an error during the conversion. The caller is
responsible for reporting the error to the user through
ValidationEventHandler.public Number unmarshal(String v) throws Exception
This is called with converting XML to an object.
unmarshal
in class XmlAdapter<String,Number>
v
- The value to be converted. Can be null.Exception
- if there's an error during the conversion. The caller is
responsible for reporting the error to the user through
ValidationEventHandler.public Number getMaxValue()
public Number getMinValue()
Copyright © 2016 OpenSSRF.org. All rights reserved.