Class ProcessorUtils

java.lang.Object
org.mapfish.print.processor.ProcessorUtils

public final class ProcessorUtils extends Object
Shared methods for working with processor.
  • Method Details

    • populateInputParameter

      public static <IN, OUT> IN populateInputParameter(Processor<IN,OUT> processor, @Nonnull Values values)
      Create the input object required by the processor and populate all the fields from the values object.

      If Processor.createInputParameter() returns an instance of values then the values object will be returned.

      Type Parameters:
      IN - type of the processor input object
      OUT - type of the processor output object
      Parameters:
      processor - the processor that the input object will be for.
      values - the object containing the values to put into the input object
    • writeProcessorOutputToValues

      public static void writeProcessorOutputToValues(Object output, Processor<?,?> processor, Values values)
      Read the values from the output object and write them to the values object.
      Parameters:
      output - the output object from a processor
      processor - the processor the output if from
      values - the object for sharing values between processors
    • getInputValueName

      public static String getInputValueName(@Nullable String inputPrefix, @Nonnull com.google.common.collect.BiMap<String,String> inputMapper, @Nonnull String field)
      Calculate the name of the input value.
      Parameters:
      inputPrefix - a nullable prefix to prepend to the name if non-null and non-empty
      inputMapper - the name mapper
      field - the field containing the value
    • getOutputValueName

      public static String getOutputValueName(@Nullable String outputPrefix, @Nonnull Map<String,String> outputMapper, @Nonnull Field field)
      Calculate the name of the output value.
      Parameters:
      outputPrefix - a nullable prefix to prepend to the name if non-null and non-empty
      outputMapper - the name mapper
      field - the field containing the value