Package com.inet.problemfinder
Class ProblemFinder
- java.lang.Object
-
- com.inet.problemfinder.ProblemFinder
-
public class ProblemFinder extends java.lang.ObjectThis is the i-net Clear Reports Problem Finder.
The Problem Finder is a debug tool. It checks i-net Clear Reports reports for design flaws.
UsegetInstance()to get ProblemFinder instance for checking reports.
To check an Engine, use the Methodcheck(Engine, int).
This Method needs theEngineto check and a specific type which defines the kind of checks that will be run.
For a complete check the type should beCHECK_ALL.
TheProblemFinderprovides two Methods to get the result.
ThegetWarningList()returns a list ofProblemFinderWarnings found in the given main Engine.
ThegetSubreportWarningMap()returns a Map over allSubreport-Engines with their own list ofProblemFinderWarnings.
WithclearAll()the list and the map will be empty.Attention: The
Example:ProblemFinderWarningAutoFix-Actions manipulate theEngine, 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 } }- Since:
- 11.0
- See Also:
ProblemFinderWarning
-
-
Field Summary
Fields Modifier and Type Field Description static intCHECK_ALLCHECK_ALLtype to check allstatic intCHECK_ELEMENTCHECK_ELEMENTtype to checkElementsstatic intCHECK_FIELD_FORMULACHECK_FIELD_FORMULAtype to checkFormulaFieldsstatic intCHECK_FIELD_PROMPTCHECK_FIELD_PROMPTtype to checkPromptFieldsstatic intCHECK_FIELD_SQLCHECK_FIELD_SQLtype to checkSQLFieldsstatic intCHECK_FIELD_SUMMARYCHECK_FIELD_SUMMARYtype to checkSummaryFieldsstatic intCHECK_FIELDSCHECK_FIELDStype to check allFieldsstatic intCHECK_PROPERTYFORMULACHECK_PROPERTYFORMULAtype to check propertyFormulaFieldsstatic intCHECK_REPORTCHECK_REPORTtype to check property executed reportsstatic intCHECK_SECTIONCHECK_SECTIONtype to checkSections
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRules(ProblemFinderRule rule)Add a new rules to the problem finder from a plugin.booleancheck(Engine engine, int type)Start aEngine-check by a given type.voidclearAll()Removes all of theProblemFinderWarnings from the warnings list and the subreport warnings map.static ProblemFindergetInstance()Returns theProblemFindersingleton instance.java.util.HashMap<Engine,java.util.List<ProblemFinderWarning>>getSubreportWarningMap()java.util.List<ProblemFinderWarning>getWarningList()Returns a list ofProblemFinderWarnings found in the given main Engine.voidsetUserProperties(java.util.Properties userProperties)Sets user properties for the engine to check.
-
-
-
Field Detail
-
CHECK_FIELD_FORMULA
public static final int CHECK_FIELD_FORMULA
CHECK_FIELD_FORMULAtype to checkFormulaFields- See Also:
- Constant Field Values
-
CHECK_FIELD_SQL
public static final int CHECK_FIELD_SQL
CHECK_FIELD_SQLtype to checkSQLFields- See Also:
- Constant Field Values
-
CHECK_FIELD_SUMMARY
public static final int CHECK_FIELD_SUMMARY
CHECK_FIELD_SUMMARYtype to checkSummaryFields- See Also:
- Constant Field Values
-
CHECK_FIELD_PROMPT
public static final int CHECK_FIELD_PROMPT
CHECK_FIELD_PROMPTtype to checkPromptFields- See Also:
- Constant Field Values
-
CHECK_FIELDS
public static final int CHECK_FIELDS
CHECK_FIELDStype to check allFields- See Also:
- Constant Field Values
-
CHECK_ELEMENT
public static final int CHECK_ELEMENT
CHECK_ELEMENTtype to checkElements- See Also:
- Constant Field Values
-
CHECK_SECTION
public static final int CHECK_SECTION
CHECK_SECTIONtype to checkSections- See Also:
- Constant Field Values
-
CHECK_PROPERTYFORMULA
public static final int CHECK_PROPERTYFORMULA
CHECK_PROPERTYFORMULAtype to check propertyFormulaFields- See Also:
- Constant Field Values
-
CHECK_REPORT
public static final int CHECK_REPORT
CHECK_REPORTtype to check property executed reports- See Also:
- Constant Field Values
-
CHECK_ALL
public static final int CHECK_ALL
CHECK_ALLtype to check all- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static ProblemFinder getInstance()
Returns theProblemFindersingleton instance.- Returns:
- the static ProblemFinder instance.
- Since:
- 11.0
-
addRules
public void addRules(ProblemFinderRule rule)
Add a new rules to the problem finder from a plugin.- Parameters:
rule- the new rules to be add- Since:
- 20.10
-
setUserProperties
public void setUserProperties(java.util.Properties userProperties)
Sets user properties for the engine to check. The properties could have for example prompt values that the engine needs to render.- Parameters:
userProperties- the properties for the engine to set- Since:
- 20.10
-
clearAll
public void clearAll()
Removes all of theProblemFinderWarnings from the warnings list and the subreport warnings map. The list and the map will be empty after this call returns.- Since:
- 11.0
-
check
public boolean check(Engine engine, int type)
Start aEngine-check by a given type.- Parameters:
engine- givenEnginethat has to be checked.type- the type that says what to be checked.- Returns:
trueif the check was succeed,falseif the check-thread was interrupted- Since:
- 11.0
- See Also:
CHECK_ALL,CHECK_ELEMENT,CHECK_FIELD_FORMULA,CHECK_FIELD_PROMPT,CHECK_FIELD_SQL,CHECK_FIELD_SUMMARY,CHECK_FIELDS,CHECK_PROPERTYFORMULA,CHECK_SECTION
-
getWarningList
public java.util.List<ProblemFinderWarning> getWarningList()
Returns a list ofProblemFinderWarnings found in the given main Engine.- Returns:
- The main
ProblemFinderWarninglist with the current warnings. - Since:
- 11.0
-
getSubreportWarningMap
public java.util.HashMap<Engine,java.util.List<ProblemFinderWarning>> getSubreportWarningMap()
- Returns:
- The
ProblemFinderWarninglist of the current warnings for each Subreport-Engine. - Since:
- 11.0
-
-