| Constructor and Description |
|---|
MapExtractor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSetValue()
Whether this extractor is able to set a value.
|
Object |
extractObject(ObjectToJsonConverter pConverter,
Object pValue,
Stack<String> pPathParts,
boolean jsonify)
Convert a Map to JSON (if
jsonify is true). |
Class |
getType()
Type for which this extractor can objects of this type
|
Object |
setObjectValue(StringToObjectConverter pConverter,
Object pMap,
String pKey,
Object pValue)
Set the value within a map, where the attribute is taken as key into the map.
|
public Class getType()
public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify) throws AttributeNotFoundException
jsonify is true). If a path is used, the
path is interpreted as a key into the map. The key in the path is a string and is compared agains
all keys in the map against their string representation.extractObject in interface ExtractorpConverter - the global converter in order to be able do dispatch for
serializing inner data typespValue - the value to convert which must be a MappPathParts - extra argument stack which on top must be a key into the mapjsonify - whether to convert to a JSON object/list or whether the plain object
should be returned. The later is required for writing an inner valueAttributeNotFoundExceptionpublic Object setObjectValue(StringToObjectConverter pConverter, Object pMap, String pKey, Object pValue) throws IllegalAccessException, InvocationTargetException
setObjectValue in interface ExtractorpConverter - the global converter in order to be able do dispatch for
serializing inner data typespMap - map on which to set the valuepKey - key in the map where to put the valuepValue - the new value to setnull if a new map entry was created/IllegalAccessExceptionInvocationTargetExceptionpublic boolean canSetValue()
canSetValue in interface ExtractorCopyright © 2019. All rights reserved.