Constructor and Description |
---|
ListExtractor() |
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 a list 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 within a list
|
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 list.extractObject
in interface Extractor
pConverter
- the global converter in order to be able do dispatch for
serializing inner data typespValue
- the value to convert (must be a List
)pPathParts
- extra arguments stack, which is popped to get an index for extracting a single element
of the listjsonify
- whether to convert to a JSON object/list or whether the plain object
should be returned. The later is required for writing an inner valueAttributeNotFoundException
IndexOutOfBoundsException
- 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 Extractor
pConverter
- 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 listpValue
- the new value to setIllegalAccessException
InvocationTargetException
public boolean canSetValue()
canSetValue
in interface Extractor
Copyright © 2016. All rights reserved.