public class NoteReader extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
NoteReader.NoteParseMode
Notes can be represented in two XML formats.
|
private class |
NoteReader.Parser
SAX handler to read note information from its XML representation.
|
Modifier and Type | Field and Description |
---|---|
private org.xml.sax.InputSource |
inputSource |
private java.util.List<Note> |
parsedNotes |
Constructor and Description |
---|
NoteReader(java.io.InputStream source)
Initializes the reader with a given InputStream
|
NoteReader(java.lang.String source)
Initializes the reader with a string as a source
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Note> |
parse()
Parses the InputStream given to the constructor and returns
the resulting Note objects
|
(package private) static LatLon |
parseLatLon(java.util.function.UnaryOperator<java.lang.String> attrs) |
(package private) static Note |
parseNoteBasic(org.xml.sax.Attributes attrs) |
(package private) static Note |
parseNoteBasic(java.util.function.UnaryOperator<java.lang.String> attrs) |
(package private) static Note |
parseNoteFull(org.xml.sax.Attributes attrs) |
(package private) static Note |
parseNoteFull(java.util.function.UnaryOperator<java.lang.String> attrs) |
private final org.xml.sax.InputSource inputSource
private java.util.List<Note> parsedNotes
public NoteReader(java.io.InputStream source)
source
- - InputStream containing Notes XMLpublic NoteReader(java.lang.String source)
source
- UTF-8 string containing Notes XML to parsestatic LatLon parseLatLon(java.util.function.UnaryOperator<java.lang.String> attrs)
static Note parseNoteBasic(org.xml.sax.Attributes attrs)
static Note parseNoteBasic(java.util.function.UnaryOperator<java.lang.String> attrs)
static Note parseNoteFull(org.xml.sax.Attributes attrs)
static Note parseNoteFull(java.util.function.UnaryOperator<java.lang.String> attrs)
public java.util.List<Note> parse() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
- if any SAX parsing error occursjava.io.IOException
- if any I/O error occurs