Package edu.pdx.cs410J.family
Class XmlDumper
java.lang.Object
edu.pdx.cs410J.family.XmlHelper
edu.pdx.cs410J.family.XmlDumper
- All Implemented Interfaces:
Dumper
,EntityResolver
,ErrorHandler
This class dumps a family tree to a destination (for example, a
file) in XML format. This file is meant to be used by an
XmlParser
to create a FamilyTree
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dump
(FamilyTree tree) Dumps the contents of a family tree to the desired destination.static void
Test program.Methods inherited from class edu.pdx.cs410J.family.XmlHelper
error, extractNotesFrom, extractTextFrom, fatalError, resolveEntity, warning
-
Constructor Details
-
XmlDumper
Creates a new XML dumper that dumps to a file of a given name. If the file does not exist, it is created.- Throws:
IOException
-
XmlDumper
Creates a new XML dumper that dumps to a given file.- Throws:
IOException
-
XmlDumper
Creates a new XML dumper that prints to aPrintWriter
. This way, we can dump to destinations other than files.
-
-
Method Details
-
dump
Dumps the contents of a family tree to the desired destination.- Specified by:
dump
in interfaceDumper
- Throws:
FamilyTreeException
- An error occurred while dumping the family tree
-
main
Test program. Create a simple family tree and dump it to the specified file or standard out if no file is specified.
-