i-net Clear Reports

com.inet.problemfinder
Class ProblemFinder

java.lang.Object
  extended by com.inet.problemfinder.ProblemFinder

public class ProblemFinder
extends java.lang.Object

This 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.
Use getInstance() to get ProblemFinder instance for checking reports.
To check an Engine, use the Method check(Engine, int).
This Method needs the Engine to check and a specific type which defines the kind of checks that will be run.
For a complete check the type should be CHECK_ALL.
The ProblemFinder provides two Methods to get the result.
The getWarningList() returns a list of ProblemFinderWarnings found in the given main Engine.
The getSubreportWarningMap() returns a Map over all Subreport-Engines with their own list of ProblemFinderWarnings.
With 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.

Example:
 ProblemFinder problemFinder = ProblemFinder.getInstance();
 Engine mainEngine = new Engine();
 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
static int CHECK_ALL
          CHECK_ALL type to check all
static int CHECK_ELEMENT
          CHECK_ELEMENT type to check Elements
static int CHECK_FIELDS
          CHECK_FIELDS type to check all Fields
static int CHECK_FIELD_FORMULA
          CHECK_FIELD_FORMULA type to check FormulaFields
static int CHECK_FIELD_PROMPT
          CHECK_FIELD_PROMPT type to check PromptFields
static int CHECK_FIELD_SQL
          CHECK_FIELD_SQL type to check SQLFields
static int CHECK_FIELD_SUMMARY
          CHECK_FIELD_SUMMARY type to check SummaryFields
static int CHECK_PROPERTYFORMULA
          CHECK_PROPERTYFORMULA type to check property FormulaFields
static int CHECK_SECTION
          CHECK_SECTION type to check Sections
 
Method Summary
 boolean check(Engine engine, int type)
          Start a Engine-check by a given type.
 void clearAll()
          Removes all of the ProblemFinderWarnings from the warnings list and the subreport warnings map.
static ProblemFinder getInstance()
          Returns the ProblemFinder singleton instance.
 java.util.HashMap getSubreportWarningMap()
          Returns a map over all Subreport engines with their own list of ProblemFinderWarnings.
 java.util.List getWarningList()
          Returns a list of ProblemFinderWarnings found in the given main Engine.
 

Field Detail

CHECK_FIELD_FORMULA

public static final int CHECK_FIELD_FORMULA
CHECK_FIELD_FORMULA type to check FormulaFields

See Also:
Constant Field Values

CHECK_FIELD_SQL

public static final int CHECK_FIELD_SQL
CHECK_FIELD_SQL type to check SQLFields

See Also:
Constant Field Values

CHECK_FIELD_SUMMARY

public static final int CHECK_FIELD_SUMMARY
CHECK_FIELD_SUMMARY type to check SummaryFields

See Also:
Constant Field Values

CHECK_FIELD_PROMPT

public static final int CHECK_FIELD_PROMPT
CHECK_FIELD_PROMPT type to check PromptFields

See Also:
Constant Field Values

CHECK_FIELDS

public static final int CHECK_FIELDS
CHECK_FIELDS type to check all Fields

See Also:
Constant Field Values

CHECK_ELEMENT

public static final int CHECK_ELEMENT
CHECK_ELEMENT type to check Elements

See Also:
Constant Field Values

CHECK_SECTION

public static final int CHECK_SECTION
CHECK_SECTION type to check Sections

See Also:
Constant Field Values

CHECK_PROPERTYFORMULA

public static final int CHECK_PROPERTYFORMULA
CHECK_PROPERTYFORMULA type to check property FormulaFields

See Also:
Constant Field Values

CHECK_ALL

public static final int CHECK_ALL
CHECK_ALL type to check all

See Also:
Constant Field Values
Method Detail

getInstance

public static ProblemFinder getInstance()
Returns the ProblemFinder singleton instance.

Returns:
the static ProblemFinder instance.
Since:
11.0

clearAll

public void clearAll()
Removes all of the ProblemFinderWarnings 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 a Engine-check by a given type.

Parameters:
engine - given Engine that has to be checked.
type - the type that says what to be checked.
Returns:
true if the check was succeed, false if 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 getWarningList()
Returns a list of ProblemFinderWarnings found in the given main Engine.

Returns:
The main ProblemFinderWarning list with the current warnings.

getSubreportWarningMap

public java.util.HashMap getSubreportWarningMap()
Returns a map over all Subreport engines with their own list of ProblemFinderWarnings.

Returns:
The ProblemFinderWarning list of the current warnings for each Subreport-Engine.

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH