|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.model.TreeContext
org.jibx.binding.model.ValidationContext
public class ValidationContext
Tracks the validation state. This includes the current validation phase, as well as order-dependent state information collected while walking the tree structure of a binding model. Collects all errors and warnings and maintains a summary of the severity of the problems found.
Nested Class Summary | |
---|---|
protected class |
ValidationContext.PrevalidationVisitor
Inner class for handling prevalidation. |
protected class |
ValidationContext.ValidationVisitor
Inner class for handling validation. |
Field Summary | |
---|---|
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 Summary | |
---|---|
ValidationContext(IClassLocator iloc)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.jibx.binding.model.TreeContext |
---|
addSkip, getBindingRoot, getChildContext, getContextObject, getCurrentDefinitions, getDefinitions, getFormatDefinitions, getNestingDepth, getParentContainer, getParentElement, getParentElement, getRequiredClassInfo, isInBinding, isLookupSupported, isOutBinding, isSkipped, peekElement, popNode, pushNode, setBindingRoot, setGlobalDefinitions, tourTree, tourTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int m_warningCount
private int m_errorCount
private int m_fatalCount
private java.util.ArrayList m_problemList
Constructor Detail |
---|
public ValidationContext(IClassLocator iloc)
iloc
- class locatorMethod Detail |
---|
private 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 found
null
if class not found
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |