com.ctc.wstx.exc
Class WstxValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.xml.stream.XMLStreamException
              extended by org.codehaus.stax2.validation.XMLValidationException
                  extended by com.ctc.wstx.exc.WstxValidationException
All Implemented Interfaces:
java.io.Serializable

public class WstxValidationException
extends XMLValidationException

Specific exception thrown when document has validation (DTD, W3C Schema) errors; things that are not well-formedness problems.

The current implementation does not add much beyond basic XMLValidationException, except for fixing some problems that underlying XMLStreamException has.

Note that some of the code is shared with WstxException. Unfortunately it is not possible to extend it, however, since it extends basic XMLStreamException, not XMLValidationException.

One more thing to note: unlike some other exception classes, these exceptions do not have chained root causes. That's why no special handling is necessary for setting the root cause in backwards compatible way.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.codehaus.stax2.validation.XMLValidationException
mCause
 
Fields inherited from class javax.xml.stream.XMLStreamException
location, nested
 
Constructor Summary
protected WstxValidationException(XMLValidationProblem cause, java.lang.String msg)
           
protected WstxValidationException(XMLValidationProblem cause, java.lang.String msg, javax.xml.stream.Location loc)
           
 
Method Summary
static WstxValidationException create(java.lang.String msg, javax.xml.stream.Location loc, int severity)
           
static WstxValidationException create(XMLValidationProblem cause)
           
protected  java.lang.String getLocationDesc()
           
 java.lang.String getMessage()
          Method is overridden for two main reasons: first, default method does not display public/system id information, even if it exists, and second, default implementation can not handle nested Location information.
 java.lang.String toString()
           
 
Methods inherited from class org.codehaus.stax2.validation.XMLValidationException
createException, getValidationProblem, throwMissing
 
Methods inherited from class javax.xml.stream.XMLStreamException
getLocation, getNestedException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WstxValidationException

protected WstxValidationException(XMLValidationProblem cause,
                                  java.lang.String msg)

WstxValidationException

protected WstxValidationException(XMLValidationProblem cause,
                                  java.lang.String msg,
                                  javax.xml.stream.Location loc)
Method Detail

create

public static WstxValidationException create(java.lang.String msg,
                                             javax.xml.stream.Location loc,
                                             int severity)

create

public static WstxValidationException create(XMLValidationProblem cause)

getMessage

public java.lang.String getMessage()
Method is overridden for two main reasons: first, default method does not display public/system id information, even if it exists, and second, default implementation can not handle nested Location information.

Overrides:
getMessage in class java.lang.Throwable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable

getLocationDesc

protected java.lang.String getLocationDesc()