public class DDMSReader
extends Object
This parsing performs schema validation against a local set of DDMS/ISM schemas.
| Constructor and Description |
|---|
DDMSReader()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Resource |
buildResource(nu.xom.Element xomElement)
Shared helper method to build a DDMS Resource from a XOM Element
|
Resource |
getDDMSResource(File file)
Creates a DDMS resource based on the contents of a file, and also sets the DDMSVersion based on the namespace
URIs in the file.
|
Resource |
getDDMSResource(InputStream inputStream)
Creates a DDMS resource based on the contents of an input stream, and also sets the DDMSVersion based on the
namespace URIs in the document.
|
Resource |
getDDMSResource(Reader reader)
Creates a DDMS resource based on the contents of a reader, and also sets the DDMSVersion based on the namespace
URIs in the document.
|
Resource |
getDDMSResource(String xml)
Creates a DDMS resource based on the contents of a string representation of an XML document, and also sets the
DDMSVersion based on the namespace URIs in the document.
|
nu.xom.Element |
getElement(File file)
Creates a XOM element representing the root XML element in the file.
|
nu.xom.Element |
getElement(InputStream inputStream)
Creates a XOM element representing the root XML element in an input stream.
|
nu.xom.Element |
getElement(Reader reader)
Creates a XOM element representing the root XML element in a reader.
|
nu.xom.Element |
getElement(String xml)
Creates a XOM element representing the root XML element in a string representation of an XML document.
|
String |
getExternalSchemaLocations()
Returns the external schema locations for debugging.
|
static void |
validateWithSchema(String resourceXML)
Attempts to build an Element from a Resource XML string.
|
public DDMSReader()
throws org.xml.sax.SAXException
Schemas are loaded in reverse order, so the latest, greatest copy is always first to be looked for.
Creates a DDMSReader which can process various versions of DDMS and GMLorg.xml.sax.SAXExceptionpublic static void validateWithSchema(String resourceXML)
throws InvalidDDMSException
resourceXML - the XML of the resource to checkInvalidDDMSException - if the resource is invalidpublic nu.xom.Element getElement(File file)
throws IOException,
InvalidDDMSException
The implementation of this method delegates to the Reader-based overloaded method.
file - the file containing the XML documentIOExceptionInvalidDDMSExceptionpublic nu.xom.Element getElement(String xml)
throws IOException,
InvalidDDMSException
The implementation of this method delegates to the Reader-based overloaded method.
xml - a string containing the XML documentIOExceptionInvalidDDMSExceptionpublic nu.xom.Element getElement(InputStream inputStream)
throws IOException,
InvalidDDMSException
The implementation of this method delegates to the Reader-based overloaded method.
inputStream - a stream mapping to an XML documentIOExceptionInvalidDDMSExceptionpublic nu.xom.Element getElement(Reader reader)
throws IOException,
InvalidDDMSException
reader - a reader mapping to an XML documentIOExceptionInvalidDDMSExceptionpublic Resource getDDMSResource(File file) throws IOException, InvalidDDMSException
file - the file containing the DDMS Resource.InvalidDDMSException - if the component could not be builtIOExceptionpublic Resource getDDMSResource(String xml) throws IOException, InvalidDDMSException
xml - the string representation of the XML DDMS ResourceInvalidDDMSException - if the component could not be builtIOExceptionpublic Resource getDDMSResource(InputStream inputStream) throws IOException, InvalidDDMSException
inputStream - the input stream wrapped around an XML DDMS ResourceInvalidDDMSException - if the component could not be builtIOExceptionpublic Resource getDDMSResource(Reader reader) throws IOException, InvalidDDMSException
reader - the reader wrapped around an XML DDMS ResourceInvalidDDMSException - if the component could not be builtIOExceptionprotected Resource buildResource(nu.xom.Element xomElement) throws InvalidDDMSException
xomElement - InvalidDDMSException - if the component could not be builtpublic String getExternalSchemaLocations()
Copyright 2010 - 2013 by Brian Uri!
Generated on 12/15/2013 10:22 AM
http://ddmsence.urizone.net/