public abstract class DataType
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DataType.LIST
List type that records maxIndex from spec, and uses that to expand a source (list) properly
|
static class |
DataType.MAP
MAP type class
|
static class |
DataType.RUNTIME
Runtime type
|
Modifier and Type | Field and Description |
---|---|
private static DataType.MAP |
mapInstance |
private static DataType.RUNTIME |
runtimeInstance |
Constructor and Description |
---|
DataType() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
create(java.lang.String keyOrIndex,
WalkedPath walkedPath,
OpMode opMode)
Creates an empty map/list, as required by spec, in the parent map/list at given key/index
|
protected abstract java.lang.Object |
createValue()
MAP and LIST types overrides this method to return appropriate new map or list
|
static DataType |
determineDataType(int confirmedArrayAtIndex,
int confirmedMapAtIndex,
int maxExplicitIndex) |
java.lang.Integer |
expand(java.lang.Object source)
LIST overrides this method to expand the source (list) such that in can support
an index specified in spec that is outside the range input list, returns original size
of the input
|
abstract boolean |
isCompatible(java.lang.Object input)
Determines if an input is compatible with current DataType
|
private static final DataType.RUNTIME runtimeInstance
private static final DataType.MAP mapInstance
public static DataType determineDataType(int confirmedArrayAtIndex, int confirmedMapAtIndex, int maxExplicitIndex)
public abstract boolean isCompatible(java.lang.Object input)
protected abstract java.lang.Object createValue()
public java.lang.Integer expand(java.lang.Object source)
public java.lang.Object create(java.lang.String keyOrIndex, WalkedPath walkedPath, OpMode opMode)
keyOrIndex
- of the parent object to createwalkedPath
- containing the parent objectopMode
- to determine if this write operation is allowed