public class JsonIdMap extends IdMap implements IdMapDecoder
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS
The Constant CLASS.
|
protected Grammar |
grammar |
static java.lang.String |
JSON_PROPS
The Constant JSON_PROPS.
|
static java.lang.String |
MAINITEM
The Constant MAINITEM.
|
protected boolean |
typSave
If this is true the IdMap save the Typ of primary datatypes.
|
static java.lang.String |
VALUE
The Constant VALUE.
|
COLLISION, filter, ID, ITEMS, keyValue, logger, NEW, PRIO, REMOVE, SENDUPDATE, UPDATE, updateListener, updatePropertylistenercreators| Constructor and Description |
|---|
JsonIdMap()
Instantiates a new json id map.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
decode(BaseItem value)
Read Json Automatic create JsonArray or JsonObject
|
java.lang.Object |
decode(JsonArray jsonArray)
Read json.
|
java.lang.Object |
decode(JsonObject jsonObject)
Read json.
|
java.lang.Object |
decode(java.lang.Object target,
JsonObject jsonObject)
Read json.
|
java.lang.Object |
decode(java.lang.Object target,
JsonObject jsonObject,
Filter filter)
Read json.
|
java.lang.Object |
decode(java.lang.String value)
Read Json Automatic create JsonArray or JsonObject
|
protected java.lang.Object |
decoding(java.lang.Object target,
JsonObject jsonObject,
Filter filter)
Read json.
|
JsonObject |
encode(java.lang.Object entity)
Encode.
|
JsonObject |
encode(java.lang.Object entity,
Filter filter)
Encode.
|
boolean |
executeUpdateMsg(JsonObject element)
Execute update msg.
|
void |
garbageCollection(java.util.List<java.lang.String> classCounts) |
java.lang.String |
getId(java.lang.Object obj)
Gets or Create the id.
|
protected java.lang.Object |
parseItem(java.lang.Object item,
Filter filter,
java.lang.Object entity,
java.lang.String property,
JsonArray jsonArray,
java.lang.String className,
int deep) |
protected java.lang.Object |
parseProperty(SendableEntityCreator prototyp,
java.lang.Object entity,
Filter filter,
java.lang.String className,
java.lang.String property,
JsonArray jsonArray,
int deep) |
protected void |
parseValue(java.lang.Object target,
java.lang.String property,
java.lang.Object value,
SendableEntityCreator creator,
Filter filter)
Parses the value.
|
JsonArray |
toJsonArray(java.lang.Object object)
To json array.
|
JsonArray |
toJsonArray(java.lang.Object object,
Filter filter)
Convert to JsonArray in the resource
|
JsonArray |
toJsonArray(java.lang.Object object,
JsonArray jsonArray,
Filter filter)
To json sorted array.
|
protected JsonArray |
toJsonArray(java.lang.Object entity,
JsonArray jsonArray,
Filter filter,
int deep) |
void |
toJsonArrayByIds(java.util.ArrayList<java.lang.String> suspendIdList)
To json array by ids.
|
JsonObject |
toJsonObject(java.lang.Object object)
To json object.
|
JsonObject |
toJsonObject(java.lang.Object entity,
Filter filter)
To Jsonobject.
|
protected JsonObject |
toJsonObject(java.lang.Object entity,
Filter filter,
java.lang.String className,
int deep)
To Jsonobject.
|
JsonObject |
toJsonObjectById(java.lang.String id)
To json object by id.
|
java.lang.String |
toString() |
JsonIdMap |
withGrammar(Grammar value) |
JsonIdMap |
withTypSave(boolean typSave)
Sets the typ save.
|
IdMap |
withUpdateListener(java.beans.PropertyChangeListener listener) |
JsonIdMap |
withUpdateListenerRead(UpdateListener listener)
Sets the update msg listener.
|
JsonIdMap |
withUpdateListenerSend(UpdateListener listener)
Sets the update msg listener.
|
addListener, clear, cloneObject, containsKey, containsValue, entrySet, garbageCollection, get, getCounter, getKey, getKeyValue, getLogger, getObject, getTypList, getUpdateListener, isCaseSensitive, isEmpty, keySet, put, putAll, remove, removeObj, replaceObject, size, startCarbageCollection, startUpdateModell, values, withCaseSensitive, withCounter, withCreator, withFilter, withIdListener, withKeyValue, withLogger, withSessionIdgetCreator, getCreatorClass, iterator, removeCreator, withCreator, withCreator, withCreatorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final java.lang.String CLASS
public static final java.lang.String VALUE
public static final java.lang.String JSON_PROPS
public static final java.lang.String MAINITEM
protected Grammar grammar
protected boolean typSave
public JsonObject toJsonObject(java.lang.Object object)
object - the objectpublic JsonObject toJsonObject(java.lang.Object entity, Filter filter)
entity - the entityfilter - the filterprotected JsonObject toJsonObject(java.lang.Object entity, Filter filter, java.lang.String className, int deep)
entity - the entity to convertfilter - the filterclassName - the className of the entitydeep - the deep of model-levelpublic java.lang.String getId(java.lang.Object obj)
IdMapprotected java.lang.Object parseProperty(SendableEntityCreator prototyp, java.lang.Object entity, Filter filter, java.lang.String className, java.lang.String property, JsonArray jsonArray, int deep)
protected java.lang.Object parseItem(java.lang.Object item,
Filter filter,
java.lang.Object entity,
java.lang.String property,
JsonArray jsonArray,
java.lang.String className,
int deep)
public JsonObject encode(java.lang.Object entity)
public JsonObject encode(java.lang.Object entity, Filter filter)
public java.lang.Object decode(java.lang.String value)
decode in interface IdMapDecoderpublic java.lang.Object decode(BaseItem value)
decode in interface IdMapDecoderpublic java.lang.Object decode(JsonArray jsonArray)
jsonArray - the json arraypublic java.lang.Object decode(JsonObject jsonObject)
jsonObject - the json objectpublic java.lang.Object decode(java.lang.Object target,
JsonObject jsonObject)
target - the targetjsonObject - the json objectpublic java.lang.Object decode(java.lang.Object target,
JsonObject jsonObject,
Filter filter)
target - the targetjsonObject - the json objectfilter - the filter for decodingprotected java.lang.Object decoding(java.lang.Object target,
JsonObject jsonObject,
Filter filter)
target - the targetjsonObject - the json objectfilter - the filter for decodingprotected void parseValue(java.lang.Object target,
java.lang.String property,
java.lang.Object value,
SendableEntityCreator creator,
Filter filter)
target - the targetproperty - the propertyvalue - the valuecreator - the creatorfilter - the filterpublic JsonArray toJsonArray(java.lang.Object object)
object - the objectpublic JsonArray toJsonArray(java.lang.Object object, Filter filter)
object - the objectfilter - the filterpublic JsonArray toJsonArray(java.lang.Object object, JsonArray jsonArray, Filter filter)
object - the objectjsonArray - the listfilter - the Filter for split serialisationprotected JsonArray toJsonArray(java.lang.Object entity, JsonArray jsonArray, Filter filter, int deep)
public JsonIdMap withUpdateListenerRead(UpdateListener listener)
listener - the new update msg listenerpublic JsonIdMap withUpdateListenerSend(UpdateListener listener)
listener - the new update msg listenerpublic IdMap withUpdateListener(java.beans.PropertyChangeListener listener)
withUpdateListener in class IdMappublic JsonObject toJsonObjectById(java.lang.String id)
id - the idpublic void toJsonArrayByIds(java.util.ArrayList<java.lang.String> suspendIdList)
suspendIdList - the suspend id listpublic boolean executeUpdateMsg(JsonObject element)
element - the elementpublic void garbageCollection(java.util.List<java.lang.String> classCounts)
public java.lang.String toString()
toString in class java.lang.Objectpublic JsonIdMap withGrammar(Grammar value)
value - Gammar valuepublic JsonIdMap withTypSave(boolean typSave)
typSave - the new typ save