Class XmlPosition
- java.lang.Object
-
- com.github.oowekyala.ooxml.messages.XmlPosition
-
public final class XmlPosition extends java.lang.ObjectRepresents the location of an XML node in a file. This is a text range, located on a single line.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateXmlPosition(int line, int column)XmlPosition(java.lang.String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column)XmlPosition(java.lang.String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column, int length)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)@com.github.oowekyala.ooxml.messages.Annots.OneBased intgetColumn()Returns the (1-based) column number of the start of this range.intgetLength()Returns the length of the text range.@com.github.oowekyala.ooxml.messages.Annots.OneBased intgetLine()Returns the (1-based) line number of this position.java.lang.StringgetSystemId()The system ID of the file where the node is located.inthashCode()booleanisUndefined()If true, column and line numbers are unreliablejava.lang.StringtoString()static XmlPositionundefinedIn(java.lang.String systemId)Returns an undefined position in a document identified by the given system ID.
-
-
-
Field Detail
-
UNDEFINED
public static final XmlPosition UNDEFINED
-
line
private final int line
-
column
private final int column
-
length
private final int length
-
systemId
private final java.lang.String systemId
-
-
Constructor Detail
-
XmlPosition
private XmlPosition(int line, int column)
-
XmlPosition
public XmlPosition(java.lang.String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column)
-
XmlPosition
public XmlPosition(java.lang.String systemId, @com.github.oowekyala.ooxml.messages.Annots.OneBased int line, @com.github.oowekyala.ooxml.messages.Annots.OneBased int column, int length)
-
-
Method Detail
-
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 java.lang.String getSystemId()
The system ID of the file where the node is located.- See Also:
Locator.getSystemId()
-
isUndefined
public boolean isUndefined()
If true, column and line numbers are unreliable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
undefinedIn
public static XmlPosition undefinedIn(java.lang.String systemId)
Returns an undefined position in a document identified by the given system ID.- Parameters:
systemId- System ID- Returns:
- An undefined position
-
-