Package org.mapfish.print.parser
Class MapfishParser
- java.lang.Object
-
- org.mapfish.print.parser.MapfishParser
-
public final class MapfishParser extends java.lang.Object
This class parses json parameter objects into the parameter object taken byMapLayerFactoryPlugin
instances and intoReflectiveAttribute
value objectsEssentially 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:
ReflectiveAttribute
,MapLayerFactoryPlugin
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
POST_CONSTRUCT_METHOD_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
POST_CONSTRUCT_METHOD_NAME
public static final java.lang.String POST_CONSTRUCT_METHOD_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
public 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.- 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 java.lang.Object parsePrimitive(java.lang.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
public static java.lang.String stringRepresentation(java.lang.Class<?> aClass)
Return a friendly representation of the class for printing the configuration options to a client.- Parameters:
aClass
- the class to inspect
-
-