Class AbstractProcessor<IN,OUT>

java.lang.Object
org.mapfish.print.processor.AbstractProcessor<IN,OUT>
Type Parameters:
IN - A Java bean input parameter object of the execute method. Object is populated from the Values object.
OUT - A Java bean output/return object from the execute method. properties will be put into the Values object so other processor can access the values.
All Implemented Interfaces:
ConfigurationObject, Processor<IN,OUT>
Direct Known Subclasses:
AbstractClientHttpRequestFactoryProcessor, AddStaticLayersProcessor, CompositeClientHttpRequestFactoryProcessor, CreateMapPagesProcessor, CreateMapProcessor, CreateNorthArrowProcessor, CreateOverviewMapProcessor, CreateScalebarProcessor, DataSourceProcessor, DateFormatProcessor, ForwardHeadersProcessor, JasperReportBuilder, LegendProcessor, MergeDataSourceProcessor, PdfConfigurationProcessor, SetFeaturesProcessor, SetStyleProcessor, SetTiledWmsProcessor, SetWmsCustomParamProcessor, TableProcessor

public abstract class AbstractProcessor<IN,OUT> extends Object implements Processor<IN,OUT>
Basic functionality of a processor. Mostly utility methods.
  • Constructor Details

    • AbstractProcessor

      protected AbstractProcessor(Class<OUT> outputType)
      Constructor.
      Parameters:
      outputType - the type of the output of this processor. Used to calculate processor dependencies.
  • Method Details

    • getOutputType

      public final Class<OUT> getOutputType()
      Description copied from interface: Processor
      Get the class of the output type. This is used when determining the outputs this processor produces.

      The public fields of the Processor will be the output of the processor and thus can be mapped to inputs of another processor.

      Specified by:
      getOutputType in interface Processor<IN,OUT>
    • getInputMapperBiMap

      @Nonnull public final com.google.common.collect.BiMap<String,String> getInputMapperBiMap()
      Description copied from interface: Processor
      Map the variable names to the processor inputs.
      Specified by:
      getInputMapperBiMap in interface Processor<IN,OUT>
    • setPrefix

      public final void setPrefix(String prefix)
      The prefix to apply to each value. This provides a simple way to make all input and output values have unique values.
      Parameters:
      prefix - the new prefix
    • getInputPrefix

      public final String getInputPrefix()
      Description copied from interface: Processor
      Get the prefix to apply to each input value. This provides a simple way to make all output values have unique values.

      If input prefix is non-null and non-empty (whitespace is removed) then the prefix will be prepended to the normal name of the input value.

      When a prefix is appended the normal name will be capitalized. For example: if the normal name is: map and the prefix is page1 then the final name will be page1Map.

      Note: If a mapping is in the Processor.getInputMapperBiMap() then the prefix will be ignored for that value and the un-prefixed name from the input mapper will be used directly.

      Note: If a prefix has white space at the start or end it will be removed.

      Specified by:
      getInputPrefix in interface Processor<IN,OUT>
    • setInputPrefix

      public final void setInputPrefix(String inputPrefix)
      The prefix to apply to each input value. This provides a simple way to make all input values have unique values.
      Parameters:
      inputPrefix - the new prefix
    • getOutputPrefix

      public final String getOutputPrefix()
      Description copied from interface: Processor
      Get the prefix to apply to each output value. This provides a simple way to make all output values have unique values.

      If output prefix is non-null and non-empty (whitespace is removed) then the prefix will be prepended to the normal name of the output value.

      When a prefix is appended the normal name will be capitalized. For example: if the normal name is: map and the prefix is page1 then the final name will be page1Map.

      Note: If a mapping is in the Processor.getOutputMapperBiMap() then the prefix will be ignored for that value and the un-prefixed name from the output mapper will be used directly.

      Note: If a prefix has white space at the start or end it will be removed.

      Specified by:
      getOutputPrefix in interface Processor<IN,OUT>
    • setOutputPrefix

      public final void setOutputPrefix(String outputPrefix)
      The prefix to apply to each output value. This provides a simple way to make all output values have unique values.
      Parameters:
      outputPrefix - the new prefix
    • toString

      public void toString(StringBuilder builder, int indent, String parent)
      Description copied from interface: Processor
      Create a string representing this processor.
      Specified by:
      toString in interface Processor<IN,OUT>
      Parameters:
      builder - the builder to add the string to.
      indent - the number of steps of indent for this node
      parent - the parent node's name
    • setInputMapper

      public final void setInputMapper(@Nonnull Map<String,String> inputMapper)
      The input mapper. See "Processors" to know more. Example:
      
       inputMapper: {attributeName: defaultInputParamName}
       
      Parameters:
      inputMapper - the values.
    • getOutputMapperBiMap

      @Nonnull public final com.google.common.collect.BiMap<String,String> getOutputMapperBiMap()
      Description copied from interface: Processor
      Map output from processor to the variable in the Jasper Report.
      Specified by:
      getOutputMapperBiMap in interface Processor<IN,OUT>
    • setOutputMapper

      public final void setOutputMapper(@Nonnull Map<String,String> outputMapper)
      The output mapper. See "Processors" to know more. Example:
      
       outputMapper: {defaultOutputName: templateParamName}
       
      Parameters:
      outputMapper - the values.
    • validate

      public final void validate(List<Throwable> errors, Configuration configuration)
      Description copied from interface: ConfigurationObject
      validate that the configuration was correct.
      Specified by:
      validate in interface ConfigurationObject
      Parameters:
      errors - a list to add any detected errors to.
      configuration - the containing configuration
    • extraValidation

      protected abstract void extraValidation(List<Throwable> validationErrors, Configuration configuration)
      Perform any extra validation a subclass may need to perform.
      Parameters:
      validationErrors - a list to add errors to so that all validation errors are reported as one.
      configuration - the containing configuration
    • toString

      public String toString()
      Overrides:
      toString in class Object