|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.milyn.edisax.BufferedSegmentReader
public class BufferedSegmentReader
Buffered EDI Stream Segment reader.
| Field Summary | |
|---|---|
static java.lang.String |
IGNORE_CR_LF
|
| Constructor Summary | |
|---|---|
BufferedSegmentReader(org.xml.sax.InputSource ediInputSource,
Delimiters rootDelimiters)
Construct the stream reader. |
|
| Method Summary | |
|---|---|
java.nio.charset.Charset |
changeEncoding(java.nio.charset.Charset encoding)
Change the encoding used to read the underlying EDI data stream. |
java.lang.String[] |
getCurrentSegmentFields()
Get the current EDI segment fields. |
int |
getCurrentSegmentNumber()
Get the current segment "number". |
Delimiters |
getDelimiters()
Get the current delimiter set. |
java.util.Stack<Delimiters> |
getDelimitersStack()
Get the |
java.lang.StringBuffer |
getSegmentBuffer()
Get the segment buffer. |
boolean |
hasCurrentSegment()
Does the read have a segment buffered and ready for processing. |
void |
mark()
Try mark the stream so we can support changing of the reader encoding. |
boolean |
moveToNextSegment()
Move to the next EDI segment. |
boolean |
moveToNextSegment(boolean clearBuffer)
Move to the next EDI segment. |
java.lang.String |
peek(int numChars)
Peek a fixed number of characters from the input source. |
java.lang.String |
peek(int numChars,
boolean ignoreLeadingWhitespace)
Peek a fixed number of characters from the input source. |
void |
popDelimiters()
Restore the parent delimiters set. |
void |
pushDelimiters(Delimiters delimiters)
Push in a new Delimiters set into the reader. |
java.lang.String |
read(int numChars)
Read a fixed number of characters from the input source. |
void |
setIgnoreNewLines(boolean ignoreNewLines)
Set ignore new lines in the EDI Stream. |
void |
setSegmentListener(BufferedSegmentListener segmentListener)
Set the segment listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String IGNORE_CR_LF
| Constructor Detail |
|---|
public BufferedSegmentReader(org.xml.sax.InputSource ediInputSource,
Delimiters rootDelimiters)
ediInputSource - EDI Stream input source.rootDelimiters - Root currentDelimiters. New currentDelimiters can be pushed and popped.| Method Detail |
|---|
public void mark()
changeEncoding(Charset)
public java.nio.charset.Charset changeEncoding(java.nio.charset.Charset encoding)
throws java.io.IOException
mark() should have been called first.
encoding - The new encoding.
java.io.IOException - Failed to skip already read characters.public Delimiters getDelimiters()
public void pushDelimiters(Delimiters delimiters)
Delimiters set into the reader.
delimiters - New delimiters.public void popDelimiters()
get the delimiters stack and check
that it is not empty before popping.
public java.util.Stack<Delimiters> getDelimitersStack()
public void setIgnoreNewLines(boolean ignoreNewLines)
ignoreNewLines - True if new line characters should be ignored, otherwise false.
public java.lang.String read(int numChars)
throws java.io.IOException
numChars - The number of characters to read.
java.io.IOException - Error reading from input source.
public java.lang.String peek(int numChars)
throws java.io.IOException
read(int) in that it leaves the
characters in the segment buffer.
numChars - The number of characters to peeked.
java.io.IOException - Error reading from input source.
public java.lang.String peek(int numChars,
boolean ignoreLeadingWhitespace)
throws java.io.IOException
read(int) in that it leaves the
characters in the segment buffer.
numChars - The number of characters to peeked.ignoreLeadingWhitespace - Ignore leading whitespace.
java.io.IOException - Error reading from input source.public void setSegmentListener(BufferedSegmentListener segmentListener)
segmentListener - The segment listener.
public boolean moveToNextSegment()
throws java.io.IOException
java.io.IOException - Error reading from EDI stream.
public boolean moveToNextSegment(boolean clearBuffer)
throws java.io.IOException
clearBuffer - Clear the segment buffer before reading.
java.io.IOException - Error reading from EDI stream.public boolean hasCurrentSegment()
public java.lang.StringBuffer getSegmentBuffer()
public java.lang.String[] getCurrentSegmentFields()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - No current Segment.public int getCurrentSegmentNumber()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||