Class CharArraySource
java.lang.Object
com.ctc.wstx.io.WstxInputSource
com.ctc.wstx.io.BaseInputSource
com.ctc.wstx.io.CharArraySource
Input source that reads input from a static char array, usually used
when expanding internal entities. It can also be used if the input
given is a raw character array.
-
Field Summary
FieldsFields inherited from class BaseInputSource
mBuffer, mInputLast, mParentLocation, mPublicId, mSavedInputProcessed, mSavedInputPtr, mSavedInputRow, mSavedInputRowStart, mSystemIdFields inherited from class WstxInputSource
mEntityDepth, mFromEntity, mParent, mScopeId -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCharArraySource(WstxInputSource parent, String fromEntity, char[] chars, int offset, int len, Location loc, SystemId sysId) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Method reader calls for this input source when it has encountered EOF.voidMethod reader MAY call to force full closing of the underlying input stream(s)/reader(s).protected voiddoInitInputLocation(WstxInputData reader) Unlike with reader source, we won't start from beginning of a file, but usually from somewhere in the middle...booleanThis is a hard-coded assumption, but yes, for now this source is only created from internal entities.intreadInto(WstxInputData reader) Method called to read at least one more char from input source, and update input data appropriately.booleanreadMore(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.Methods inherited from class BaseInputSource
getLocation, getLocation, getPublicId, getSource, getSystemId, overrideSource, restoreContext, saveContextMethods inherited from class WstxInputSource
getEntityDepth, getEntityId, getParent, getScopeId, initInputLocation, isOrIsExpandedFrom, toString
-
Field Details
-
mOffset
int mOffset -
mContentStart
-
-
Constructor Details
-
CharArraySource
protected CharArraySource(WstxInputSource parent, String fromEntity, char[] chars, int offset, int len, Location loc, SystemId sysId)
-
-
Method Details
-
fromInternalEntity
public boolean fromInternalEntity()This is a hard-coded assumption, but yes, for now this source is only created from internal entities.- Specified by:
fromInternalEntityin classBaseInputSource- Returns:
- True, if this input source was directly expanded from an internal entity (general, parsed); false if not (from external entity, DTD ext. subset, main document)
-
doInitInputLocation
Unlike with reader source, we won't start from beginning of a file, but usually from somewhere in the middle...- Specified by:
doInitInputLocationin classBaseInputSource
-
readInto
Description copied from class:WstxInputSourceMethod called to read at least one more char from input source, and update input data appropriately.- Specified by:
readIntoin classBaseInputSource- Returns:
- Number of characters read from the input source (at least 1), if it had any input; -1 if input source has no more input.
-
readMore
Description copied from class:WstxInputSourceMethod 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. If so, it asks input source to do whatever it has to do to try to get more data, if possible (including moving stuff in input buffer if necessary and possible).- Specified by:
readMorein classBaseInputSource- Returns:
- True if input source was able to provide specific number of characters or more; false if not. In latter case, source is free to return zero or more characters any way.
-
close
public void close()Description copied from class:WstxInputSourceMethod reader calls for this input source when it has encountered EOF. This may or may not close the underlying stream/reader; what happens depends on configuration- Specified by:
closein classBaseInputSource
-
closeCompletely
public void closeCompletely()Description copied from class:WstxInputSourceMethod reader MAY call to force full closing of the underlying input stream(s)/reader(s). No checks are done regarding configuration, but input source object is to deal gracefully with multiple calls (ie. it's not an error for reader to call this more than once).- Specified by:
closeCompletelyin classWstxInputSource
-