|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.infoway.messagebuilder.util.xml.DocumentFactory
public class DocumentFactory
A class that simplifies the process of parsing XML documents.
Constructor Summary | |
---|---|
DocumentFactory()
Standard constructor. |
|
DocumentFactory(EntityResolver entityResolver)
Standard constructor. |
Method Summary | |
---|---|
protected DocumentBuilder |
createDocumentBuilder()
|
Document |
createFromByteArray(byte[] xml)
Parse the byte array as XML. |
Document |
createFromFile(File xmlFile)
Read in a file and parse it as XML. |
Document |
createFromResource(InputStreamResource resource)
Read in a resource and parse it as XML. |
Document |
createFromStream(InputStream stream)
Read in a stream and parse it as XML. |
Document |
createFromString(String xml)
Parse the string as XML. |
Document |
newDocument()
Create a new (blank) document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentFactory()
Standard constructor.
public DocumentFactory(EntityResolver entityResolver)
Standard constructor.
entityResolver
- - a class that can help resolve entity references.Method Detail |
---|
public Document createFromFile(File xmlFile) throws SAXException, IOException
Read in a file and parse it as XML.
xmlFile
- - the file that contains the XML
SAXException
- - if the XML file cannot be parsed.
IOException
- - if the file cannot be read.public Document createFromStream(InputStream stream) throws SAXException, IOException
Read in a stream and parse it as XML.
stream
- - the stream that contains the XML
SAXException
- - if the stream cannot be parsed as XML.
IOException
- - if the stream cannot be read.public Document createFromString(String xml) throws SAXException
Parse the string as XML.
xml
- - the string that contains the XML
SAXException
- - if the stream cannot be parsed as XML.public Document createFromResource(InputStreamResource resource) throws IOException, SAXException
Read in a resource and parse it as XML.
resource
- - the resource that contains the XML
SAXException
- - if the resource cannot be parsed as XML.
IOException
- - if the resource cannot be read.public Document createFromByteArray(byte[] xml) throws SAXException
Parse the byte array as XML.
xml
- - the byte array that contains the XML
SAXException
- - if the byte array cannot be parsed as XML.protected DocumentBuilder createDocumentBuilder()
public Document newDocument()
Create a new (blank) document.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |