Package org.mapfish.print.parser
Class MapfishParser
java.lang.Object
org.mapfish.print.parser.MapfishParser
This class parses json parameter objects into the parameter object taken by
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)
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
parse
(boolean errorOnExtraProperties, PObject requestData, Object objectToPopulate, String... extraPropertyToIgnore) Populate the param object by obtaining the values from the like names values in the request data object.static Object
parsePrimitive
(String fieldName, PrimitiveAttribute<?> pAtt, PObject requestData) Get the value of a primitive type from the request data.static String
stringRepresentation
(Class<?> aClass) Return a friendly representation of the class for printing the configuration options to a client.
-
Field Details
-
POST_CONSTRUCT_METHOD_NAME
- See Also:
-
-
Method Details
-
parse
public static void parse(boolean errorOnExtraProperties, PObject requestData, Object objectToPopulate, String... extraPropertyToIgnore) Populate the param object by obtaining the values from the like names values in the request data object.- Parameters:
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 forMapAttribute
to be able to choose the correct plugin.
-
parsePrimitive
public static Object parsePrimitive(String fieldName, PrimitiveAttribute<?> pAtt, PObject requestData) Get the value of a primitive type from the request data.- Parameters:
fieldName
- the name of the attribute to get from the request data.pAtt
- the primitive attribute.requestData
- the data to retrieve the value from.
-
stringRepresentation
Return a friendly representation of the class for printing the configuration options to a client.- Parameters:
aClass
- the class to inspect
-