Class AbstractIntegerAdapter<ITEM_TYPE extends IIntegerItem>
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter<BigInteger,ITEM_TYPE>
-
- gov.nist.secauto.metaschema.core.datatype.adapter.AbstractIntegerAdapter<ITEM_TYPE>
-
- Type Parameters:
ITEM_TYPE
- the Metapath item type supported by the adapter
- All Implemented Interfaces:
IDataTypeAdapter<BigInteger>
- Direct Known Subclasses:
IntegerAdapter
,NonNegativeIntegerAdapter
,PositiveIntegerAdapter
public abstract class AbstractIntegerAdapter<ITEM_TYPE extends IIntegerItem> extends AbstractDataTypeAdapter<BigInteger,ITEM_TYPE>
Provides a common base class for integer-based data types.An underlying
BigInteger
is used to support arbitrary sized integers.
-
-
Field Summary
-
Fields inherited from class gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter
DEFAULT_JSON_FIELD_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractIntegerAdapter()
Construct a new integer-based adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigInteger
copy(Object obj)
Create a copy of the provided value.com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes
getJsonRawType()
The JSON primative type of the data type.BigInteger
parse(String value)
Parses a provided string.void
writeJsonValue(Object value, com.fasterxml.jackson.core.JsonGenerator generator)
Writes the provided Java class instance as a JSON/YAML field value.-
Methods inherited from class gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter
asString, canHandleQName, cast, castInternal, getDefaultJsonValueKey, getItemClass, getJavaClass, isParsingStartElement, isUnrappedValueAllowedInXml, isXmlMixed, newItem, parse, parse, toValue, writeXmlValue, writeXmlValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter
getNames, getPreferredName, isAtomic, parseAndSupply, parseAndSupply, parseAndSupply
-
-
-
-
Constructor Detail
-
AbstractIntegerAdapter
protected AbstractIntegerAdapter()
Construct a new integer-based adapter.
-
-
Method Detail
-
getJsonRawType
public com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes getJsonRawType()
Description copied from interface:IDataTypeAdapter
The JSON primative type of the data type.- Returns:
- the JSON data type
-
parse
public BigInteger parse(String value)
Description copied from interface:IDataTypeAdapter
Parses a provided string. Used to parse XML attributes, simple XML character data, and JSON/YAML property values.- Parameters:
value
- the string value to parse- Returns:
- the parsed data as the adapter's type
-
writeJsonValue
public void writeJsonValue(Object value, com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
Description copied from interface:IDataTypeAdapter
Writes the provided Java class instance as a JSON/YAML field value.- Specified by:
writeJsonValue
in interfaceIDataTypeAdapter<ITEM_TYPE extends IIntegerItem>
- Overrides:
writeJsonValue
in classAbstractDataTypeAdapter<BigInteger,ITEM_TYPE extends IIntegerItem>
- Parameters:
value
- theField
instance value to writegenerator
- the JSON/YAML writer used to output the JSON/YAML data- Throws:
IOException
- if an unexpected error occurred while writing the JSON/YAML output
-
copy
public BigInteger copy(Object obj)
Description copied from interface:IDataTypeAdapter
Create a copy of the provided value.- Parameters:
obj
- the value to copy- Returns:
- the copy
-
-