|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.pdx.cs399J.family.XmlParser
public class XmlParser
This class parses an XML file generated by XmlDumper
and creates a family tree.
| Field Summary | |
|---|---|
protected static String |
publicID
The Public ID for the Family Tree DTD |
protected static String |
systemID
The System ID for the Family Tree DTD |
| Constructor Summary | |
|---|---|
XmlParser(File file)
Creates a new XML parser that reads its input from the given file. |
|
XmlParser(Reader reader)
Creates a new XML parser that reads itsinput from the given Reader. |
|
XmlParser(String fileName)
Creates a new XML parser that reads its input from a file of a given name. |
|
| Method Summary | |
|---|---|
void |
error(SAXParseException ex)
|
protected static List<String> |
extractNotesFrom(Element element)
Extracts a bunch of notes from an Element |
protected static String |
extractTextFrom(Element element)
Extracts the text from an Element. |
void |
fatalError(SAXParseException ex)
|
static void |
main(String[] args)
Test program. |
FamilyTree |
parse()
Parses the specified input source in XML format and from it creates a family tree. |
InputSource |
resolveEntity(String publicId,
String systemId)
Attempt to resolve the external entity (such as a DTD) described by the given public and system ID. |
void |
warning(SAXParseException ex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String systemID
protected static final String publicID
| Constructor Detail |
|---|
public XmlParser(String fileName)
throws FileNotFoundException
FileNotFoundException
public XmlParser(File file)
throws FileNotFoundException
FileNotFoundExceptionpublic XmlParser(Reader reader)
Reader. This lets us read from a source other
than a file.
| Method Detail |
|---|
public FamilyTree parse()
throws FamilyTreeException
parse in interface ParserFamilyTreeException - The data source is malformattedpublic static void main(String[] args)
public InputSource resolveEntity(String publicId,
String systemId)
throws SAXException,
IOException
InputSource
resolveEntity in interface EntityResolverSAXException
IOException
public void warning(SAXParseException ex)
throws SAXException
warning in interface ErrorHandlerSAXException
public void error(SAXParseException ex)
throws SAXException
error in interface ErrorHandlerSAXException
public void fatalError(SAXParseException ex)
throws SAXException
fatalError in interface ErrorHandlerSAXExceptionprotected static List<String> extractNotesFrom(Element element)
Element
protected static String extractTextFrom(Element element)
Element.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||