|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.v2.ValidationContext
public class ValidationContext
Tracks the schema validation state. This includes order-dependent state information collected while walking the tree structure of a schema model. Collects all errors and warnings and maintains a summary of the severity of the problems found. For ease of use, this also wraps the schema name register with convenience methods for validation.
Field Summary | |
---|---|
private boolean |
m_continueOnError
Flag for errors to be ignored. |
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 java.util.Set |
m_skipSet
Set of elements to be skipped in walking tree. |
private int |
m_warningCount
Number of warnings reported. |
Constructor Summary | |
---|---|
ValidationContext()
Constructor. |
Method Summary | |
---|---|
boolean |
addError(java.lang.String msg,
java.lang.Object obj)
Add error item. |
void |
addFatal(java.lang.String msg,
java.lang.Object obj)
Add fatal item. |
void |
addProblem(ValidationProblem problem)
Add problem report. |
protected void |
addSkip(java.lang.Object skip)
Add element to set to be skipped. |
void |
addWarning(java.lang.String msg,
java.lang.Object obj)
Add warning item. |
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 |
handleMissingElement()
|
boolean |
isSkipped(java.lang.Object obj)
Check if a component is being skipped due to a fatal error. |
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
private java.util.Set m_skipSet
private boolean m_continueOnError
Constructor Detail |
---|
public ValidationContext()
Method Detail |
---|
public int getWarningCount()
public int getErrorCount()
public int getFatalCount()
public void addWarning(java.lang.String msg, java.lang.Object obj) throws JiBXException
msg
- problem descriptionobj
- source object for validation error
JiBXException
- on unrecoverable errorpublic boolean addError(java.lang.String msg, java.lang.Object obj) throws JiBXException
msg
- problem descriptionobj
- source object for validation error
true
if to continue validation, false
if not
JiBXException
- on unrecoverable errorpublic void addFatal(java.lang.String msg, java.lang.Object obj) throws JiBXException
msg
- problem descriptionobj
- source object for validation error (should be an element)
JiBXException
- on unrecoverable errorpublic void addProblem(ValidationProblem problem) throws JiBXException
problem
- details of problem report
JiBXException
- on unrecoverable errorpublic java.util.ArrayList getProblems()
protected void addSkip(java.lang.Object skip)
skip
- public boolean isSkipped(java.lang.Object obj)
ISkipElements
isSkipped
in interface ISkipElements
obj
- component to be checked
public void handleMissingElement() throws JiBXException
JiBXException
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |