Java & XML, 2nd Edition A.4.2.2 DOMAdapter This (Remote web server)
Java & XML, 2nd Edition A.4.2.2 DOMAdapter This class defines the interface that adapters must implement. This includes a means to produce a DOM Document from a filename or an InputStream, as well as a means of obtaining a new, empty DOM Document object. public interface DOMAdapter { public abstract Document getDocument(InputStream in, boolean validate) throws IOException; public abstract Document getDocument(File filename, boolean validate) throws IOException; public abstract Document createDocument(DocType docType) throws IOException; } Specific adapter classes are not detailed here, as additions and modifications may be made during publication of the book. As of this writing, functional adapters are provided for the following parsers: Oracle Version 1 XML Parser Oracle Version 2 XML Parser Sun Project X Parser Sun/Apache Crimson Parser Apache Xerces Parser IBM XML4J Parser A.4.3 Package: org.jdom.input This package defines the classes for building a JDOM Document object from various input sources, such as SAX streams and existing DOM trees. It also provides an interface for using customized versions of the JDOM classes, like user-defined subclasses of Element and Attribute. A.4.3.1 BuilderErrorHandler This is the default error handler used for JDOM document construction. public class BuilderErrorHandlerimplements org.xml.sax.ErrorHandler { public void warning(SAXParserException exception); public void error(SAXParserException exception); public void fatalError(SAXParserException exception); } A.4.3.2 DOMBuilder This class provides the ability to create a JDOM Document object from an XML input source using a parser that supports DOM, the Document Object Model. It uses the various adapters in org.jdom.adapters, so if a parser is requested for which there is no adapter, errors occur. Additionally, a method is provided for building a JDOM Document object from an existing DOM tree (org.w3c.dom.Document). When the DOMBuilder is constructed, validation can be
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.