Class XmlPosition

java.lang.Object
com.github.oowekyala.ooxml.messages.XmlPosition

public final class XmlPosition extends Object
Represents the location of an XML node in a file. This is a text range, located on a single line.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private final int
     
    private final int
     
    private final String
     
    static final XmlPosition
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    XmlPosition(int line, int column)
     
     
    XmlPosition(String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column)
     
     
    XmlPosition(String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column, int length)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    @com.github.oowekyala.ooxml.messages.Annots.OneBased int
    Returns the (1-based) column number of the start of this range.
    int
    Returns the length of the text range.
    @com.github.oowekyala.ooxml.messages.Annots.OneBased int
    Returns the (1-based) line number of this position.
    The system ID of the file where the node is located.
    int
     
    boolean
    If true, column and line numbers are unreliable
     
    undefinedIn(String systemId)
    Returns an undefined position in a document identified by the given system ID.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • UNDEFINED

      public static final XmlPosition UNDEFINED
    • line

      private final int line
    • column

      private final int column
    • length

      private final int length
    • systemId

      private final String systemId
  • Constructor Details

    • XmlPosition

      private XmlPosition(int line, int column)
    • XmlPosition

      public XmlPosition(String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column)
    • XmlPosition

      public XmlPosition(String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column, int length)
  • Method Details

    • getLine

      public @com.github.oowekyala.ooxml.messages.Annots.OneBased int getLine()
      Returns the (1-based) line number of this position. If this position is undefined, the result is garbage.
    • getColumn

      public @com.github.oowekyala.ooxml.messages.Annots.OneBased int getColumn()
      Returns the (1-based) column number of the start of this range. If this position is undefined, the result is garbage.
    • getLength

      public int getLength()
      Returns the length of the text range.
    • getSystemId

      public String getSystemId()
      The system ID of the file where the node is located.
      See Also:
    • isUndefined

      public boolean isUndefined()
      If true, column and line numbers are unreliable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • undefinedIn

      public static XmlPosition undefinedIn(String systemId)
      Returns an undefined position in a document identified by the given system ID.
      Parameters:
      systemId - System ID
      Returns:
      An undefined position