Package org.mapfish.print.output
Class Values
java.lang.Object
org.mapfish.print.output.Values
Values that go into a processor from previous processors in the processor processing graph.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The key that is used to storeMfClientHttpRequestFactoryProvider
.static final String
The key for the locale.static final String
The key for the MDC context of the current print job.static final String
The key for the output format.static final String
The key for the values object for thePDFConfig
object.static final String
The key for the values object for the subreport directory.static final String
The key that is used to store the task directory in the values map.static final String
The key that is used to storeTemplate
.static final String
The key for the values object of it self. -
Constructor Summary
ConstructorsConstructorDescriptionValues()
Constructor.Constructor.Values
(Map<String, String> mdcContext, PJsonObject requestData, Template template, File taskDirectory, MfClientHttpRequestFactoryImpl httpRequestFactory, File jasperTemplateBuild, int httpRequestMaxNumberFetchRetry, int httpRequestFetchRetryIntervalMillis) Construct from the json request body and the associated template.Values
(Map<String, String> mdcContext, PJsonObject requestData, Template template, File taskDirectory, MfClientHttpRequestFactoryImpl httpRequestFactory, File jasperTemplateBuild, String outputFormat, int httpRequestMaxNumberFetchRetry, int httpRequestFetchRetryIntervalMillis) Construct from the json request body and the associated template.Create a new instance and copy the required elements from the other values object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequiredValues
(Values sourceValues) Add the elements that all values objects require from the provided values object.asMap()
Get all parameters.boolean
containsKey
(String key) Return true if the identified value is present in this values.Find all the values of the requested type.getBoolean
(String key) Get a boolean value from the values or null.Get a value as a double.getInteger
(String key) Get a value as a integer.<V> V
Get a value as a object.Get a value as a string.getStringMap
(String key) Get a value as a Map from String to String.void
populateFromAttributes
(Template template, Map<String, Attribute> attributes, PObject requestJsonAttributes) Process the requestJsonAttributes using the attributes and the MapfishParser and add all resulting values to this values object.void
Put a new value in map.void
Remove a value from this object.toString()
-
Field Details
-
TASK_DIRECTORY_KEY
The key that is used to store the task directory in the values map.- See Also:
-
CLIENT_HTTP_REQUEST_FACTORY_KEY
The key that is used to storeMfClientHttpRequestFactoryProvider
.- See Also:
-
TEMPLATE_KEY
The key that is used to storeTemplate
.- See Also:
-
PDF_CONFIG_KEY
The key for the values object for thePDFConfig
object.- See Also:
-
OUTPUT_FORMAT_KEY
The key for the output format.- See Also:
-
SUBREPORT_DIR_KEY
The key for the values object for the subreport directory.- See Also:
-
MDC_CONTEXT_KEY
The key for the MDC context of the current print job.- See Also:
-
VALUES_KEY
The key for the values object of it self.- See Also:
-
LOCALE_KEY
The key for the locale.- See Also:
-
-
Constructor Details
-
Values
Constructor.- Parameters:
values
- initial values.
-
Values
public Values()Constructor. -
Values
public Values(@Nonnull Map<String, String> mdcContext, PJsonObject requestData, Template template, File taskDirectory, MfClientHttpRequestFactoryImpl httpRequestFactory, File jasperTemplateBuild, int httpRequestMaxNumberFetchRetry, int httpRequestFetchRetryIntervalMillis) Construct from the json request body and the associated template.- Parameters:
mdcContext
- the MDC contextrequestData
- the json request datatemplate
- the templatetaskDirectory
- the temporary directory for this printing task.httpRequestFactory
- a factory for making http requests.jasperTemplateBuild
- the directory where the jasper templates are compiled tohttpRequestMaxNumberFetchRetry
- the maximum number of times to retry fetching a resourcehttpRequestFetchRetryIntervalMillis
- the interval between retries
-
Values
public Values(@Nonnull Map<String, String> mdcContext, PJsonObject requestData, Template template, File taskDirectory, MfClientHttpRequestFactoryImpl httpRequestFactory, File jasperTemplateBuild, String outputFormat, int httpRequestMaxNumberFetchRetry, int httpRequestFetchRetryIntervalMillis) Construct from the json request body and the associated template.- Parameters:
mdcContext
- the MDC contextrequestData
- the json request datatemplate
- the templatetaskDirectory
- the temporary directory for this printing task.httpRequestFactory
- a factory for making http requests.jasperTemplateBuild
- the directory where the jasper templates are compiled tooutputFormat
- the output formathttpRequestMaxNumberFetchRetry
- the maximum number of times to retry fetching a resourcehttpRequestFetchRetryIntervalMillis
- the interval between retries
-
Values
Create a new instance and copy the required elements from the other values object. (IE working directory, http client factory, etc...)- Parameters:
values
- the values containing the required elements
-
-
Method Details
-
populateFromAttributes
public void populateFromAttributes(@Nonnull Template template, @Nonnull Map<String, Attribute> attributes, @Nonnull PObject requestJsonAttributes) Process the requestJsonAttributes using the attributes and the MapfishParser and add all resulting values to this values object.- Parameters:
template
- the template of the current request.attributes
- the attributes that will be used to add values to this values objectrequestJsonAttributes
- the json data for populating the attribute values
-
addRequiredValues
Add the elements that all values objects require from the provided values object.- Parameters:
sourceValues
- the values object containing the required elements
-
put
Put a new value in map.- Parameters:
key
- id of the value for looking up.value
- the value.
-
asMap
Get all parameters. -
getString
Get a value as a string.- Parameters:
key
- the key for looking up the value.
-
getDouble
Get a value as a double.- Parameters:
key
- the key for looking up the value.
-
getInteger
Get a value as a integer.- Parameters:
key
- the key for looking up the value.
-
getObject
Get a value as a object.- Type Parameters:
V
- the type- Parameters:
key
- the key for looking up the value.type
- the type of the object
-
getStringMap
Get a value as a Map from String to String.- Parameters:
key
- the key for looking up the value.
-
containsKey
Return true if the identified value is present in this values.- Parameters:
key
- the key to check for.
-
getBoolean
Get a boolean value from the values or null.- Parameters:
key
- the look up key of the value
-
remove
Remove a value from this object.- Parameters:
key
- key of entry to remove.
-
find
Find all the values of the requested type.- Type Parameters:
T
- the type of the value to find.- Parameters:
valueTypeToFind
- the type of the value to return.- Returns:
- the key, value pairs found.
-
toString
-