public abstract class AbstractJsonProvider extends Object implements JsonProvider
UNDEFINED| Constructor and Description |
|---|
AbstractJsonProvider() |
| Modifier and Type | Method and Description |
|---|---|
Object |
getArrayIndex(Object obj,
int idx)
Extracts a value from an array
|
Object |
getArrayIndex(Object obj,
int idx,
boolean unwrap)
Extracts a value from an array
|
Object |
getMapValue(Object obj,
String key)
Extracts a value from an map
|
Collection<String> |
getPropertyKeys(Object obj)
Returns the keys from the given object
|
boolean |
isArray(Object obj)
checks if object is an array
|
boolean |
isMap(Object obj)
checks if object is a map (i.e.
|
int |
length(Object obj)
Get the length of an array or object
|
void |
removeProperty(Object obj,
Object key)
Removes a value in an object or array
|
void |
setArrayIndex(Object array,
int index,
Object newValue)
Sets a value in an array.
|
void |
setProperty(Object obj,
Object key,
Object value)
Sets a value in an object
|
Iterable<? extends Object> |
toIterable(Object obj)
Converts given array to an
Iterable |
Object |
unwrap(Object obj)
Extracts a value from a wrapper object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateArray, createMap, parse, parse, toJsonpublic boolean isArray(Object obj)
isArray in interface JsonProviderobj - object to checkpublic Object getArrayIndex(Object obj, int idx)
getArrayIndex in interface JsonProviderobj - an arrayidx - indexpublic final Object getArrayIndex(Object obj, int idx, boolean unwrap)
JsonProvidergetArrayIndex in interface JsonProviderobj - an arrayidx - indexunwrap - should provider specific data type be unwrappedpublic void setArrayIndex(Object array, int index, Object newValue)
JsonProvidersetArrayIndex in interface JsonProviderarray - an arrayindex - indexnewValue - the new valuepublic Object getMapValue(Object obj, String key)
getMapValue in interface JsonProviderobj - a mapkey - property keyJsonProvider.UNDEFINED for missing propertiespublic void setProperty(Object obj, Object key, Object value)
setProperty in interface JsonProviderobj - an objectkey - a String keyvalue - the value to setpublic void removeProperty(Object obj, Object key)
removeProperty in interface JsonProviderobj - an array or an objectkey - a String key or a numerical index to removepublic boolean isMap(Object obj)
isMap in interface JsonProviderobj - object to checkpublic Collection<String> getPropertyKeys(Object obj)
getPropertyKeys in interface JsonProviderobj - an objectpublic int length(Object obj)
length in interface JsonProviderobj - an array or an objectpublic Iterable<? extends Object> toIterable(Object obj)
IterabletoIterable in interface JsonProviderobj - an arraypublic Object unwrap(Object obj)
JsonProviderunwrap in interface JsonProviderobj - a value holder objectCopyright © 2016. All rights reserved.