|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.design.JRVerifier
public class JRVerifier
A report verifier.
The verifier checks that a report design meets certain rules in order to pass report compilation.
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_ALLOW_ELEMENT_NEGATIVE_WIDTH
|
static java.lang.String |
PROPERTY_ALLOW_ELEMENT_NEGATIVE_Y
Property that determines whether elements positioned at negative Y offsets on bands, frames and other element containers are allowed in a report. |
static java.lang.String |
PROPERTY_ALLOW_ELEMENT_OVERLAP
A property that determines whether elements are allowed to overlap. |
Constructor Summary | |
---|---|
protected |
JRVerifier(JasperDesign jasperDesign)
Deprecated. Replaced by JRVerifier(JasperReportsContext, JasperDesign, JRExpressionCollector) . |
protected |
JRVerifier(JasperDesign jasperDesign,
JRExpressionCollector expressionCollector)
Deprecated. Replaced by JRVerifier(JasperReportsContext, JasperDesign, JRExpressionCollector) . |
protected |
JRVerifier(JasperReportsContext jasperReportsContext,
JasperDesign jasperDesign,
JRExpressionCollector expressionCollector)
|
Method Summary | |
---|---|
protected static void |
addBrokenRule(java.util.Collection<JRValidationFault> brokenRules,
java.lang.String message,
java.lang.Object source)
|
void |
addBrokenRule(java.lang.Exception e,
java.lang.Object source)
Logs a broken report rule which was caused by an exception. |
void |
addBrokenRule(java.lang.String message,
java.lang.Object source)
Logs a broken rule for the report. |
protected boolean |
allowElementNegativeY(JRElement element)
|
JRComponentElement |
getCurrentComponentElement()
Returns the component element which is currently verified, if any. |
protected java.lang.String |
getElementPositionText(JRElement element)
|
JasperDesign |
getReportDesign()
|
protected boolean |
isAllowedToOverlap(JRElement element)
|
protected void |
popCurrentComponentElement()
|
protected void |
pushCurrentComponentElement(JRComponentElement element)
|
protected boolean |
toVerifyElementOverlap()
|
void |
verify(JRCategoryDataset dataset)
|
protected void |
verify(JRCategorySeries series)
|
void |
verify(JRGanttDataset dataset)
|
protected void |
verify(JRGanttSeries series)
|
void |
verify(JRHighLowDataset dataset)
|
void |
verify(JRPieDataset dataset)
|
protected void |
verify(JRPieSeries series)
|
void |
verify(JRTimePeriodDataset dataset)
|
protected void |
verify(JRTimePeriodSeries series)
|
protected void |
verify(JRTimeSeries series)
|
void |
verify(JRTimeSeriesDataset dataset)
|
void |
verify(JRValueDataset dataset)
Verify the design of a value dataset. |
void |
verify(JRXyDataset dataset)
|
protected void |
verify(JRXySeries series)
|
void |
verify(JRXyzDataset dataset)
|
protected void |
verify(JRXyzSeries series)
|
static void |
verifyBandHeights(java.util.Collection<JRValidationFault> brokenRules,
JRReport report,
int pageHeight,
int topMargin,
int bottomMargin)
Validates that the report band heights fit on a page of certain size. |
protected void |
verifyComponentElement(JRComponentElement element)
|
void |
verifyDatasetRun(JRDatasetRun datasetRun)
Verifies a subdataset run object. |
protected java.util.Collection<JRValidationFault> |
verifyDesign()
|
static java.util.Collection<JRValidationFault> |
verifyDesign(JasperDesign jasperDesign)
Validates a report design . |
static java.util.Collection<JRValidationFault> |
verifyDesign(JasperDesign jasperDesign,
JRExpressionCollector expressionCollector)
Deprecated. Replaced by verifyDesign(JasperReportsContext, JasperDesign, JRExpressionCollector) . |
static java.util.Collection<JRValidationFault> |
verifyDesign(JasperReportsContext jasperReportsContext,
JasperDesign jasperDesign,
JRExpressionCollector expressionCollector)
Validates a report design . |
void |
verifyElement(JRElement element)
|
void |
verifyElementDataset(JRElementDataset dataset)
|
protected void |
verifyElementOverlap(JRElement element1,
JRElement element2)
|
protected void |
verifyElementsOverlap(JRElement[] elements)
|
protected void |
verifyEmptyBackground()
|
void |
verifyExpression(JRExpression expression,
java.lang.Object parent,
java.lang.String mandatoryMessage)
|
protected void |
verifyFormatFactoryClass()
|
protected void |
verifyGenericElement(JRGenericElement element)
|
void |
verifyHyperlink(JRHyperlink hyperlink)
|
protected void |
verifyHyperlinkParameter(JRHyperlinkParameter parameter)
|
protected void |
verifyPropertyExpression(JRPropertyExpression propertyExpression)
|
protected void |
verifyProperyExpressions(JRPropertyExpression[] propertyExpressions)
|
protected void |
verifyReportElement(JRElement element)
|
protected void |
verifyReportTemplates()
|
protected void |
verifyTemplate(JRReportTemplate template)
|
protected boolean |
verifyTemplateSourceType(java.lang.Class<?> valueClass)
Deprecated. To be removed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_ALLOW_ELEMENT_OVERLAP
If this value is set to false
, the report is verified not
to contain elements that overlap. This is useful when the report is
meant to be exported to grid-based formats such as HTML, XLS or CSV.
Setting this property to false
ensures that element overlap
issues are caught at report compile time.
Additionally, when this property is set to false false
, the
report is verified not to have any content in the background section as
this content would likely be overlapped by other sections and would not
show in grid-based exporters.
By default, the property is set to true
which means that
no element overlap checks are performed.
The property can be set at the following levels:
true
;
setting the property to false
does not make the verifier
check for overlaps when the report is not set to be checked for element
overlaps.Note that print when expressions or export filters cannot be taken into consideration while checking for overlapping elements as this check is performed at report compilation time. If a report contains two elements that overlap but have print when expressions that guarantee that only one of them will be printed, or if export filters are in place to exclude one of the elements, one of them should be explicitly marked to allow element overlap when the report is configured to check for overlaps.
public static final java.lang.String PROPERTY_ALLOW_ELEMENT_NEGATIVE_WIDTH
public static final java.lang.String PROPERTY_ALLOW_ELEMENT_NEGATIVE_Y
Elements placed at negative Y offsets can cause unexpected problems in grid-based exporters where they can overlap elements from previous bands/element containers.
If the property is set to false
, elements in the report are
verified to have positive Y offsets. Otherwise, no check is performed
on element Y offsets.
The property can be set at element, report and global levels.
By default the property is set to true
.
JRElement.getY()
,
Constant Field ValuesConstructor Detail |
---|
protected JRVerifier(JasperDesign jasperDesign)
JRVerifier(JasperReportsContext, JasperDesign, JRExpressionCollector)
.
protected JRVerifier(JasperDesign jasperDesign, JRExpressionCollector expressionCollector)
JRVerifier(JasperReportsContext, JasperDesign, JRExpressionCollector)
.
protected JRVerifier(JasperReportsContext jasperReportsContext, JasperDesign jasperDesign, JRExpressionCollector expressionCollector)
Method Detail |
---|
public JasperDesign getReportDesign()
public void addBrokenRule(java.lang.String message, java.lang.Object source)
message
- the messagesource
- the source object to which the rule applies; can be null
if not availableprotected static void addBrokenRule(java.util.Collection<JRValidationFault> brokenRules, java.lang.String message, java.lang.Object source)
public void addBrokenRule(java.lang.Exception e, java.lang.Object source)
e
- the exception that caused the broken rulesource
- the source object if availablepublic static java.util.Collection<JRValidationFault> verifyDesign(JasperDesign jasperDesign, JRExpressionCollector expressionCollector)
verifyDesign(JasperReportsContext, JasperDesign, JRExpressionCollector)
.
public static java.util.Collection<JRValidationFault> verifyDesign(JasperReportsContext jasperReportsContext, JasperDesign jasperDesign, JRExpressionCollector expressionCollector)
report design
.
jasperDesign
- the report designexpressionCollector
- a collector which was used to collect expressions from the report design;
if null, a new collector will be created and used to collect the expressions
design faults
;
the report design is valid if and only if the list is emptypublic static java.util.Collection<JRValidationFault> verifyDesign(JasperDesign jasperDesign)
report design
.
jasperDesign
- the report design
design faults
;
the report design is valid if and only if the list is emptyprotected java.util.Collection<JRValidationFault> verifyDesign()
protected void verifyEmptyBackground()
public static void verifyBandHeights(java.util.Collection<JRValidationFault> brokenRules, JRReport report, int pageHeight, int topMargin, int bottomMargin)
brokenRules
- the list of rules to which
the validation failures are to be addedreport
- the report whose bands are to be validatedpageHeight
- the height of the pagetopMargin
- the page top marginbottomMargin
- the page bottom marginprotected void verifyFormatFactoryClass()
protected void verifyReportTemplates()
protected void verifyTemplate(JRReportTemplate template)
protected boolean verifyTemplateSourceType(java.lang.Class<?> valueClass)
protected boolean toVerifyElementOverlap()
protected boolean isAllowedToOverlap(JRElement element)
protected void verifyElementOverlap(JRElement element1, JRElement element2)
protected java.lang.String getElementPositionText(JRElement element)
protected void verifyElementsOverlap(JRElement[] elements)
public void verifyElement(JRElement element)
public void verifyHyperlink(JRHyperlink hyperlink)
protected void verifyHyperlinkParameter(JRHyperlinkParameter parameter)
public void verifyElementDataset(JRElementDataset dataset)
public void verifyDatasetRun(JRDatasetRun datasetRun)
datasetRun
- the subdataset runpublic void verify(JRCategoryDataset dataset)
protected void verify(JRCategorySeries series)
public void verify(JRPieDataset dataset)
protected void verify(JRPieSeries series)
public void verify(JRHighLowDataset dataset)
public void verify(JRTimePeriodDataset dataset)
protected void verify(JRTimePeriodSeries series)
public void verify(JRTimeSeriesDataset dataset)
protected void verify(JRTimeSeries series)
public void verify(JRValueDataset dataset)
public void verify(JRXyDataset dataset)
protected void verify(JRXySeries series)
protected void verify(JRGanttSeries series)
public void verify(JRXyzDataset dataset)
public void verify(JRGanttDataset dataset)
protected void verify(JRXyzSeries series)
protected void verifyReportElement(JRElement element)
protected boolean allowElementNegativeY(JRElement element)
protected void verifyProperyExpressions(JRPropertyExpression[] propertyExpressions)
protected void verifyPropertyExpression(JRPropertyExpression propertyExpression)
protected void verifyComponentElement(JRComponentElement element)
public JRComponentElement getCurrentComponentElement()
This method can be used in the ComponentCompiler.verify(Component, JRVerifier)
method to get a handle of the wrapping componenet element.
protected void pushCurrentComponentElement(JRComponentElement element)
protected void popCurrentComponentElement()
protected void verifyGenericElement(JRGenericElement element)
public void verifyExpression(JRExpression expression, java.lang.Object parent, java.lang.String mandatoryMessage)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |