public abstract class AbstractJsonProvider extends Object implements JsonProvider
Constructor and Description |
---|
AbstractJsonProvider() |
Modifier and Type | Method and Description |
---|---|
Object |
clone(Object obj) |
Object |
getProperty(Object obj,
Object key)
Extracts a value from an object or array
|
Collection<String> |
getPropertyKeys(Object obj)
Returns the keys from the given object or the indexes from an array
|
boolean |
isArray(Object obj)
checks if object is an array
|
boolean |
isContainer(Object obj)
checks if object is a map or 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 |
setProperty(Object obj,
Object key,
Object value)
Sets a value in an object or array
|
Iterable<Object> |
toIterable(Object obj)
Converts given object to an
Iterable |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createArray, createMap, getMode, parse, parse, parse, toJson
public Object clone(Object obj)
clone
in interface JsonProvider
public boolean isContainer(Object obj)
isContainer
in interface JsonProvider
obj
- object to checkpublic boolean isArray(Object obj)
isArray
in interface JsonProvider
obj
- object to checkpublic Object getProperty(Object obj, Object key)
getProperty
in interface JsonProvider
obj
- an array or an objectkey
- a String key or a numerical indexpublic void setProperty(Object obj, Object key, Object value)
setProperty
in interface JsonProvider
obj
- an array or an objectkey
- a String key or a numerical indexvalue
- the value to setpublic boolean isMap(Object obj)
isMap
in interface JsonProvider
obj
- object to checkpublic Collection<String> getPropertyKeys(Object obj)
getPropertyKeys
in interface JsonProvider
obj
- an array or an objectpublic int length(Object obj)
length
in interface JsonProvider
obj
- an array or an objectpublic Iterable<Object> toIterable(Object obj)
Iterable
toIterable
in interface JsonProvider
obj
- an array or an objectCopyright © 2011–2014. All rights reserved.