Class ValidationEventLocatorImpl

java.lang.Object
jakarta.xml.bind.helpers.ValidationEventLocatorImpl
All Implemented Interfaces:
ValidationEventLocator

public class ValidationEventLocatorImpl extends Object implements ValidationEventLocator
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.

Since:
1.6, JAXB 1.0
See Also:
  • Field Details

    • url

      private URL url
    • offset

      private int offset
    • lineNumber

      private int lineNumber
    • columnNumber

      private int columnNumber
    • object

      private Object object
    • node

      private Node node
  • Constructor Details

    • ValidationEventLocatorImpl

      public ValidationEventLocatorImpl()
      Creates an object with all fields unavailable.
    • ValidationEventLocatorImpl

      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 - the SAX Locator object that will be used to populate this event locator.
      Throws:
      IllegalArgumentException - if the Locator is null
    • ValidationEventLocatorImpl

      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 - the SAXParseException object that will be used to populate this event locator.
      Throws:
      IllegalArgumentException - if the SAXParseException is null
    • ValidationEventLocatorImpl

      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 - the DOM Node object that will be used to populate this event locator.
      Throws:
      IllegalArgumentException - if the Node is null
    • ValidationEventLocatorImpl

      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 - the Object that will be used to populate this event locator.
      Throws:
      IllegalArgumentException - if the Object is null
  • Method Details

    • toURL

      private static URL toURL(String systemId)
      Converts a system ID to an URL object.
    • getURL

      public URL getURL()
      Description copied from interface: ValidationEventLocator
      Return the name of the XML source as a URL if available
      Specified by:
      getURL in interface ValidationEventLocator
      Returns:
      the name of the XML source as a URL or null if unavailable
      See Also:
    • setURL

      public void setURL(URL _url)
      Set the URL field on this event locator. Null values are allowed.
      Parameters:
      _url - the url
    • getOffset

      public int getOffset()
      Description copied from interface: ValidationEventLocator
      Return the byte offset if available
      Specified by:
      getOffset in interface ValidationEventLocator
      Returns:
      the byte offset into the input source or -1 if unavailable
      See Also:
    • setOffset

      public void setOffset(int _offset)
      Set the offset field on this event locator.
      Parameters:
      _offset - the offset
    • getLineNumber

      public int getLineNumber()
      Description copied from interface: ValidationEventLocator
      Return the line number if available
      Specified by:
      getLineNumber in interface ValidationEventLocator
      Returns:
      the line number or -1 if unavailable
      See Also:
    • setLineNumber

      public void setLineNumber(int _lineNumber)
      Set the lineNumber field on this event locator.
      Parameters:
      _lineNumber - the line number
    • getColumnNumber

      public int getColumnNumber()
      Description copied from interface: ValidationEventLocator
      Return the column number if available
      Specified by:
      getColumnNumber in interface ValidationEventLocator
      Returns:
      the column number or -1 if unavailable
      See Also:
    • setColumnNumber

      public void setColumnNumber(int _columnNumber)
      Set the columnNumber field on this event locator.
      Parameters:
      _columnNumber - the column number
    • getObject

      public Object getObject()
      Description copied from interface: ValidationEventLocator
      Return a reference to the object in the Java content tree if available
      Specified by:
      getObject in interface ValidationEventLocator
      Returns:
      a reference to the object in the Java content tree or null if unavailable
      See Also:
    • setObject

      public void setObject(Object _object)
      Set the Object field on this event locator. Null values are allowed.
      Parameters:
      _object - the java content object
    • getNode

      public Node getNode()
      Description copied from interface: ValidationEventLocator
      Return a reference to the DOM Node if available
      Specified by:
      getNode in interface ValidationEventLocator
      Returns:
      a reference to the DOM Node or null if unavailable
      See Also:
    • setNode

      public void setNode(Node _node)
      Set the Node field on this event locator. Null values are allowed.
      Parameters:
      _node - the Node
    • toString

      public String toString()
      Returns a string representation of this object in a format helpful to debugging.
      Overrides:
      toString in class Object
      See Also: