org.codehaus.stax2.ri
Class Stax2LocationAdapter

java.lang.Object
  extended by org.codehaus.stax2.ri.Stax2LocationAdapter
All Implemented Interfaces:
Location, XMLStreamLocation2

public class Stax2LocationAdapter
extends Object
implements XMLStreamLocation2

Simple implementation of XMLStreamLocation2, which just wraps Stax 1.0 Location and adds no-operation implementation of the additions.


Field Summary
protected  Location mParentLocation
           
protected  Location mWrappedLocation
           
 
Fields inherited from interface org.codehaus.stax2.XMLStreamLocation2
NOT_AVAILABLE
 
Constructor Summary
Stax2LocationAdapter(Location loc)
           
Stax2LocationAdapter(Location loc, Location parent)
           
 
Method Summary
 int getCharacterOffset()
           
 int getColumnNumber()
           
 XMLStreamLocation2 getContext()
          Method that can be used to traverse nested locations, like ones created when expanding entities (especially external entities).
 int getLineNumber()
           
 String getPublicId()
           
 String getSystemId()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mWrappedLocation

protected final Location mWrappedLocation

mParentLocation

protected final Location mParentLocation
Constructor Detail

Stax2LocationAdapter

public Stax2LocationAdapter(Location loc)

Stax2LocationAdapter

public Stax2LocationAdapter(Location loc,
                            Location parent)
Method Detail

getCharacterOffset

public int getCharacterOffset()
Specified by:
getCharacterOffset in interface Location

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface Location

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface Location

getPublicId

public String getPublicId()
Specified by:
getPublicId in interface Location

getSystemId

public String getSystemId()
Specified by:
getSystemId in interface Location

getContext

public XMLStreamLocation2 getContext()
Description copied from interface: XMLStreamLocation2
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.

Specified by:
getContext in interface XMLStreamLocation2
Returns:
Location in the context (parent input source), if any; null for locations in the outermost known context


Copyright © 2011 Codehaus. All Rights Reserved.