javax.xml.bind

Interface ValidationEventLocator

public interface ValidationEventLocator

The ValidationEventLocator is an abstract description of the place where a ValidationEvent occurred.

Depending on the source or target media (Unmarshalling, or Unmarshalling) or the object being validated, you will most probably find that different fields of the ValidationEventHandler are set. For example, if you are using a org.xml.sax.ContentHandler, you will most probably find that those fields are set, which are common to a org.xml.sax.Locator.

Since: JAXB1.0

Author: JSR-31

See Also: ValidationEvent

Method Summary
intgetColumnNumber()

Returns a column number related to the validation event, if available.

intgetLineNumber()

Returns a line number related to the validation event, if available.

NodegetNode()

Returns a DOM node related to the validation event.

ObjectgetObject()

Returns an object in the JAXB objects content tree related to the validation event.

intgetOffset()

Returns a byte offset related to the validation event, if available.

URLgetURL()

Returns a URL related to the validation event, if available.

Method Detail

getColumnNumber

public int getColumnNumber()

Returns a column number related to the validation event, if available. For example, when parsing an java.io.InputStream, this might be the column, in which the event occurred.

Returns: Column number, if available, or -1.

getLineNumber

public int getLineNumber()

Returns a line number related to the validation event, if available. For example, when parsing an java.io.InputStream, this might be the line, in which the event occurred.

Returns: Line number, if available, or -1.

getNode

public Node getNode()

Returns a DOM node related to the validation event. For example, this might be an element node with a missing attribute. It might as well be an attribute node with an invalid value.

Returns: Invalid node, if available, or null.

getObject

public Object getObject()

Returns an object in the JAXB objects content tree related to the validation event. Usually this is the invalid object or child object.

Returns: Part of a JAXB object tree, if available, or null.

getOffset

public int getOffset()

Returns a byte offset related to the validation event, if available. For example, when parsing an java.io.InputStream, this might be the position where the event occurred.

Returns: Byte offset, if available, or -1.

getURL

public URL getURL()

Returns a URL related to the validation event, if available. For example, when parsing an org.xml.sax.InputSource, this might be the URL given by org.xml.sax.InputSource#getSystemId().

Returns: The validation event URL, if available, or null.