public abstract class WstxInputSource extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
mEntityDepth
Number of parent entities that have been expanded to get to this
input source; 0 for root-level input that is not generated via
entity expansion.
|
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.
|
Modifier | Constructor and Description |
---|---|
protected |
WstxInputSource(WstxInputSource parent,
String fromEntity) |
Modifier and Type | Method and Description |
---|---|
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() |
int |
getEntityDepth() |
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,
int entityDepth)
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() |
protected final WstxInputSource mParent
protected final String mFromEntity
protected int mScopeId
protected int mEntityDepth
protected WstxInputSource(WstxInputSource parent, String fromEntity)
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() throws IOException
IOException
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 int getEntityDepth()
public final void initInputLocation(WstxInputData reader, int currScopeId, int entityDepth)
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
Copyright © 2012–2015 FasterXML. All rights reserved.