Package edu.pdx.cs410J.grader.gradebook
Class XmlHelper
java.lang.Object
edu.pdx.cs410J.grader.gradebook.XmlHelper
- All Implemented Interfaces:
EntityResolver
,ErrorHandler
- Direct Known Subclasses:
XmlDumper
,XmlGradeBookParser
,XmlStudentParser
This class contains fields and methods that are useful when dealing
with XML data.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final DateTimeFormatter
protected static final String
The Public ID for the Grade Bookd DTDprotected static final String
The System ID for the Grade Book DTD -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
extractNotesFrom
(Element element) Extracts a bunch of notes from anElement
protected static String
extractTextFrom
(Element element) Extracts the text from anElement
.void
static byte[]
getBytesForXmlDocument
(Document xmlDoc) resolveEntity
(String publicId, String systemId) Attempt to resolve the external entity (such as a DTD) described by the given public and system ID.void
(package private) static void
writeXmlToPrintWriter
(Document doc, PrintWriter pw)
-
Field Details
-
systemID
The System ID for the Grade Book DTD- See Also:
-
publicID
The Public ID for the Grade Bookd DTD- See Also:
-
DATE_TIME_FORMAT
-
-
Constructor Details
-
XmlHelper
public XmlHelper()
-
-
Method Details
-
getBytesForXmlDocument
- Throws:
TransformerException
-
resolveEntity
Attempt to resolve the external entity (such as a DTD) described by the given public and system ID. The external entity is returned as aInputSource
- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
extractNotesFrom
Extracts a bunch of notes from anElement
-
extractTextFrom
Extracts the text from anElement
. -
writeXmlToPrintWriter
- Throws:
TransformerException
-