Class CharacterInput
- java.lang.Object
-
- org.apache.manifoldcf.core.interfaces.PersistentDatabaseObject
-
- org.apache.manifoldcf.core.interfaces.CharacterInput
-
- Direct Known Subclasses:
NullCharacterInput,TempFileCharacterInput
public abstract class CharacterInput extends PersistentDatabaseObject
This class represents a lightweight length-determined character stream. It is used as a parameter in parameterized queries that use strings. There are no implied semantics in this class around managing the stream itself. These semantics must be handled by a derived class.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected longcharLengthprotected java.lang.StringhashValueprotected java.io.Readerstream
-
Constructor Summary
Constructors Constructor Description CharacterInput()Construct from nothing.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcalculateHashValue()Calculate the datum's hash valueprotected abstract voidcalculateLength()Calculate the datum's length in charactersprotected voidcloseStream()Close any open readervoiddiscard()Discard this object permanentlyvoiddoneWithStream()Close any open streams, but do NOT remove the backing object.longgetCharacterLength()java.lang.StringgetHashValue()java.io.ReadergetStream()abstract java.io.InputStreamgetUtf8Stream()Open a Utf8 stream directlyabstract longgetUtf8StreamLength()Get binary UTF8 stream length directlyprotected static voidhandleIOException(java.io.IOException e, java.lang.String context)protected abstract voidopenStream()Open a reader, for use by a caller, until closeStream is calledabstract CharacterInputtransfer()Transfer to a new object; this causes the current object to become "already discarded"
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
stream
protected java.io.Reader stream
-
charLength
protected long charLength
-
hashValue
protected java.lang.String hashValue
-
-
Method Detail
-
getStream
public java.io.Reader getStream() throws ManifoldCFException- Throws:
ManifoldCFException
-
doneWithStream
public void doneWithStream() throws ManifoldCFExceptionDescription copied from class:PersistentDatabaseObjectClose any open streams, but do NOT remove the backing object. Thus the stream can be reopened in the future.- Specified by:
doneWithStreamin classPersistentDatabaseObject- Throws:
ManifoldCFException
-
getCharacterLength
public long getCharacterLength() throws ManifoldCFException- Throws:
ManifoldCFException
-
getHashValue
public java.lang.String getHashValue() throws ManifoldCFException- Throws:
ManifoldCFException
-
getUtf8Stream
public abstract java.io.InputStream getUtf8Stream() throws ManifoldCFExceptionOpen a Utf8 stream directly- Throws:
ManifoldCFException
-
getUtf8StreamLength
public abstract long getUtf8StreamLength() throws ManifoldCFExceptionGet binary UTF8 stream length directly- Throws:
ManifoldCFException
-
transfer
public abstract CharacterInput transfer()
Transfer to a new object; this causes the current object to become "already discarded"
-
discard
public void discard() throws ManifoldCFExceptionDiscard this object permanently- Specified by:
discardin classPersistentDatabaseObject- Throws:
ManifoldCFException
-
openStream
protected abstract void openStream() throws ManifoldCFExceptionOpen a reader, for use by a caller, until closeStream is called- Throws:
ManifoldCFException
-
closeStream
protected void closeStream() throws ManifoldCFExceptionClose any open reader- Throws:
ManifoldCFException
-
calculateLength
protected abstract void calculateLength() throws ManifoldCFExceptionCalculate the datum's length in characters- Throws:
ManifoldCFException
-
calculateHashValue
protected abstract void calculateHashValue() throws ManifoldCFExceptionCalculate the datum's hash value- Throws:
ManifoldCFException
-
handleIOException
protected static void handleIOException(java.io.IOException e, java.lang.String context) throws ManifoldCFException- Throws:
ManifoldCFException
-
-