|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.presentation.Source
biz.c24.io.api.presentation.SwiftSource
public class SwiftSource
Created by IntelliJ IDEA. User: divanmostert Date: 14/11/2011 Time: 14:16
Constructor Summary | |
---|---|
SwiftSource()
Constructs a new instance. |
|
SwiftSource(InputStream stream)
Constructs a new instance which will read from stream . |
|
SwiftSource(Reader reader)
Constructs a new instance which will read from reader . |
|
SwiftSource(SwiftSource clone)
Constructs a new instance cloned from clone . |
Method Summary | |
---|---|
Object |
clone()
|
BorderedCharDataReader |
getBuffer()
|
int |
getLookAhead()
Returns the maximum number of characters to look ahead. |
int |
getLookBehind()
Returns the maximum number of characters to look behind. |
InputStream |
getMarkableInputStream()
|
boolean |
isEndOfDataRequired()
Returns whether the stream / reader must be emptied for the read to succeed. |
void |
readObject(ComplexDataObject object)
Reads an object from the the reader or input stream that has been set (optional operation). |
ComplexDataObject |
readObject(Element element)
Reads an object from the the reader or input stream that has been set. |
boolean |
ready()
Tests whether the underlying stream or reader contains more data waiting to be parsed. |
void |
setEndOfDataRequired(boolean endOfDataRequired)
Sets whether the stream / reader must be emptied for the read to succeed. |
void |
setInputStream(InputStream stream,
URI systemId)
Sets the input stream and system ID (optional operation). |
void |
setLookAhead(int lookAhead)
Sets the maximum number of characters to look ahead. |
void |
setLookBehind(int lookBehind)
Sets the maximum number of characters to look behind. |
void |
setReader(Reader reader,
URI systemId)
Sets the reader (optional operation). |
Methods inherited from class biz.c24.io.api.presentation.Source |
---|
checkInit, getEncoding, getInputStream, getParseListener, getReader, getSystemId, reader, setEncoding, setInputStream, setParseListener, setReader, setSystemId, stream |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwiftSource()
public SwiftSource(SwiftSource clone)
clone
.
clone
- The instance to clone.public SwiftSource(Reader reader)
reader
.
reader
- The reader to read the data from.public SwiftSource(InputStream stream)
stream
.
stream
- The stream to read the data from.Method Detail |
---|
public boolean ready()
Source
Reader.ready()
and InputStream.available()
since it may need to take into account data which has been buffered by the Source implementation.
ready
in class Source
public int getLookAhead()
public void setLookAhead(int lookAhead)
lookAhead
- The new look ahead value.public int getLookBehind()
public void setLookBehind(int lookBehind)
lookBehind
- The new look behind value.public boolean isEndOfDataRequired()
public void setEndOfDataRequired(boolean endOfDataRequired)
false
if the readObject method is to be called more
than once on the same stream / reader or if the calling code is not concerend about additional data such as blank
lines. Set this parameter to true
(the default) if you are expecting the stream / reader to contain one and only
one data instance.
endOfDataRequired
- Whether an end of data marker is required in the stream / reader.public void setReader(Reader reader, URI systemId)
Source
setReader
in class Source
reader
- The new value.systemId
- The system ID identifying the reader.public void setInputStream(InputStream stream, URI systemId)
Source
setInputStream
in class Source
stream
- The new value.systemId
- The system ID identifying the stream.public ComplexDataObject readObject(Element element) throws IOException
Source
readObject
in class Source
element
- The element declaration to which the input data is expected to adhere.
IOException
- If the complete object could not be read for any reason.public void readObject(ComplexDataObject object) throws IOException
Source
readObject
in class Source
object
- The object into which the input data should be parsed.
IOException
- If the complete object could not be read for any reason.public Object clone()
clone
in class Source
public InputStream getMarkableInputStream()
getMarkableInputStream
in class Source
public BorderedCharDataReader getBuffer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |