Class AbstractProcessor<IN,​OUT>

    • 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
    • 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 interface Processor<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 interface Processor<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 interface Processor<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 interface Processor<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.
        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
                                         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 interface Processor<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 interface ConfigurationObject
        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 class java.lang.Object