|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.io.WstxInputSource
public abstract class WstxInputSource
Interface that defines API actual parsers (stream readers) can use to read input from various input sources. Needed to abstract out details of getting input from primary input files, secondary (potentially cached) referenced documents, and from parsed entities, as well as for allowing hierarchic location information for error reporting.
Field Summary | |
---|---|
protected String |
mFromEntity
Name/id of the entity that was expanded to produce this input source; null if not entity-originated. |
protected WstxInputSource |
mParent
Parent in input source stack |
protected int |
mScopeId
Scope of the reader when this entity was initially expanded. |
Constructor Summary | |
---|---|
protected |
WstxInputSource(WstxInputSource parent,
String fromEntity)
|
Method Summary | |
---|---|
abstract void |
close()
Method reader calls for this input source when it has encountered EOF. |
abstract void |
closeCompletely()
Method reader MAY call to force full closing of the underlying input stream(s)/reader(s). |
protected abstract void |
doInitInputLocation(WstxInputData reader)
|
abstract boolean |
fromInternalEntity()
|
String |
getEntityId()
|
protected abstract WstxInputLocation |
getLocation()
Method usually called to get a parent location for another input source. |
abstract WstxInputLocation |
getLocation(long total,
int row,
int col)
|
WstxInputSource |
getParent()
|
abstract String |
getPublicId()
|
int |
getScopeId()
|
abstract URL |
getSource()
|
abstract String |
getSystemId()
|
void |
initInputLocation(WstxInputData reader,
int currScopeId)
Method called by Reader when current input has changed to come from this input source. |
boolean |
isOrIsExpandedFrom(String entityId)
Method that checks if this input source expanded from the specified entity id, directly or by ancestor. |
abstract void |
overrideSource(URL url)
Method that can be called to override originally defined source. |
abstract int |
readInto(WstxInputData reader)
Method called to read at least one more char from input source, and update input data appropriately. |
abstract boolean |
readMore(WstxInputData reader,
int minAmount)
Method called by reader when it has to have at least specified number of consequtive input characters in its buffer, and it currently does not have. |
abstract void |
restoreContext(WstxInputData reader)
Method Reader calls when this input source is resumed as the current source. |
abstract void |
saveContext(WstxInputData reader)
Method Reader calls when this input source is being stored, when a nested input source gets used instead (due to entity expansion). |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final WstxInputSource mParent
protected final String mFromEntity
protected int mScopeId
Constructor Detail |
---|
protected WstxInputSource(WstxInputSource parent, String fromEntity)
Method Detail |
---|
public abstract void overrideSource(URL url)
url
- New base URL to set; may be null.public final WstxInputSource getParent()
public boolean isOrIsExpandedFrom(String entityId)
Note that entity ids are expected to have been interned (using whatever uniqueness mechanism used), and thus can be simply identity checked.
public abstract boolean fromInternalEntity()
public abstract URL getSource()
public abstract String getPublicId()
public abstract String getSystemId()
protected abstract WstxInputLocation getLocation()
public abstract WstxInputLocation getLocation(long total, int row, int col)
public String getEntityId()
public int getScopeId()
public final void initInputLocation(WstxInputData reader, int currScopeId)
reader
- Reader whose data structures are to be used for
returning data readcurrScopeId
- protected abstract void doInitInputLocation(WstxInputData reader)
public abstract int readInto(WstxInputData reader) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract boolean readMore(WstxInputData reader, int minAmount) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void saveContext(WstxInputData reader)
public abstract void restoreContext(WstxInputData reader)
public abstract void close() throws IOException
IOException
public abstract void closeCompletely() throws IOException
IOException
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |