public class ProblemFinder
extends java.lang.Object
getInstance()
to get ProblemFinder instance for checking reports.check(Engine, int)
.Engine
to check and a specific type which defines the kind of checks that will be run. CHECK_ALL
.ProblemFinder
provides two Methods to get the result. getWarningList()
returns a list of ProblemFinderWarning
s found in the given main Engine.getSubreportWarningMap()
returns a Map over all Subreport
-Engines with their own list of ProblemFinderWarning
s.clearAll()
the list and the map will be empty.
Attention: The ProblemFinderWarning
AutoFix-Actions manipulate the Engine
, use it carefully or back up your reports
if you plan on replacing your report files.
ProblemFinder problemFinder = ProblemFinder.getInstance(); Engine mainEngine = new Engine( Engine.NO_EXPORT ); URL source = this.getClass().getResource( "myReport.rpt" ); mainEngine.setReportFile( source ); problemFinder.check( mainEngine, ProblemFinder.CHECK_ALL ); List<ProblemFinderWarning> warningListMain = problemFinder.getWarningList(); for( ProblemFinderWarning warning : warningListMain ) { System.out.println(warning.getMessage()); // ..do something else } HashMap<Engine, List<ProblemFinderWarning>> warningMap = problemFinder.getSubreportWarningMap(); for( Engine subEngine : warningMap.keySet() ) { List<ProblemFinderWarning> warningListSub = warningMap.get( subEngine ); for( ProblemFinderWarning warning : warningListSub ) { System.out.println(warning.getMessage()); // ..do something else } }
ProblemFinderWarning
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_ALL
CHECK_ALL type to check all |
static int |
CHECK_ELEMENT
CHECK_ELEMENT type to check Element s |
static int |
CHECK_FIELDS
CHECK_FIELDS type to check all Field s |
static int |
CHECK_FIELD_FORMULA
CHECK_FIELD_FORMULA type to check FormulaField s |
static int |
CHECK_FIELD_PROMPT
CHECK_FIELD_PROMPT type to check PromptField s |
static int |
CHECK_FIELD_SQL
CHECK_FIELD_SQL type to check SQLField s |
static int |
CHECK_FIELD_SUMMARY
CHECK_FIELD_SUMMARY type to check SummaryField s |
static int |
CHECK_PROPERTYFORMULA
CHECK_PROPERTYFORMULA type to check property FormulaField s |
static int |
CHECK_REPORT
CHECK_REPORT type to check property executed reports |
static int |
CHECK_SECTION
CHECK_SECTION type to check Section s |
Modifier and Type | Method and Description |
---|---|
void |
addRules(ProblemFinderRule rule)
Add a new rules to the problem finder from a plugin.
|
boolean |
check(Engine engine,
int type)
Start a
Engine -check by a given type. |
void |
clearAll()
Removes all of the
ProblemFinderWarning s from the warnings list and the subreport warnings map. |
static ProblemFinder |
getInstance()
Returns the
ProblemFinder singleton instance. |
java.util.HashMap<Engine,java.util.List<ProblemFinderWarning>> |
getSubreportWarningMap()
Returns a map over all
Subreport engines with their own list of ProblemFinderWarning s. |
java.util.List<ProblemFinderWarning> |
getWarningList()
Returns a list of
ProblemFinderWarning s found in the given main Engine. |
void |
setUserProperties(java.util.Properties userProperties)
Sets user properties for the engine to check.
|
public static final int CHECK_FIELD_FORMULA
CHECK_FIELD_FORMULA
type to check FormulaField
spublic static final int CHECK_FIELD_SQL
CHECK_FIELD_SQL
type to check SQLField
spublic static final int CHECK_FIELD_SUMMARY
CHECK_FIELD_SUMMARY
type to check SummaryField
spublic static final int CHECK_FIELD_PROMPT
CHECK_FIELD_PROMPT
type to check PromptField
spublic static final int CHECK_FIELDS
CHECK_FIELDS
type to check all Field
spublic static final int CHECK_ELEMENT
CHECK_ELEMENT
type to check Element
spublic static final int CHECK_SECTION
CHECK_SECTION
type to check Section
spublic static final int CHECK_PROPERTYFORMULA
CHECK_PROPERTYFORMULA
type to check property FormulaField
spublic static final int CHECK_REPORT
CHECK_REPORT
type to check property executed reportspublic static final int CHECK_ALL
CHECK_ALL
type to check allpublic static ProblemFinder getInstance()
ProblemFinder
singleton instance.public void addRules(ProblemFinderRule rule)
rule
- the new rules to be addpublic void setUserProperties(java.util.Properties userProperties)
userProperties
- the properties for the engine to setpublic void clearAll()
ProblemFinderWarning
s from the warnings list and the subreport warnings map.
The list and the map will be empty after this call returns.public boolean check(Engine engine, int type)
Engine
-check by a given type.engine
- given Engine
that has to be checked.type
- the type that says what to be checked.true
if the check was succeed, false
if the check-thread was interruptedCHECK_ALL
,
CHECK_ELEMENT
,
CHECK_FIELD_FORMULA
,
CHECK_FIELD_PROMPT
,
CHECK_FIELD_SQL
,
CHECK_FIELD_SUMMARY
,
CHECK_FIELDS
,
CHECK_PROPERTYFORMULA
,
CHECK_SECTION
public java.util.List<ProblemFinderWarning> getWarningList()
ProblemFinderWarning
s found in the given main Engine.ProblemFinderWarning
list with the current warnings.public java.util.HashMap<Engine,java.util.List<ProblemFinderWarning>> getSubreportWarningMap()
ProblemFinderWarning
list of the current warnings for each Subreport-Engine.Copyright © 1999-2020 by i-net software GmbH