Top Description Fields Constructors Methods
com.ctc.wstx.io

public Class WstxInputLocation

extends Object
implements Serializable, XMLStreamLocation2
Class Inheritance
All Implemented Interfaces
org.codehaus.stax2.XMLStreamLocation2, javax.xml.stream.Location, java.io.Serializable
Imports
java.io.Serializable, javax.xml.stream.Location, org.codehaus.stax2.XMLStreamLocation2, com.ctc.wstx.util.StringUtil

Basic implementation of Location, used by Wstx readers.

Field Summary

Modifier and TypeField and Description
protected final long
protected final int
protected final WstxInputLocation
mContext

Enclosing (parent) input location; location from which current location is derived.

protected transient String
protected final String
protected final int
protected final String
private static final WstxInputLocation
private static final long

Constructor Summary

AccessConstructor and Description
public
WstxInputLocation(WstxInputLocation
Enclosing input location, if any
ctxt
,
String pubId, String sysId, long charOffset, int row, int col)

public
WstxInputLocation(WstxInputLocation ctxt, String pubId, SystemId sysId, long charOffset, int row, int col)

Method Summary

Modifier and TypeMethod and Description
private void
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

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 long
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 WstxInputLocation
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 int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

mCharOffsetback to summary
protected final long mCharOffset
mColback to summary
protected final int mCol
mContextback to summary
protected final WstxInputLocation mContext

Enclosing (parent) input location; location from which current location is derived.

mDescback to summary
protected transient String mDesc
mPublicIdback to summary
protected final String mPublicId
mRowback to summary
protected final int mRow
mSystemIdback to summary
protected final String mSystemId
sEmptyLocationback to summary
private static final WstxInputLocation sEmptyLocation
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

WstxInputLocationback to summary
public WstxInputLocation(WstxInputLocation ctxt, String pubId, String sysId, long charOffset, int row, int col)
Parameters
ctxt:WstxInputLocation

Enclosing input location, if any

WstxInputLocationback to summary
public WstxInputLocation(WstxInputLocation ctxt, String pubId, SystemId sysId, long charOffset, int row, int col)

Method Detail

appendDescback to summary
private void appendDesc(StringBuilder sb)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
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
getCharacterOffsetLongback to summary
public long getCharacterOffsetLong()
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 WstxInputLocation 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
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

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. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override