| Constructor and Description |
|---|
ArrayExtractor() |
| 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)
Extract an array and, if to be jsonified, put it into an
JSONArray. |
Class |
getType()
Type for which this extractor can objects of this type
|
Object |
setObjectValue(StringToObjectConverter pConverter,
Object pInner,
String pIndex,
Object pValue)
Set a value in an array
|
public Class getType()
public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify) throws AttributeNotFoundException
JSONArray. An index can be used (on top of
the extra args stack) in order to specify a single value within the array.extractObject in interface ExtractorpConverter - the global converter in order to be able do dispatch for
serializing inner data typespValue - the value to convert (must be an aary)pPathParts - extra arguments stack, which is popped to get an index for extracting a single element
of the arrayjsonify - whether to convert to a JSON object/list or whether the plain object
should be returned. The later is required for writing an inner valueAttributeNotFoundExceptionIndexOutOfBoundsException - if an index is used which points outside the given listpublic Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue) throws IllegalAccessException, InvocationTargetException
setObjectValue in interface ExtractorpConverter - the global converter in order to be able do dispatch for
serializing inner data typespInner - object on which to set the value (which must be a List)pIndex - index (as string) where to set the value within the arraypValue - the new value to setIllegalAccessExceptionInvocationTargetExceptionpublic boolean canSetValue()
canSetValue in interface ExtractorCopyright © 2019. All rights reserved.