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

public final Class CharArraySource

extends BaseInputSource
Class Inheritance
Imports
javax.xml.stream.Location

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

Modifier and TypeField and Description
pack-priv final Location
pack-priv int
Inherited from com.ctc.wstx.io.BaseInputSource:
mBuffermInputLastmParentLocationmPublicIdmSavedInputProcessedmSavedInputPtrmSavedInputRowmSavedInputRowStartmSystemId

Constructor Summary

AccessConstructor and Description
protected
CharArraySource(WstxInputSource parent, String fromEntity, char[] chars, int offset, int len, Location loc, SystemId sysId)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract com.ctc.wstx.io.BaseInputSource.close.

Method reader calls for this input source when it has encountered EOF.

public void
closeCompletely()

Implements abstract com.ctc.wstx.io.WstxInputSource.closeCompletely.

Method reader MAY call to force full closing of the underlying input stream(s)/reader(s).

protected void
doInitInputLocation(WstxInputData reader)

Implements abstract com.ctc.wstx.io.BaseInputSource.doInitInputLocation.

Unlike with reader source, we won't start from beginning of a file, but usually from somewhere in the middle...

public boolean
fromInternalEntity()

Implements abstract com.ctc.wstx.io.BaseInputSource.fromInternalEntity.

This is a hard-coded assumption, but yes, for now this source is only created from internal entities.

public int
readInto(WstxInputData reader)

Implements abstract com.ctc.wstx.io.BaseInputSource.readInto.

Method called to read at least one more char from input source, and update input data appropriately.

public boolean
readMore(WstxInputData reader, int minAmount)

Implements abstract com.ctc.wstx.io.BaseInputSource.readMore.

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.

Inherited from com.ctc.wstx.io.BaseInputSource:
getLocationgetLocationgetPublicIdgetSourcegetSystemIdoverrideSourcerestoreContextsaveContext

Field Detail

mContentStartback to summary
pack-priv final Location mContentStart
mOffsetback to summary
pack-priv int mOffset

Constructor Detail

CharArraySourceback to summary
protected CharArraySource(WstxInputSource parent, String fromEntity, char[] chars, int offset, int len, Location loc, SystemId sysId)

Method Detail

closeback to summary
public void close()

Implements abstract com.ctc.wstx.io.BaseInputSource.close.

Doc from com.ctc.wstx.io.WstxInputSource.close.

Method 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

Annotations
@Override
closeCompletelyback to summary
public void closeCompletely()

Implements abstract com.ctc.wstx.io.WstxInputSource.closeCompletely.

Doc from com.ctc.wstx.io.WstxInputSource.closeCompletely.

Method 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).

Annotations
@Override
doInitInputLocationback to summary
protected void doInitInputLocation(WstxInputData reader)

Implements abstract com.ctc.wstx.io.BaseInputSource.doInitInputLocation.

Unlike with reader source, we won't start from beginning of a file, but usually from somewhere in the middle...

Annotations
@Override
fromInternalEntityback to summary
public boolean fromInternalEntity()

Implements abstract com.ctc.wstx.io.BaseInputSource.fromInternalEntity.

This is a hard-coded assumption, but yes, for now this source is only created from internal entities.

Returns:boolean

Doc from com.ctc.wstx.io.WstxInputSource.fromInternalEntity.

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)

Annotations
@Override
readIntoback to summary
public int readInto(WstxInputData reader)

Implements abstract com.ctc.wstx.io.BaseInputSource.readInto.

Doc from com.ctc.wstx.io.WstxInputSource.readInto.

Method called to read at least one more char from input source, and update input data appropriately.

Returns:int

Number of characters read from the input source (at least 1), if it had any input; -1 if input source has no more input.

Annotations
@Override
readMoreback to summary
public boolean readMore(WstxInputData reader, int minAmount)

Implements abstract com.ctc.wstx.io.BaseInputSource.readMore.

Doc from com.ctc.wstx.io.WstxInputSource.readMore.

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. 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).

Returns:boolean

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.

Annotations
@Override