public class CollectionExtractor extends Object implements Extractor
MapExtractor or ArrayExtractor).| Constructor and Description |
|---|
CollectionExtractor() |
| 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)
Converts a collection to an JSON array.
|
Class |
getType()
Type for which this extractor can objects of this type
|
Object |
setObjectValue(StringToObjectConverter pConverter,
Object pInner,
String pAttribute,
Object pValue)
Setting of an object value is not supported for the collection converter
|
public Class getType()
public Object extractObject(ObjectToJsonConverter pConverter, Object pValue, Stack<String> pPathParts, boolean jsonify) throws AttributeNotFoundException
extractObject in interface ExtractorpConverter - the global converter in order to be able do dispatch for
serializing inner data typespValue - the value to convertpPathParts - extra arguments which contain e.g. a path. The path is ignored here.jsonify - 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 - if the inner path does not exist.public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, 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 valuepAttribute - attribute of the object to setpValue - the new value to setIllegalAccessException - if the attribute to set to is not accessibleInvocationTargetException - reflection errorpublic boolean canSetValue()
canSetValue in interface ExtractorCopyright © 2017. All rights reserved.