jas2.util.xml
Class JASDOMParser
- java.lang.Object
-
- jas2.util.xml.JASDOMParser
-
- Direct Known Subclasses:
- JAXPDOMParser, XercesDOMParser
public abstract class JASDOMParser extends java.lang.ObjectIdeally wouldnt need this interface, except that the DOM specification only specifies how to extract information from a DOM, not how to create a DOM from an XML file. The JASDOMParser interface is meant to make up for that deficiency.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classJASDOMParser.JASXMLExceptionAn exception that gets thrown if there is an error reading an XML file.
-
Constructor Summary
Constructors Constructor and Description JASDOMParser()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description static JASDOMParserinstance()Creates a default instance of a JASDOMParserabstract org.w3c.dom.Documentparse(java.io.Reader in, java.lang.String fileName)Create a DOM document by reading an XML fileabstract org.w3c.dom.Documentparse(java.io.Reader in, java.lang.String fileName, org.xml.sax.EntityResolver resolver)Create a DOM document by reading an XML file with an explicit entity resolver.
-
-
-
Method Detail
-
parse
public abstract org.w3c.dom.Document parse(java.io.Reader in, java.lang.String fileName) throws JASDOMParser.JASXMLExceptionCreate a DOM document by reading an XML file- Parameters:
in- A reader set up to read an XML filefileName- The name of the file being read (used in error messages)- Returns:
- Document The resulting DOM
- Throws:
XMLException- thrown if there is an error reading the XMLJASDOMParser.JASXMLException
-
parse
public abstract org.w3c.dom.Document parse(java.io.Reader in, java.lang.String fileName, org.xml.sax.EntityResolver resolver) throws JASDOMParser.JASXMLExceptionCreate a DOM document by reading an XML file with an explicit entity resolver. An entity resolver is typically used to specify where to find the DTD for the XML document.- Parameters:
in- A reader set up to read an XML filefileName- The name of the file being read (used in error messages)resolver- An entity resolver to use when reading the XML file- Returns:
- Document The resulting DOM
- Throws:
XMLException- thrown if there is an error reading the XMLJASDOMParser.JASXMLException
-
instance
public static JASDOMParser instance()
Creates a default instance of a JASDOMParser- Returns:
- A JASDOMParser
-
-
DataMelt 3.0 © DataMelt by jWork.ORG