ValidationEventLocatorImplpublic class ValidationEventLocatorImpl extends Object implements ValidationEventLocatorDefault implementation of the ValidationEventLocator interface.
JAXB providers are allowed to use whatever class that implements
the ValidationEventLocator interface. This class is just provided for a
convenience. |
Fields Summary |
---|
private URL | url | private int | offset | private int | lineNumber | private int | columnNumber | private Object | object | private Node | node |
Constructors Summary |
---|
public ValidationEventLocatorImpl()Creates an object with all fields unavailable.
| 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.
if( loc == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, "loc" ) );
}
this.url = toURL(loc.getSystemId());
this.columnNumber = loc.getColumnNumber();
this.lineNumber = loc.getLineNumber();
| 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.
if( e == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, "e" ) );
}
this.url = toURL(e.getSystemId());
this.columnNumber = e.getColumnNumber();
this.lineNumber = e.getLineNumber();
| 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.
if( _node == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, "_node" ) );
}
this.node = _node;
| public ValidationEventLocatorImpl(Object _object)Constructs an object that points to a JAXB content object.
The object's Object becomes available. ColumnNumber, LineNumber, Node,
Offset, and URL are not available.
if( _object == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, "_object" ) );
}
this.object = _object;
|
Methods Summary |
---|
public int | getColumnNumber()
return columnNumber;
| public int | getLineNumber()
return lineNumber;
| public org.w3c.dom.Node | getNode()
return node;
| public java.lang.Object | getObject()
return object;
| public int | getOffset()
return offset;
| public java.net.URL | getURL()
return url;
| public void | setColumnNumber(int _columnNumber)Set the columnNumber field on this event locator.
this.columnNumber = _columnNumber;
| public void | setLineNumber(int _lineNumber)Set the lineNumber field on this event locator.
this.lineNumber = _lineNumber;
| public void | setNode(org.w3c.dom.Node _node)Set the Node field on this event locator. Null values are allowed.
this.node = _node;
| public void | setObject(java.lang.Object _object)Set the Object field on this event locator. Null values are allowed.
this.object = _object;
| public void | setOffset(int _offset)Set the offset field on this event locator.
this.offset = _offset;
| public void | setURL(java.net.URL _url)Set the URL field on this event locator. Null values are allowed.
this.url = _url;
| public java.lang.String | toString()Returns a string representation of this object in a format
helpful to debugging.
return MessageFormat.format("[node={0},object={1},url={2},line={3},col={4},offset={5}]",
getNode(),
getObject(),
getURL(),
String.valueOf(getLineNumber()),
String.valueOf(getColumnNumber()),
String.valueOf(getOffset()));
| private static java.net.URL | toURL(java.lang.String systemId)Converts a system ID to an URL object.
try {
return new URL(systemId);
} catch( MalformedURLException e ) {
// TODO: how should we handle system id here?
return null; // for now
}
|
|