|
Sun Message Library for SWIFT API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.swift.builder.SwiftHRFReader
public abstract class SwiftHRFReader
Read in a text file as lines of charactors, check the following:
Constructor Summary | |
---|---|
SwiftHRFReader(SwiftHRFHeuristics rules)
|
Method Summary | |
---|---|
java.lang.String |
filterOutTags(java.lang.String text,
java.lang.String[] tags)
|
java.lang.String[] |
getDelimitedMultiValues(java.lang.String line,
java.lang.String delim,
java.util.regex.Pattern patt)
convenient wrapper - get multiple values and filter out deleted values (contents quoted by |
java.lang.String[] |
getDelimitedMultiValues(java.lang.String line,
java.lang.String delim,
java.util.regex.Pattern patt,
boolean stripDEL)
given a line and delim, split the line by delim, and extract value from each component by applying the regex - pattern, if stripDEL is true, also filter out the |
abstract void |
parse(java.io.File input)
parse the html file input |
java.util.List |
parseFormatSection(java.lang.String line)
return a list of multiple values - list of String[]; |
java.lang.String |
readNextElement(java.io.LineNumberReader reader,
java.lang.String currLine,
java.lang.String openTag,
java.lang.String closeTag,
int srchLimitOpen,
int srchLimitClose,
boolean inclusive,
java.lang.String[] lastLine,
java.lang.String terminator)
given open and close tags and a current line of text processed, return the string that is enveloped with open and close tag |
java.lang.String |
readNextElement(java.lang.String currLine,
java.lang.String openTag,
java.lang.String closeTag,
int srchLimitOpen,
int srchLimitClose,
boolean inclusive,
java.lang.String[] lastLine,
java.lang.String terminator)
given open and close tags and a current line of text processed, return the string that is enveloped with open and close tag |
java.lang.String |
readTagWithValue(java.io.LineNumberReader reader,
java.lang.String curLine,
java.lang.String tagOpen,
java.lang.String tagClose,
java.lang.String value)
read until a line contains the pattern , also contains the keyword; |
java.lang.String |
readUtil(java.io.LineNumberReader reader,
java.lang.String curLine,
java.lang.String pattern)
read until a line contains the pattern ; |
java.lang.String |
readUtil(java.io.LineNumberReader reader,
java.lang.String curLine,
java.lang.String tag,
boolean open,
boolean inclusive,
java.lang.String[] lastLineRead)
read lines until the line contains the given tag found; |
java.lang.String |
readUtil(java.lang.String curLine,
java.lang.String pattern)
|
java.lang.String |
readUtil(java.lang.String curLine,
java.lang.String tag,
boolean open,
boolean inclusive,
java.lang.String[] lastLineRead)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwiftHRFReader(SwiftHRFHeuristics rules)
Method Detail |
---|
public abstract void parse(java.io.File input) throws java.lang.Exception
SwiftReader
input
parse
in interface SwiftReader
java.lang.Exception
public java.lang.String[] getDelimitedMultiValues(java.lang.String line, java.lang.String delim, java.util.regex.Pattern patt)
line
- delim
- patt
-
public java.lang.String[] getDelimitedMultiValues(java.lang.String line, java.lang.String delim, java.util.regex.Pattern patt, boolean stripDEL)
line
- delim
- patt
- stripDEL
-
public java.util.List parseFormatSection(java.lang.String line)
line
-
public java.lang.String filterOutTags(java.lang.String text, java.lang.String[] tags)
public java.lang.String readNextElement(java.lang.String currLine, java.lang.String openTag, java.lang.String closeTag, int srchLimitOpen, int srchLimitClose, boolean inclusive, java.lang.String[] lastLine, java.lang.String terminator) throws java.io.IOException
SwiftReader
readNextElement
in interface SwiftReader
currLine
- - current line where the search for open tag
starts with;openTag
- - open tagcloseTag
- - close tagsrchLimitOpen
- - # lines to search for the open tagsrchLimitClose
- - # lines to search for the close taginclusive
- - true include the tags in the result, false otherwise;lastLine
- - the last line read when the search process finishes;
java.io.IOException
- - if there is IO error during line reading;public java.lang.String readNextElement(java.io.LineNumberReader reader, java.lang.String currLine, java.lang.String openTag, java.lang.String closeTag, int srchLimitOpen, int srchLimitClose, boolean inclusive, java.lang.String[] lastLine, java.lang.String terminator) throws java.io.IOException
currLine
- - current line where the search for open tag
starts with;openTag
- - open tagcloseTag
- - close tagsrchLimitOpen
- - # lines to search for the open tagsrchLimitClose
- - # lines to search for the close taginclusive
- - true include the tags in the result, false otherwise;lastLine
- - the last line read when the search process finishes;termiantor
- - a string if found in the line processed - the process will terminate and return;
java.io.IOException
- - if there is IO error during line reading;public java.lang.String readUtil(java.lang.String curLine, java.lang.String tag, boolean open, boolean inclusive, java.lang.String[] lastLineRead) throws java.io.IOException
java.io.IOException
public java.lang.String readUtil(java.io.LineNumberReader reader, java.lang.String curLine, java.lang.String tag, boolean open, boolean inclusive, java.lang.String[] lastLineRead) throws java.io.IOException
curLine
- - the starting line for the search;tag
- - the tag to be detected in the text lines;open
- - true if the tag is an HTML open tag (such as )
false - it is an close tag;inclusive
- - true, the returned text includes the tag, false,
otherwise;
tag
,
when open = true, the text before the tag
will be trimed
(following the inclusive
flag), when open = false,
trim the text after the tag
;
if return is null, not found;
java.io.IOException
public java.lang.String readUtil(java.lang.String curLine, java.lang.String pattern) throws java.io.IOException
java.io.IOException
public java.lang.String readTagWithValue(java.io.LineNumberReader reader, java.lang.String curLine, java.lang.String tagOpen, java.lang.String tagClose, java.lang.String value) throws java.io.IOException
pattern
, also contains the keyword;
pattern
-
pattern
java.io.IOException
public java.lang.String readUtil(java.io.LineNumberReader reader, java.lang.String curLine, java.lang.String pattern) throws java.io.IOException
pattern
;
pattern
-
pattern
java.io.IOException
|
Sun Message Library for SWIFT API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |