public class PairWithPosition extends ImmutablePair implements SourceLocator
Pair
with the file name and position it was read from.
Note the position (start/end range) is actually that of the car part.SourceLocator.Simple
car, cdr, incompleteListMarker
noInts
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
Constructor and Description |
---|
PairWithPosition()
Only for serialization.
|
PairWithPosition(java.lang.Object car,
java.lang.Object cdr) |
PairWithPosition(SourceLocator where,
java.lang.Object car,
java.lang.Object cdr) |
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber()
Return current column number.
|
int |
getEndColumn()
Column (one-origin) of end of range; unknown/unspecified is -1.
|
int |
getEndLine()
Line number (one-origin) of end of range; unknown/unspecified is -1.
|
java.lang.String |
getFileName()
Normally same as getSystemId.
|
int |
getLineNumber()
Return current line number.
|
java.lang.String |
getPublicId() |
int |
getStartColumn()
Column (one-origin) of start of range; unknown/unspecified is -1.
|
int |
getStartLine()
Line number (one-origin) of start of range; unknown/unspecified is -1.
|
java.lang.String |
getSystemId() |
void |
init(java.lang.Object car,
java.lang.Object cdr,
java.lang.String filename,
long position)
Should only be used when initializing a PairWithPosition instance.
|
boolean |
isStableSourceLocation()
True if position is unlikely to change.
|
static PairWithPosition |
make(java.lang.Object car,
java.lang.Object cdr,
java.lang.String filename,
int line,
int column) |
static PairWithPosition |
make(java.lang.Object car,
java.lang.Object cdr,
java.lang.String filename,
long position) |
void |
readExternal(java.io.ObjectInput in) |
void |
setEndLine(int endline,
int endcolumn) |
void |
setFile(java.lang.String filename) |
void |
setLine(int lineno) |
void |
setLine(int lineno,
int colno) |
void |
writeExternal(java.io.ObjectOutput out) |
setCar, setCdr
compareTo, compareTo, equals, equals, get, getCar, getCdr, getPosNext, getPosPrevious, hasNext, isEmpty, lastPair, length, make, nextPos, readResolve, setCarBackdoor, setCdrBackdoor, size, toArray, toArray
boundedHash, chain1, chain4, checkNonList, consume, consX, createPos, createRelativePos, getIterator, hashCode, length, list1, list2, list3, list4, listLength, makeList, makeList, makeList, reverseInPlace, setPosNext, setPosPrevious, toString
copyPos, isAfterPos, nextIndex, releasePos
add, add, addAll, addAll, addPos, asImmutable, badRank, checkCanWrite, checkRank, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, get, get, get, getAttribute, getAttributeLength, getBooleanRaw, getByteRaw, getCharRaw, getContainingSequenceSize, getDoubleRaw, getElementKind, getFloatRaw, getIndexDifference, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hasPrevious, indexOf, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, parentPos, previousPos, rank, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setRaw, stableCompare, startPos, subList, subSequence, subSequencePos, toString, unsupported, unsupportedException
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public PairWithPosition()
public PairWithPosition(SourceLocator where, java.lang.Object car, java.lang.Object cdr)
public PairWithPosition(java.lang.Object car, java.lang.Object cdr)
public final void setFile(java.lang.String filename)
public final void setLine(int lineno, int colno)
public final void setEndLine(int endline, int endcolumn)
public final void setLine(int lineno)
public final java.lang.String getFileName()
SourceLocator
public java.lang.String getPublicId()
getPublicId
in interface javax.xml.transform.SourceLocator
getPublicId
in interface org.xml.sax.Locator
public java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.SourceLocator
getSystemId
in interface org.xml.sax.Locator
public final int getLineNumber()
SourceLocator
getStartLine()
.
The "first" line is line 1; unknown is -1.getLineNumber
in interface javax.xml.transform.SourceLocator
getLineNumber
in interface org.xml.sax.Locator
public final int getColumnNumber()
SourceLocator
getStartColumn()
.
The "first" column is column 1; unknown is -1.getColumnNumber
in interface javax.xml.transform.SourceLocator
getColumnNumber
in interface org.xml.sax.Locator
public final int getStartLine()
SourceLocator
public final int getStartColumn()
SourceLocator
public final int getEndLine()
SourceLocator
public final int getEndColumn()
SourceLocator
public boolean isStableSourceLocation()
SourceLocator
public static PairWithPosition make(java.lang.Object car, java.lang.Object cdr, java.lang.String filename, int line, int column)
public static PairWithPosition make(java.lang.Object car, java.lang.Object cdr, java.lang.String filename, long position)
public void init(java.lang.Object car, java.lang.Object cdr, java.lang.String filename, long position)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class Pair
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class Pair
java.io.IOException
java.lang.ClassNotFoundException