Class Values

java.lang.Object
org.mapfish.print.output.Values

public final class Values extends Object
Values that go into a processor from previous processors in the processor processing graph.
  • Field Details

  • Constructor Details

    • Values

      public Values(Map<String,Object> 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 context
      requestData - the json request data
      template - the template
      taskDirectory - the temporary directory for this printing task.
      httpRequestFactory - a factory for making http requests.
      jasperTemplateBuild - the directory where the jasper templates are compiled to
      httpRequestMaxNumberFetchRetry - the maximum number of times to retry fetching a resource
      httpRequestFetchRetryIntervalMillis - 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 context
      requestData - the json request data
      template - the template
      taskDirectory - the temporary directory for this printing task.
      httpRequestFactory - a factory for making http requests.
      jasperTemplateBuild - the directory where the jasper templates are compiled to
      outputFormat - the output format
      httpRequestMaxNumberFetchRetry - the maximum number of times to retry fetching a resource
      httpRequestFetchRetryIntervalMillis - the interval between retries
    • Values

      public Values(@Nonnull Values 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 object
      requestJsonAttributes - the json data for populating the attribute values
    • addRequiredValues

      public void addRequiredValues(@Nonnull Values sourceValues)
      Add the elements that all values objects require from the provided values object.
      Parameters:
      sourceValues - the values object containing the required elements
    • put

      public void put(String key, Object value)
      Put a new value in map.
      Parameters:
      key - id of the value for looking up.
      value - the value.
    • asMap

      public Map<String,Object> asMap()
      Get all parameters.
    • getString

      public String getString(String key)
      Get a value as a string.
      Parameters:
      key - the key for looking up the value.
    • getDouble

      public Double getDouble(String key)
      Get a value as a double.
      Parameters:
      key - the key for looking up the value.
    • getInteger

      public Integer getInteger(String key)
      Get a value as a integer.
      Parameters:
      key - the key for looking up the value.
    • getObject

      public <V> V getObject(String key, Class<V> type)
      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

      public Map<String,String> getStringMap(String key)
      Get a value as a Map from String to String.
      Parameters:
      key - the key for looking up the value.
    • containsKey

      public boolean containsKey(String key)
      Return true if the identified value is present in this values.
      Parameters:
      key - the key to check for.
    • getBoolean

      @Nullable public Boolean getBoolean(@Nonnull String key)
      Get a boolean value from the values or null.
      Parameters:
      key - the look up key of the value
    • remove

      public void remove(String key)
      Remove a value from this object.
      Parameters:
      key - key of entry to remove.
    • find

      public <T> Map<String,T> find(Class<T> valueTypeToFind)
      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

      public String toString()
      Overrides:
      toString in class Object