public final class LegendProcessor extends AbstractProcessor<LegendProcessor.Input,LegendProcessor.Output>
Create a legend.
See also: !legend attribute
[[examples=verboseExample,legend_cropped,legend_scaled]]| Modifier and Type | Class and Description |
|---|---|
static class |
LegendProcessor.Input
The Input Parameter object for
LegendProcessor. |
static class |
LegendProcessor.Output
The Output object of the legend processor method.
|
AbstractProcessor.ContextProcessor.ExecutionContextMDC_JOB_ID_KEY| Modifier | Constructor and Description |
|---|---|
protected |
LegendProcessor()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
LegendProcessor.Input |
createInputParameter()
Returns a new/clean instance of a parameter object.
|
LegendProcessor.Output |
execute(LegendProcessor.Input values,
Processor.ExecutionContext context)
Perform the process on the input attributes.
|
protected void |
extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
Perform any extra validation a subclass may need to perform.
|
void |
setDpi(java.lang.Double dpi)
The DPI value that is used for the legend graphics.
|
void |
setMaxWidth(java.lang.Integer maxWidth)
The maximum width in pixels for the legend graphics.
|
void |
setScaled(boolean scaled)
When the image is too big do a scaled (default) otherwise do a scale.
|
void |
setTemplate(java.lang.String template)
The path to the Jasper Report template for rendering the legend data.
|
getInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, setInputMapper, setInputPrefix, setOutputMapper, setOutputPrefix, setPrefix, toString, toString, validatepublic void setTemplate(java.lang.String template)
template - path to the template filepublic void setMaxWidth(java.lang.Integer maxWidth)
maxWidth - The maximum width.public void setDpi(java.lang.Double dpi)
dpi - The DPI value.public void setScaled(boolean scaled)
scaled - do a scaled.public LegendProcessor.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.
public LegendProcessor.Output execute(LegendProcessor.Input values, Processor.ExecutionContext context) throws java.lang.Exception
Processorvalues - 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.java.lang.Exceptionprotected void extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
AbstractProcessorextraValidation in class AbstractProcessor<LegendProcessor.Input,LegendProcessor.Output>validationErrors - a list to add errors to so that all validation errors are reported as
one.configuration - the containing configuration