public class AXmlAdapterInteger extends XmlAdapter<String,Integer>
The maximum and minimum digit lengths plus inclusive values are identified in the constructor.
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 |
---|
AXmlAdapterInteger(Integer totalDigits)
Construct a new Number adapter.
|
AXmlAdapterInteger(Integer totalDigits,
Integer minInclusive,
Integer maxInclusive)
Construct a new Number adapter.
|
Modifier and Type | Method and Description |
---|---|
Number |
getMaxValue()
Get the maximum value allowed by this adapter.
|
Number |
getMinValue()
Get the minimum value allowed by this adapter.
|
String |
marshal(Integer v)
Convert a bound type to a value type.
|
Integer |
unmarshal(String v)
Convert a value type to a bound type.
|
public AXmlAdapterInteger(Integer totalDigits)
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 AXmlAdapterInteger(Integer totalDigits, 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(Integer v) throws Exception
This is called when converting an object to XML.
marshal
in class XmlAdapter<String,Integer>
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 Integer unmarshal(String v) throws Exception
This is called with converting XML to an object.
unmarshal
in class XmlAdapter<String,Integer>
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.