| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objecttoolbox.parsers.FixedLengthParser
public class FixedLengthParser
Generic parser to parse fixed length data.
| Nested Class Summary | |
|---|---|
(package private)  class | 
FixedLengthParser.FixedParseThread
Thread that creates TextEvent objects from a StreamTokenizer and presents the events to a TextListener instance.  | 
| Constructor Summary | |
|---|---|
FixedLengthParser(java.util.List fields,
                  char padChar,
                  java.lang.String padding,
                  TextListener listener)
Creates a new parser with the given List of field definitions, padding character, padding mode and listener.  | 
|
FixedLengthParser(java.util.List fields,
                  TextListener listener)
Creates a new parser with the given List of field definitions, >empty< character for padding, the "none" padding mode and the given listener.  | 
|
| Method Summary | |
|---|---|
 char | 
getPadChar()
Returns the the padding character that this parser uses.  | 
 java.lang.String | 
getPadding()
Returns the padding mode for this parser.  | 
 void | 
parse(java.io.InputStream is,
      boolean wait)
Parses the given InputStream and notifies the listener of parsing events.  | 
 void | 
setPadChar(char padChar)
Set the padding character for this parser.  | 
 void | 
setPadding(java.lang.String padding)
Set the padding mode for this parser.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public FixedLengthParser(java.util.List fields,
                         char padChar,
                         java.lang.String padding,
                         TextListener listener)
                  throws java.io.IOException
Each entry in the List must be a String in the format "start-end" where start and end are integers indicating the start and end of a specific field.
fields - List containing field definitions.padChar - Character used to pad short fields.padding - String indicating the padding mode. 
                   Valid values are "leading|trailing|none".listener - TextListener that will receive notification of events.
java.io.IOException
public FixedLengthParser(java.util.List fields,
                         TextListener listener)
                  throws java.io.IOException
Each entry in the List must be a String in the format "start-end" where start and end are integers indicating the start and end of a specific field.
fields - List containing field definitions.listener - TextListener that will receive notification of events.
java.io.IOException| Method Detail | 
|---|
public char getPadChar()
public void setPadChar(char padChar)
padChar - New padding character.public java.lang.String getPadding()
public void setPadding(java.lang.String padding)
padding - String indicating the padding mode for this parser.
public void parse(java.io.InputStream is,
                  boolean wait)
           throws java.io.IOException
is - InputStream containing data to parsewait - boolean to indicate whether not this method should wait for
               parsing to stop before returning.
java.io.IOException - if a an exception occurs during parsing.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||