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 theValues
object.OUT
- A Java bean output/return object from the execute method. properties will be put into theValues
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 java.lang.Object implements Processor<IN,OUT>
Basic functionality of a processor. Mostly utility methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractProcessor.Context
Default implementation ofProcessor.ExecutionContext
.-
Nested classes/interfaces inherited from interface org.mapfish.print.processor.Processor
Processor.ExecutionContext
-
-
Field Summary
-
Fields inherited from interface org.mapfish.print.processor.Processor
MDC_APPLICATION_ID_KEY, MDC_JOB_ID_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractProcessor(java.lang.Class<OUT> outputType)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
extraValidation(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
Perform any extra validation a subclass may need to perform.com.google.common.collect.BiMap<java.lang.String,java.lang.String>
getInputMapperBiMap()
Map the variable names to the processor inputs.java.lang.String
getInputPrefix()
Get the prefix to apply to each input value.com.google.common.collect.BiMap<java.lang.String,java.lang.String>
getOutputMapperBiMap()
Map output from processor to the variable in the Jasper Report.java.lang.String
getOutputPrefix()
Get the prefix to apply to each output value.java.lang.Class<OUT>
getOutputType()
Get the class of the output type.void
setInputMapper(java.util.Map<java.lang.String,java.lang.String> inputMapper)
The input mapper.void
setInputPrefix(java.lang.String inputPrefix)
The prefix to apply to each input value.void
setOutputMapper(java.util.Map<java.lang.String,java.lang.String> outputMapper)
The output mapper.void
setOutputPrefix(java.lang.String outputPrefix)
The prefix to apply to each output value.void
setPrefix(java.lang.String prefix)
The prefix to apply to each value.java.lang.String
toString()
void
toString(java.lang.StringBuilder builder, int indent, java.lang.String parent)
Create a string representing this processor.void
validate(java.util.List<java.lang.Throwable> errors, Configuration configuration)
validate that the configuration was correct.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.mapfish.print.processor.Processor
createInputParameter, execute
-
-
-
-
Constructor Detail
-
AbstractProcessor
protected AbstractProcessor(java.lang.Class<OUT> outputType)
Constructor.- Parameters:
outputType
- the type of the output of this processor. Used to calculate processor dependencies.
-
-
Method Detail
-
getOutputType
public final java.lang.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 interfaceProcessor<IN,OUT>
-
getInputMapperBiMap
@Nonnull public final com.google.common.collect.BiMap<java.lang.String,java.lang.String> getInputMapperBiMap()
Description copied from interface:Processor
Map the variable names to the processor inputs.- Specified by:
getInputMapperBiMap
in interfaceProcessor<IN,OUT>
-
setPrefix
public final void setPrefix(java.lang.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 java.lang.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 interfaceProcessor<IN,OUT>
-
setInputPrefix
public final void setInputPrefix(java.lang.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 java.lang.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 interfaceProcessor<IN,OUT>
-
setOutputPrefix
public final void setOutputPrefix(java.lang.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(java.lang.StringBuilder builder, int indent, java.lang.String parent)
Description copied from interface:Processor
Create a string representing this processor.
-
setInputMapper
public final void setInputMapper(@Nonnull java.util.Map<java.lang.String,java.lang.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<java.lang.String,java.lang.String> getOutputMapperBiMap()
Description copied from interface:Processor
Map output from processor to the variable in the Jasper Report.- Specified by:
getOutputMapperBiMap
in interfaceProcessor<IN,OUT>
-
setOutputMapper
public final void setOutputMapper(@Nonnull java.util.Map<java.lang.String,java.lang.String> outputMapper)
The output mapper. See "Processors" to know more. Example:outputMapper: {defaultOutputName: templateParamName}
- Parameters:
outputMapper
- the values.
-
validate
public final void validate(java.util.List<java.lang.Throwable> errors, Configuration configuration)
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Specified by:
validate
in interfaceConfigurationObject
- Parameters:
errors
- a list to add any detected errors to.configuration
- the containing configuration
-
extraValidation
protected abstract void extraValidation(java.util.List<java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-