Interface ResultHandler
- All Known Implementing Classes:
Parser.XmlSerializer
public interface ResultHandler
Receives a parse result as serialization-style callbacks.
The default Parser.parse(String, de.bottlecaps.markup.blitz.Parser.Option...) method
serializes the parse tree to an XML string. By supplying an implementation of this interface to
Parser.parse(String, ResultHandler, de.bottlecaps.markup.blitz.Parser.Option...), a caller
can instead build a result representation of its choice (for example a tree in a host language)
directly from the parse tree, without an intervening serialized form.
An element's attributes are reported by attribute(String, int[], int),
after its startElement(String) and before any child content.
-
Method Summary
Modifier and TypeMethodDescriptionvoidReports an attribute, with its value given as codepoints.voidendElement(String name) Reports the end of an element.voidstartElement(String name) Reports the start of an element.voidtext(int[] codepoints, int length) Reports a run of codepoints of element content.
-
Method Details
-
startElement
-
endElement
-
attribute
Reports an attribute, with its value given as codepoints.- Parameters:
name- the attribute namecodepoints- the codepoints holding the attribute valuelength- the number of codepoints in the value
-
text
void text(int[] codepoints, int length) Reports a run of codepoints of element content.- Parameters:
codepoints- the Unicode code pointslength- the number of codepoints to report
-