Package org.codehaus.stax2.validation
Class XMLValidationProblem
java.lang.Object
org.codehaus.stax2.validation.XMLValidationProblem
Simple container class used to store a non-fatal problem
either to be returned as is, or to use for creating and throwing
a validation exception.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Location
Location within validated xml stream where the problem occured.protected final String
protected XMLValidator
Validator instance that reported the problem, if any (may be null if stream reader or writer itself reported the problem)protected final int
protected String
Type of the problem, available types implementation specified.static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionXMLValidationProblem
(Location loc, String msg) XMLValidationProblem
(Location loc, String msg, int severity) XMLValidationProblem
(Location loc, String msg, int severity, String type) -
Method Summary
Modifier and TypeMethodDescriptionReturns the validator that reported the problem if known.int
getType()
void
void
Set the validator object that reported this problem, if known.void
Convenience method for constructing aXMLValidationException
to throw based on information contained in this object.
-
Field Details
-
SEVERITY_WARNING
public static final int SEVERITY_WARNING- See Also:
-
SEVERITY_ERROR
public static final int SEVERITY_ERROR- See Also:
-
SEVERITY_FATAL
public static final int SEVERITY_FATAL- See Also:
-
mLocation
Location within validated xml stream where the problem occured. -
mMessage
-
mSeverity
protected final int mSeverity -
mType
Type of the problem, available types implementation specified.- Since:
- 3.0
-
mReporter
Validator instance that reported the problem, if any (may be null if stream reader or writer itself reported the problem)- Since:
- 3.0
-
-
Constructor Details
-
XMLValidationProblem
-
XMLValidationProblem
-
XMLValidationProblem
-
-
Method Details
-
toException
Convenience method for constructing aXMLValidationException
to throw based on information contained in this object. Base implementation is equivalent to:return XMLValidationException.createException(this);
- Since:
- 3.0
-
setType
- Since:
- 3.0
-
setLocation
- Since:
- 3.0
-
setReporter
Set the validator object that reported this problem, if known.- Since:
- 3.0
-
getLocation
- Returns:
- Reference to location where problem was encountered.
-
getMessage
- Returns:
- Human-readable message describing the problem
-
getSeverity
public int getSeverity()- Returns:
- One of
SEVERITY_
constants (such asSEVERITY_WARNING
-
getType
- Returns:
- Generic type (class) of the problem; may be null if validator does not provide such details
- Since:
- 3.0
-
getReporter
Returns the validator that reported the problem if known.- Returns:
- Validator that reported the problem; null if unknown or N/A.
- Since:
- 3.0
-