public final class JasperReportBuilder extends AbstractProcessor<JasperReportBuilder.Input,java.lang.Void> implements HasConfiguration
A processor that actually compiles a JasperReport template file.
Example
processors:
- !reportBuilder # compile all reports in current directory
directory: '.'
[[examples=verboseExample]]| Modifier and Type | Class and Description |
|---|---|
static class |
JasperReportBuilder.Input
The input parameter object for
JasperReportBuilder. |
AbstractProcessor.ContextProcessor.ExecutionContext| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JASPER_REPORT_COMPILED_FILE_EXT
Extension for Compiled Jasper Report Template files.
|
static java.lang.String |
JASPER_REPORT_XML_FILE_EXT
Extension for Jasper XML Report Template files.
|
MDC_JOB_ID_KEY| Modifier | Constructor and Description |
|---|---|
protected |
JasperReportBuilder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
JasperReportBuilder.Input |
createInputParameter()
Returns a new/clean instance of a parameter object.
|
java.lang.Void |
execute(JasperReportBuilder.Input param,
Processor.ExecutionContext context)
Perform the process on the input attributes.
|
protected void |
extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration config)
Perform any extra validation a subclass may need to perform.
|
void |
setConfiguration(Configuration configuration)
Set the configuration that the object belongs to.
|
void |
setDirectory(java.lang.String directory)
Set the directory and test that the directory exists and is contained within the Configuration
directory.
|
java.lang.String |
toString() |
getInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, setInputMapper, setInputPrefix, setOutputMapper, setOutputPrefix, setPrefix, toString, validatepublic static final java.lang.String JASPER_REPORT_XML_FILE_EXT
public static final java.lang.String JASPER_REPORT_COMPILED_FILE_EXT
public java.lang.Void execute(JasperReportBuilder.Input param, Processor.ExecutionContext context) throws net.sf.jasperreports.engine.JRException
Processorexecute in interface Processor<JasperReportBuilder.Input,java.lang.Void>param - A Java object whose public fields are populated from the Values object (which is used for transferring properties between
processors).context - The execution context for a print task.Values object. The key in the
Values
object is the name of the field or if there is a mapping in the Processor.getOutputMapperBiMap()
map, the mapped name. The key is determined in a similar way as for the input object.net.sf.jasperreports.engine.JRExceptionpublic JasperReportBuilder.Input createInputParameter()
ProcessorValues object.
The way the properties will be looked up is to
Values object using the mapped
property name
HasDefaultValue annotation is on the field for
the property.
createInputParameter in interface Processor<JasperReportBuilder.Input,java.lang.Void>public void setDirectory(java.lang.String directory)
directory - the new directorypublic void setConfiguration(Configuration configuration)
HasConfigurationsetConfiguration in interface HasConfigurationconfiguration - the configuration objectpublic java.lang.String toString()
toString in class AbstractProcessor<JasperReportBuilder.Input,java.lang.Void>protected void extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration config)
AbstractProcessorextraValidation in class AbstractProcessor<JasperReportBuilder.Input,java.lang.Void>validationErrors - a list to add errors to so that all validation errors are reported as
one.config - the containing configuration