Top Description Fields Constructors Methods
com.fasterxml.aalto.impl

public Class LocationImpl

extends Object
implements XMLStreamLocation2
Class Inheritance
All Implemented Interfaces
org.codehaus.stax2.XMLStreamLocation2, javax.xml.stream.Location
Imports
org.codehaus.stax2.XMLStreamLocation2

Basic implementation of XMLStreamLocation2, used by stream readers and writers.

Field Summary

Modifier and TypeField and Description
protected final int
protected final int
protected transient String
protected final String
protected final int
protected final String
private static final LocationImpl

Constructor Summary

AccessConstructor and Description
public
LocationImpl(String pubId, String sysId, int charOffset, int row, int col)

Method Summary

Modifier and TypeMethod and Description
private void
public static LocationImpl
fromZeroBased(String pubId, String sysId, long rawOffset, int rawRow, int rawCol)

Helper method that will adjust given internal zero-based values to 1-based values that should be externally visible.

public int
getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Return the byte or character offset into the input source this location is pointing to.
public int
getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Return the column number where the current event ends, returns -1 if none is available.
public XMLStreamLocation2
getContext()

Implements org.codehaus.stax2.XMLStreamLocation2.getContext.

Method that can be used to traverse nested locations, like ones created when expanding entities (especially external entities).
public static LocationImpl
public int
getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Return the line number where the current event ends, returns -1 if none is available.
public String
getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Returns the public ID of the XML
public String
getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Returns the system ID of the XML
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_charOffsetback to summary
protected final int _charOffset
_colback to summary
protected final int _col
_descback to summary
protected transient String _desc
_publicIdback to summary
protected final String _publicId
_rowback to summary
protected final int _row
_systemIdback to summary
protected final String _systemId
EMPTYback to summary
private static final LocationImpl EMPTY

Constructor Detail

LocationImplback to summary
public LocationImpl(String pubId, String sysId, int charOffset, int row, int col)

Method Detail

appendDescback to summary
private void appendDesc(StringBuffer sb)
fromZeroBasedback to summary
public static LocationImpl fromZeroBased(String pubId, String sysId, long rawOffset, int rawRow, int rawCol)

Helper method that will adjust given internal zero-based values to 1-based values that should be externally visible.

getCharacterOffsetback to summary
public int getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Doc from javax.xml.stream.Location.getCharacterOffset.

Return the byte or character offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.

Returns:int

the current offset

Annotations
@Override
getColumnNumberback to summary
public int getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Doc from javax.xml.stream.Location.getColumnNumber.

Return the column number where the current event ends, returns -1 if none is available.

Returns:int

the current column number

Annotations
@Override
getContextback to summary
public XMLStreamLocation2 getContext()

Implements org.codehaus.stax2.XMLStreamLocation2.getContext.

Doc from org.codehaus.stax2.XMLStreamLocation2.getContext.

Method that can be used to traverse nested locations, like ones created when expanding entities (especially external entities). If so, single location object only contains information about specific offsets and ids, and a link to its context. Outermost location will return null to indicate there is no more information to retrieve.

Returns:XMLStreamLocation2

Location in the context (parent input source), if any; null for locations in the outermost known context

Annotations
@Override
getEmptyLocationback to summary
public static LocationImpl getEmptyLocation()
getLineNumberback to summary
public int getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Doc from javax.xml.stream.Location.getLineNumber.

Return the line number where the current event ends, returns -1 if none is available.

Returns:int

the current line number

Annotations
@Override
getPublicIdback to summary
public String getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Doc from javax.xml.stream.Location.getPublicId.

Returns the public ID of the XML

Returns:String

the public ID, or null if not available

Annotations
@Override
getSystemIdback to summary
public String getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Doc from javax.xml.stream.Location.getSystemId.

Returns the system ID of the XML

Returns:String

the system ID, or null if not available

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override