public final class MapfishParser
extends java.lang.Object
MapLayerFactoryPlugin instances and into
ReflectiveAttribute
value objects
Essentially it maps the keys in the json object to public fields in the object obtained from the MapLayerFactoryPlugin.createParameter() method.
There is a more explicit explanation in
ReflectiveAttribute.createValue(org.mapfish.print.config.Template)ReflectiveAttribute,
MapLayerFactoryPlugin| Modifier and Type | Method and Description |
|---|---|
static void |
parse(boolean errorOnExtraProperties,
PObject requestData,
java.lang.Object objectToPopulate,
java.lang.String... extraPropertyToIgnore)
Populate the param object by obtaining the values from the like names values in the request data
object.
|
static java.lang.Object |
parsePrimitive(java.lang.String fieldName,
PrimitiveAttribute<?> pAtt,
PObject requestData)
Get the value of a primitive type from the request data.
|
static java.lang.String |
stringRepresentation(java.lang.Class<?> aClass)
Return a friendly representation of the class for printing the configuration options to a client.
|
public static void parse(boolean errorOnExtraProperties,
PObject requestData,
java.lang.Object objectToPopulate,
java.lang.String... extraPropertyToIgnore)
errorOnExtraProperties - if true then throw an error when there are properties in the
request data that are not in the param. Otherwise log them as a warning.requestData - the layer configuration json.objectToPopulate - the parameter object that will be passed to the layer factory or is the
attribute value.extraPropertyToIgnore - An array of properties to ignore in request data. For example
Layers do not need "type" but the property has to be there for MapAttribute to be able to choose the correct plugin.public static java.lang.Object parsePrimitive(java.lang.String fieldName,
PrimitiveAttribute<?> pAtt,
PObject requestData)
fieldName - the name of the attribute to get from the request data.pAtt - the primitive attribute.requestData - the data to retrieve the value from.public static java.lang.String stringRepresentation(java.lang.Class<?> aClass)
aClass - the class to inspect