Top Description Fields Constructors Methods
jakarta.xml.bind.helpers

public Class ValidationEventLocatorImpl

extends Object
implements ValidationEventLocator
Class Inheritance
All Implemented Interfaces
jakarta.xml.bind.ValidationEventLocator
Imports
java.net.URL, .MalformedURLException, java.text.MessageFormat, jakarta.xml.bind.ValidationEventLocator, org.w3c.dom.Node, org.xml.sax.Locator, .SAXParseException

Default implementation of the ValidationEventLocator interface.

Jakarta XML Binding providers are allowed to use whatever class that implements the ValidationEventLocator interface. This class is just provided for a convenience.

Author
Since
1.6, JAXB 1.0
See Also
jakarta.xml.bind.ValidationEventHandler, jakarta.xml.bind.ValidationEvent, jakarta.xml.bind.ValidationEventLocator

Field Summary

Modifier and TypeField and Description
private int
private int
private Node
private Object
private int
private URL

Constructor Summary

AccessConstructor and Description
public
ValidationEventLocatorImpl()

Creates an object with all fields unavailable.

public
ValidationEventLocatorImpl(Locator
the SAX Locator object that will be used to populate this event locator.
loc
)

Constructs an object from an org.xml.sax.Locator.

public
ValidationEventLocatorImpl(SAXParseException
the SAXParseException object that will be used to populate this event locator.
e
)

Constructs an object from the location information of a SAXParseException.

public
ValidationEventLocatorImpl(Node
the DOM Node object that will be used to populate this event locator.
_node
)

Constructs an object that points to a DOM Node.

public
ValidationEventLocatorImpl(Object
the Object that will be used to populate this event locator.
_object
)

Constructs an object that points to a Jakarta XML Binding content object.

Method Summary

Modifier and TypeMethod and Description
public int
getColumnNumber()

Implements jakarta.xml.bind.ValidationEventLocator.getColumnNumber.

Return the column number if available
public int
getLineNumber()

Implements jakarta.xml.bind.ValidationEventLocator.getLineNumber.

Return the line number if available
public Node
getNode()

Implements jakarta.xml.bind.ValidationEventLocator.getNode.

Return a reference to the DOM Node if available
public Object
getObject()

Implements jakarta.xml.bind.ValidationEventLocator.getObject.

Return a reference to the object in the Java content tree if available
public int
getOffset()

Implements jakarta.xml.bind.ValidationEventLocator.getOffset.

Return the byte offset if available
public URL
getURL()

Implements jakarta.xml.bind.ValidationEventLocator.getURL.

Return the name of the XML source as a URL if available
public void
setColumnNumber(int
the column number
_columnNumber
)

Set the columnNumber field on this event locator.

public void
setLineNumber(int
the line number
_lineNumber
)

Set the lineNumber field on this event locator.

public void
setNode(Node
the Node
_node
)

Set the Node field on this event locator.

public void
setObject(Object
the java content object
_object
)

Set the Object field on this event locator.

public void
setOffset(int
the offset
_offset
)

Set the offset field on this event locator.

public void
setURL(URL
the url
_url
)

Set the URL field on this event locator.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object in a format helpful to debugging.
private static URL
toURL(String systemId)

Converts a system ID to an URL object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

columnNumberback to summary
private int columnNumber
lineNumberback to summary
private int lineNumber
nodeback to summary
private Node node
objectback to summary
private Object object
offsetback to summary
private int offset
urlback to summary
private URL url

Constructor Detail

ValidationEventLocatorImplback to summary
public ValidationEventLocatorImpl()

Creates an object with all fields unavailable.

ValidationEventLocatorImplback to summary
public ValidationEventLocatorImpl(Locator loc)

Constructs an object from an org.xml.sax.Locator. The object's ColumnNumber, LineNumber, and URL become available from the values returned by the locator's getColumnNumber(), getLineNumber(), and getSystemId() methods respectively. Node, Object, and Offset are not available.

Parameters
loc:Locator

the SAX Locator object that will be used to populate this event locator.

Exceptions
IllegalArgumentException:
if the Locator is null
ValidationEventLocatorImplback to summary
public ValidationEventLocatorImpl(SAXParseException e)

Constructs an object from the location information of a SAXParseException. The object's ColumnNumber, LineNumber, and URL become available from the values returned by the locator's getColumnNumber(), getLineNumber(), and getSystemId() methods respectively. Node, Object, and Offset are not available.

