Top Description Fields Constructors Methods
org.codehaus.stax2.validation

public Class XMLValidationProblem

extends Object
Class Inheritance
Imports
javax.xml.stream.Location

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

Modifier and TypeField and Description
protected Location
mLocation

Location within validated xml stream where the problem occured.

protected final String
protected XMLValidator
mReporter

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
mType

Type of the problem, available types implementation specified.

public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
public
XMLValidationProblem(Location loc, String msg, int severity)

public
XMLValidationProblem(Location loc, String msg, int severity, String type)

Method Summary

Modifier and TypeMethod and Description
public Location

Returns:

Reference to location where problem was encountered.
getLocation
()

public String

Returns:

Human-readable message describing the problem
getMessage
()

public XMLValidator

Returns:

Validator that reported the problem; null if unknown or N/A.
getReporter
()

Returns the validator that reported the problem if known.

public int

Returns:

One of SEVERITY_ constants (such as SEVERITY_WARNING
getSeverity
()

public String

Returns:

Generic type (class) of the problem; may be null if validator does not provide such details
getType
()

public void
public void
setReporter(XMLValidator v)

Set the validator object that reported this problem, if known.

public void
public XMLValidationException
toException()

Convenience method for constructing a XMLValidationException to throw based on information contained in this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mLocationback to summary
protected Location mLocation

Location within validated xml stream where the problem occured.

mMessageback to summary
protected final String mMessage
mReporterback to summary
protected XMLValidator mReporter

Validator instance that reported the problem, if any (may be null if stream reader or writer itself reported the problem)

Since
3.0
mSeverityback to summary
protected final int mSeverity
mTypeback to summary
protected String mType

Type of the problem, available types implementation specified.

Since
3.0
SEVERITY_ERRORback to summary
public static final int SEVERITY_ERROR
SEVERITY_FATALback to summary
public static final int SEVERITY_FATAL
SEVERITY_WARNINGback to summary
public static final int SEVERITY_WARNING

Constructor Detail

XMLValidationProblemback to summary
public XMLValidationProblem(Location loc, String msg)
XMLValidationProblemback to summary
public XMLValidationProblem(Location loc, String msg, int severity)
XMLValidationProblemback to summary
public XMLValidationProblem(Location loc, String msg, int severity, String type)

Method Detail

getLocationback to summary
public Location getLocation()
Returns:Location

Reference to location where problem was encountered.

getMessageback to summary
public String getMessage()
Returns:String

Human-readable message describing the problem

getReporterback to summary
public XMLValidator getReporter()

Returns the validator that reported the problem if known.

Returns:XMLValidator

Validator that reported the problem; null if unknown or N/A.

Since
3.0
getSeverityback to summary
public int getSeverity()
Returns:int

One of SEVERITY_ constants (such as SEVERITY_WARNING

getTypeback to summary
public String getType()
Returns:String

Generic type (class) of the problem; may be null if validator does not provide such details

Since
3.0
setLocationback to summary
public void setLocation(Location l)
Since
3.0
setReporterback to summary
public void setReporter(XMLValidator v)

Set the validator object that reported this problem, if known.

Since
3.0
setTypeback to summary
public void setType(String t)
Since
3.0
toExceptionback to summary
public XMLValidationException toException()

Convenience method for constructing a XMLValidationException to throw based on information contained in this object. Base implementation is equivalent to:

  return XMLValidationException.createException(this);
Since
3.0