public final class Values
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLIENT_HTTP_REQUEST_FACTORY_KEY
The key that is used to store
MfClientHttpRequestFactoryProvider. |
static java.lang.String |
JOB_ID_KEY
The key for the reference ID.
|
static java.lang.String |
OUTPUT_FORMAT_KEY
The key for the output format.
|
static java.lang.String |
PDF_CONFIG_KEY
The key for the values object for the
PDFConfig object. |
static java.lang.String |
SUBREPORT_DIR_KEY
The key for the values object for the subreport directory.
|
static java.lang.String |
TASK_DIRECTORY_KEY
The key that is used to store the task directory in the values map.
|
static java.lang.String |
TEMPLATE_KEY
The key that is used to store
Template. |
static java.lang.String |
VALUES_KEY
The key for the values object of it self.
|
| Constructor and Description |
|---|
Values()
Constructor.
|
Values(java.util.Map<java.lang.String,java.lang.Object> values)
Constructor.
|
Values(java.lang.String jobId,
PJsonObject requestData,
Template template,
java.io.File taskDirectory,
MfClientHttpRequestFactoryImpl httpRequestFactory,
java.io.File jasperTemplateBuild)
Construct from the json request body and the associated template.
|
Values(java.lang.String jobId,
PJsonObject requestData,
Template template,
java.io.File taskDirectory,
MfClientHttpRequestFactoryImpl httpRequestFactory,
java.io.File jasperTemplateBuild,
java.lang.String outputFormat)
Construct from the json request body and the associated template.
|
Values(Values values)
Create a new instance and copy the required elements from the other values object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRequiredValues(Values sourceValues)
Add the elements that all values objects require from the provided values object.
|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Get all parameters.
|
boolean |
containsKey(java.lang.String key)
Return true if the identified value is present in this values.
|
<T> java.util.Map<java.lang.String,T> |
find(java.lang.Class<T> valueTypeToFind)
Find all the values of the requested type.
|
java.lang.Boolean |
getBoolean(java.lang.String key)
Get a boolean value from the values or null.
|
java.lang.Double |
getDouble(java.lang.String key)
Get a value as a double.
|
java.lang.Integer |
getInteger(java.lang.String key)
Get a value as a integer.
|
<V> V |
getObject(java.lang.String key,
java.lang.Class<V> type)
Get a value as a string.
|
java.lang.String |
getString(java.lang.String key)
Get a value as a string.
|
void |
populateFromAttributes(Template template,
java.util.Map<java.lang.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(java.lang.String key,
java.lang.Object value)
Put a new value in map.
|
void |
remove(java.lang.String key)
Remove a value from this object.
|
java.lang.String |
toString() |
public static final java.lang.String TASK_DIRECTORY_KEY
public static final java.lang.String CLIENT_HTTP_REQUEST_FACTORY_KEY
MfClientHttpRequestFactoryProvider.public static final java.lang.String TEMPLATE_KEY
Template.public static final java.lang.String PDF_CONFIG_KEY
PDFConfig object.public static final java.lang.String OUTPUT_FORMAT_KEY
public static final java.lang.String SUBREPORT_DIR_KEY
public static final java.lang.String JOB_ID_KEY
public static final java.lang.String VALUES_KEY
public Values(java.util.Map<java.lang.String,java.lang.Object> values)
values - initial values.public Values()
public Values(java.lang.String jobId,
PJsonObject requestData,
Template template,
java.io.File taskDirectory,
MfClientHttpRequestFactoryImpl httpRequestFactory,
java.io.File jasperTemplateBuild)
throws org.json.JSONException
jobId - the job IDrequestData - 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 toorg.json.JSONExceptionpublic Values(java.lang.String jobId,
PJsonObject requestData,
Template template,
java.io.File taskDirectory,
MfClientHttpRequestFactoryImpl httpRequestFactory,
java.io.File jasperTemplateBuild,
java.lang.String outputFormat)
throws org.json.JSONException
jobId - the job IDrequestData - 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 formatorg.json.JSONExceptionpublic Values(@Nonnull
Values values)
values - the values containing the required elementspublic void populateFromAttributes(@Nonnull
Template template,
@Nonnull
java.util.Map<java.lang.String,Attribute> attributes,
@Nonnull
PObject requestJsonAttributes)
throws org.json.JSONException
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 valuesorg.json.JSONExceptionpublic void addRequiredValues(@Nonnull
Values sourceValues)
sourceValues - the values object containing the required elementspublic void put(java.lang.String key,
java.lang.Object value)
key - id of the value for looking up.value - the value.public java.util.Map<java.lang.String,java.lang.Object> asMap()
public java.lang.String getString(java.lang.String key)
key - the key for looking up the value.public java.lang.Double getDouble(java.lang.String key)
key - the key for looking up the value.public java.lang.Integer getInteger(java.lang.String key)
key - the key for looking up the value.public <V> V getObject(java.lang.String key,
java.lang.Class<V> type)
V - the typekey - the key for looking up the value.type - the type of the objectpublic boolean containsKey(java.lang.String key)
key - the key to check for.@Nullable
public java.lang.Boolean getBoolean(@Nonnull
java.lang.String key)
key - the look up key of the valuepublic void remove(java.lang.String key)
key - key of entry to remove.public <T> java.util.Map<java.lang.String,T> find(java.lang.Class<T> valueTypeToFind)
T - the type of the value to find.valueTypeToFind - the type of the value to return.public java.lang.String toString()
toString in class java.lang.Object