|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.slop.parsing.SimpleSlopParser
public class SimpleSlopParser
Simplistic SLOP parser, recognizes the following constructs: Field: a line starting with letters and : is considered a field Empty lines are detected. Other lines are output as line elements This is sufficient for basic parsing of RFC 822 headers, but a configurable rfc822 mode would be good to differentiate between the header and body of the email message and parse them with different rules.
Field Summary |
---|
Fields inherited from interface org.apache.cocoon.slop.interfaces.SlopConstants |
---|
SLOP_ATTR_LINENUMBER, SLOP_EMPTY_LINE_ELEMENT, SLOP_LINE_ELEMENT, SLOP_NAMESPACE_URI, SLOP_ROOT_ELEMENT |
Constructor Summary | |
---|---|
SimpleSlopParser()
|
Method Summary | |
---|---|
void |
endDocument()
must be called once all calls to processLine() are done |
protected org.apache.cocoon.slop.parsing.SimpleSlopParser.ParsedLine |
parseLine(String line)
parse a line, extract element name and contents |
void |
processLine(String line)
call this to process input lines, does the actual parsing |
void |
setPreserveWhitespace(boolean b)
optionally preserve whitespace in input |
void |
setValidTagnameChars(String str)
set the list of valid chars for tag names (in addition to letters) |
void |
startDocument(ContentHandler destination)
must be called before any call to processLine() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleSlopParser()
Method Detail |
---|
public void setValidTagnameChars(String str)
public void setPreserveWhitespace(boolean b)
public void startDocument(ContentHandler destination) throws SAXException, ProcessingException
startDocument
in interface SlopParser
SAXException
ProcessingException
public void endDocument() throws SAXException, ProcessingException
endDocument
in interface SlopParser
SAXException
ProcessingException
public void processLine(String line) throws SAXException, ProcessingException
processLine
in interface SlopParser
SAXException
ProcessingException
protected org.apache.cocoon.slop.parsing.SimpleSlopParser.ParsedLine parseLine(String line)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |