Package edu.pdx.cs410J.family
Class XmlParser
java.lang.Object
edu.pdx.cs410J.family.XmlHelper
edu.pdx.cs410J.family.XmlParser
- All Implemented Interfaces:
Parser
,EntityResolver
,ErrorHandler
This class parses an XML file generated by
XmlDumper
and creates a family tree.- Author:
- David Whitlock
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new XML parser that reads its input from the given file.Creates a new XML parser that reads itsinput from the givenReader
.Creates a new XML parser that reads its input from a file of a given name. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Test program.parse()
Parses the specified input source in XML format and from it creates a family tree.Methods inherited from class edu.pdx.cs410J.family.XmlHelper
error, extractNotesFrom, extractTextFrom, fatalError, resolveEntity, warning
-
Constructor Details
-
XmlParser
Creates a new XML parser that reads its input from a file of a given name.- Throws:
FileNotFoundException
-
XmlParser
Creates a new XML parser that reads its input from the given file.- Throws:
FileNotFoundException
-
XmlParser
Creates a new XML parser that reads itsinput from the givenReader
. This lets us read from a source other than a file.
-
-
Method Details
-
parse
Parses the specified input source in XML format and from it creates a family tree.- Specified by:
parse
in interfaceParser
- Throws:
FamilyTreeException
- The data source is malformatted
-
main
Test program. Parses an XML file specified on the command line and prints the resulting family tree to standard out.
-