Top Description Fields Constructors Methods
com.ctc.wstx.exc

public Class WstxValidationException

extends XMLValidationException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
javax.xml.stream.Location, .XMLStreamException, org.codehaus.stax2.validation.XMLValidationException, .XMLValidationProblem, com.ctc.wstx.util.StringUtil

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.

Field Summary

Inherited from org.codehaus.stax2.validation.XMLValidationException:
mCause

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public static WstxValidationException
protected String
public String
getMessage()

Overrides java.lang.Throwable.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.

public String
toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this throwable.

Inherited from org.codehaus.stax2.validation.XMLValidationException:
createExceptiongetValidationProblemthrowMissing

Constructor Detail

WstxValidationExceptionback to summary
protected WstxValidationException(XMLValidationProblem cause, String msg)
WstxValidationExceptionback to summary
protected WstxValidationException(XMLValidationProblem cause, String msg, Location loc)

Method Detail

createback to summary
public static WstxValidationException create(XMLValidationProblem cause)
getLocationDescback to summary
protected String getLocationDesc()
getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.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.

Returns:String

Doc from java.lang.Throwable.getMessage.

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Doc from java.lang.Throwable.toString.

Returns a short description of this throwable. The result is the concatenation of:

  • the name of the class of this object
  • ": " (a colon and a space)
  • the result of invoking this object's getLocalizedMessage method
If getLocalizedMessage returns null, then just the class name is returned.
Returns:String

a string representation of this throwable.

Annotations
@Override