public class ProblemQuery extends Object
Modifier and Type | Field and Description |
---|---|
static Comparator<ICompilerProblem> |
compareByPositionAndPhase
This Comparator compares problems based on three criteria:
file path
line number
problem class - ParserProblems are "less than" semantic problems.
|
Constructor and Description |
---|
ProblemQuery()
Construct a ProblemQuery.
|
ProblemQuery(ICompilerProblemSettings problemSettings)
Construct a ProblemQuery with settings to control how compiler problems
are reported.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ICompilerProblem problem)
Add a single problem to the problems collection.
|
void |
addAll(ICompilerProblem[] newProblems)
Add an array of compiler problems to the problems collection.
|
void |
addAll(Iterable<ICompilerProblem> newProblems)
Add a collection of compiler problems to the problems collection.
|
void |
clear()
Clear the underlying collection of problems.
|
void |
getErrorsAndWarnings(Collection<ICompilerProblem> errors,
Collection<ICompilerProblem> warnings)
Categorize the compiler problems into two bins, errors and warning.
|
Iterable<ICompilerProblem> |
getFilteredProblems()
Get an iterator over the set of problems that
are to be reported based on the current settings.
|
Iterable<ICompilerProblem> |
getInternalErrors()
Get an iterator over all internal errors.
|
List<ICompilerProblem> |
getProblems()
Gets the list of compiler problems, with no filtering or sorting.
|
Iterable<ICompilerProblem> |
getProblemView(IProblemFilter filter)
Get a filtered view of the underlying problems.
|
boolean |
hasErrors()
Test if any of the problems are errors.
|
boolean |
hasFilteredProblems()
Any problems to report after filtering?
|
boolean |
hasFilteredProblems(IProblemFilter filter)
Do any problems match the given filter?
|
void |
setShowInternalErrors(boolean showInternalErrors)
Enable or disable internal error display.
|
void |
setShowIrrelevantProblems(boolean showIrrelevantProblems)
Enable or disable display of "problems" that
are used for compiler internal processing but
have no relevance to the user.
|
void |
setShowProblemByClass(Class<? extends ICompilerProblem> problemClass,
boolean enable)
Enable or disable display of a specific problem class or superclass.
|
void |
setShowStrictSemantics(boolean isStrict)
Enable or disable strict semantics mode diagnostics.
|
void |
setShowWarnings(boolean showWarnings)
Enable or disable semantic warnings.
|
void |
sortProblems()
Sort the captured collection of problems so that we can filter out
semantic problems that occur on the same line as parser problems.
|
public static final Comparator<ICompilerProblem> compareByPositionAndPhase
public ProblemQuery()
public ProblemQuery(ICompilerProblemSettings problemSettings)
problemSettings
- configuration settings to control how compiler
problems are reported.public List<ICompilerProblem> getProblems()
public void setShowStrictSemantics(boolean isStrict)
isStrict
- - if true, strict semantics mode
diagnostics will appear in the filtered diagnostics.public void setShowWarnings(boolean showWarnings)
showWarnings
- - if true, semantic warnings
will appear in the filtered diagnostics.public void setShowInternalErrors(boolean showInternalErrors)
showInternalErrors
- - if true, internal error
diagnostics will appear in the filtered diagnostics.public void setShowIrrelevantProblems(boolean showIrrelevantProblems)
showIrrelevantProblems
- - if true, non-user-relevant
diagnostics will appear in the filtered diagnostics.public void setShowProblemByClass(Class<? extends ICompilerProblem> problemClass, boolean enable)
problemClass
- - the problem class/superclass of interest.enable
- - if true, instances of this problem class
will appear in the filtered diagnostics.public void addAll(ICompilerProblem[] newProblems)
newProblems
- - the problems to add.public void addAll(Iterable<ICompilerProblem> newProblems)
newProblems
- - the problems to add.public void add(ICompilerProblem problem)
problem
- - the problem to add.public void clear()
public Iterable<ICompilerProblem> getFilteredProblems()
public boolean hasFilteredProblems()
public boolean hasFilteredProblems(IProblemFilter filter)
filter
- - the problem filter of interest.public Iterable<ICompilerProblem> getProblemView(IProblemFilter filter)
filter
- - the filter to apply.public Iterable<ICompilerProblem> getInternalErrors()
public void sortProblems()
public void getErrorsAndWarnings(Collection<ICompilerProblem> errors, Collection<ICompilerProblem> warnings)
errors
- the collection where the errors are added.warnings
- the collection where the warnings are added.public boolean hasErrors()
Copyright © 2016 The Apache Software Foundation. All rights reserved.