public class ValidationContext extends TreeContext
Modifier and Type | Class and Description |
---|---|
protected class |
ValidationContext.PrevalidationVisitor
Inner class for handling prevalidation.
|
protected class |
ValidationContext.ValidationVisitor
Inner class for handling validation.
|
Modifier and Type | Field and Description |
---|---|
private int |
m_errorCount
Number of errors reported.
|
private int |
m_fatalCount
Number of fatals reported.
|
private java.util.ArrayList |
m_problemList
List of problem items reported by validation.
|
private int |
m_warningCount
Number of warnings reported.
|
Constructor and Description |
---|
ValidationContext(IClassLocator iloc)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addError(java.lang.String msg)
Add error item for current element.
|
void |
addError(java.lang.String msg,
java.lang.Object obj)
Add error item.
|
void |
addFatal(java.lang.String msg)
Add fatal item for current element.
|
void |
addFatal(java.lang.String msg,
java.lang.Object obj)
Add fatal item.
|
void |
addProblem(ValidationProblem problem)
Add problem report.
|
void |
addWarning(java.lang.String msg)
Add warning item for current element.
|
void |
addWarning(java.lang.String msg,
java.lang.Object obj)
Add warning item.
|
IClass |
getClassInfo(java.lang.String name)
Get class information.
|
int |
getErrorCount()
Get number of error problems reported.
|
int |
getFatalCount()
Get number of fatal problems reported.
|
java.util.ArrayList |
getProblems()
Get list of problems.
|
int |
getWarningCount()
Get number of warning problems reported.
|
void |
prevalidate(BindingElement root)
Prevalidate binding model tree.
|
private ElementBase |
safePeekElement()
Peek current element of hierarchy, if any.
|
void |
validate(BindingElement root)
Validate binding model tree.
|
addSkip, getBindingRoot, getChildContext, getContextObject, getCurrentDefinitions, getDefinitions, getFormatDefinitions, getNestingDepth, getParentContainer, getParentElement, getParentElement, getRequiredClassInfo, isInBinding, isLookupSupported, isOutBinding, isSkipped, peekElement, popNode, pushNode, setBindingRoot, setGlobalDefinitions, tourTree, tourTree
private int m_warningCount
private int m_errorCount
private int m_fatalCount
private java.util.ArrayList m_problemList
public ValidationContext(IClassLocator iloc)
iloc
- class locatorprivate ElementBase safePeekElement()
null
if nonepublic void prevalidate(BindingElement root)
root
- binding node of tree to be prevalidatedpublic void validate(BindingElement root)
root
- binding node of tree to be prevalidatedpublic int getWarningCount()
public int getErrorCount()
public int getFatalCount()
public void addWarning(java.lang.String msg)
msg
- problem descriptionpublic void addWarning(java.lang.String msg, java.lang.Object obj)
msg
- problem descriptionobj
- source object for validation errorpublic void addError(java.lang.String msg)
msg
- problem descriptionpublic void addError(java.lang.String msg, java.lang.Object obj)
msg
- problem descriptionobj
- source object for validation errorpublic void addFatal(java.lang.String msg)
msg
- problem descriptionpublic void addFatal(java.lang.String msg, java.lang.Object obj)
msg
- problem descriptionobj
- source object for validation error (should be an element)public void addProblem(ValidationProblem problem)
problem
- details of problem reportpublic java.util.ArrayList getProblems()
public IClass getClassInfo(java.lang.String name)
getClassInfo
in class TreeContext
name
- fully-qualified name of class to be foundnull
if class not found