Parameters
e:SAXParseException

the SAXParseException object that will be used to populate this event locator.

Exceptions
IllegalArgumentException:
if the SAXParseException is null
ValidationEventLocatorImplback to summary
public ValidationEventLocatorImpl(Node _node)

Constructs an object that points to a DOM Node. The object's Node becomes available. ColumnNumber, LineNumber, Object, Offset, and URL are not available.

Parameters
_node:Node

the DOM Node object that will be used to populate this event locator.

Exceptions
IllegalArgumentException:
if the Node is null
ValidationEventLocatorImplback to summary
public ValidationEventLocatorImpl(Object _object)

Constructs an object that points to a Jakarta XML Binding content object. The object's Object becomes available. ColumnNumber, LineNumber, Node, Offset, and URL are not available.

Parameters
_object:Object

the Object that will be used to populate this event locator.

Exceptions
IllegalArgumentException:
if the Object is null

Method Detail

getColumnNumberback to summary
public int getColumnNumber()

Implements jakarta.xml.bind.ValidationEventLocator.getColumnNumber.

Doc from jakarta.xml.bind.ValidationEventLocator.getColumnNumber.

Return the column number if available

Returns:int

the column number or -1 if unavailable

Annotations
@Override
See Also
jakarta.xml.bind.ValidationEventLocator#getColumnNumber()
getLineNumberback to summary
public int getLineNumber()

Implements jakarta.xml.bind.ValidationEventLocator.getLineNumber.

Doc from jakarta.xml.bind.ValidationEventLocator.getLineNumber.

Return the line number if available

Returns:int

the line number or -1 if unavailable

Annotations
@Override
See Also
jakarta.xml.bind.ValidationEventLocator#getLineNumber()
getNodeback to summary
public Node getNode()

Implements jakarta.xml.bind.ValidationEventLocator.getNode.

Doc from jakarta.xml.bind.ValidationEventLocator.getNode.

Return a reference to the DOM Node if available

Returns:Node

a reference to the DOM Node or null if unavailable

Annotations
@Override
See Also
jakarta.xml.bind.ValidationEventLocator#getNode()
getObjectback to summary
public Object getObject()

Implements jakarta.xml.bind.ValidationEventLocator.getObject.

Doc from jakarta.xml.bind.ValidationEventLocator.getObject.

Return a reference to the object in the Java content tree if available

Returns:Object

a reference to the object in the Java content tree or null if unavailable

Annotations
@Override
See Also
jakarta.xml.bind.ValidationEventLocator#getObject()
getOffsetback to summary
public int getOffset()

Implements jakarta.xml.bind.ValidationEventLocator.getOffset.

Doc from jakarta.xml.bind.ValidationEventLocator.getOffset.

Return the byte offset if available

Returns:int

the byte offset into the input source or -1 if unavailable

Annotations
@Override
See Also
jakarta.xml.bind.ValidationEventLocator#getOffset()
getURLback to summary
public URL getURL()

Implements jakarta.xml.bind.ValidationEventLocator.getURL.

Doc from jakarta.xml.bind.ValidationEventLocator.getURL.

Return the name of the XML source as a URL if available

Returns:URL

the name of the XML source as a URL or null if unavailable

Annotations
@Override
See Also
jakarta.xml.bind.ValidationEventLocator#getURL()
setColumnNumberback to summary
public void setColumnNumber(int _columnNumber)

Set the columnNumber field on this event locator.

Parameters
_columnNumber:int

the column number

setLineNumberback to summary
public void setLineNumber(int _lineNumber)

Set the lineNumber field on this event locator.

Parameters
_lineNumber:int

the line number

setNodeback to summary
public void setNode(Node _node)

Set the Node field on this event locator. Null values are allowed.

Parameters
_node:Node

the Node

setObjectback to summary
public void setObject(Object _object)

Set the Object field on this event locator. Null values are allowed.

Parameters
_object:Object

the java content object

setOffsetback to summary
public void setOffset(int _offset)

Set the offset field on this event locator.

Parameters
_offset:int

the offset

setURLback to summary
public void setURL(URL _url)

Set the URL field on this event locator. Null values are allowed.

Parameters
_url:URL

the url

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object in a format helpful to debugging.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override
See Also
Object#equals(Object)
toURLback to summary
private static URL toURL(String systemId)

Converts a system ID to an URL object.