public class DqcFactory
extends java.lang.Object
DqcFactory fac = new DqcFactory(true); QueryCapability dqc = fac.readXML(url); System.out.println(" dqc hasFatalError= "+dqc.hasFatalError()); System.out.println(" dqc messages= \n"+dqc.getErrorMessages()); fac.writeXML(dqc, System.out);Implementation details: Uses JAXP to load an XML Parser and construct a DOM tree. Uses a pluggable "converter" to transform the DOM to the thredds.catalog.query objects.
Modifier and Type | Field and Description |
---|---|
static boolean |
debugVersion |
static boolean |
showParsedXML |
Constructor and Description |
---|
DqcFactory(boolean validate)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendErr(java.lang.String err) |
void |
appendFatalErr(java.lang.String err) |
void |
appendWarning(java.lang.String err) |
static void |
main(java.lang.String[] args) |
QueryCapability |
readXML(java.io.InputStream docIs,
java.net.URI uri)
Create an QueryCapability from an InputStream.
|
QueryCapability |
readXML(java.lang.String uriString)
Create an QueryCapability from an XML document at a named URL.
|
QueryCapability |
readXML(java.lang.String docAsString,
java.net.URI uri) |
static void |
setPersistenceCache(DiskCache2 dc) |
java.lang.String |
writeXML(QueryCapability dqc)
Write the catalog as an XML document to a String.
|
void |
writeXML(QueryCapability dqc,
java.io.OutputStream os)
Write the catalog as an XML document to the specified stream.
|
boolean |
writeXML(QueryCapability dqc,
java.lang.String filename)
Write the catalog as an XML document to the specified filename.
|
public static boolean debugVersion
public static boolean showParsedXML
public DqcFactory(boolean validate)
validate
- : do XML validation or not.public static void setPersistenceCache(DiskCache2 dc)
public void appendErr(java.lang.String err)
public void appendFatalErr(java.lang.String err)
public void appendWarning(java.lang.String err)
public QueryCapability readXML(java.lang.String docAsString, java.net.URI uri) throws java.io.IOException
java.io.IOException
public QueryCapability readXML(java.lang.String uriString) throws java.io.IOException
uriString
- : the URI name that the XML doc is at.java.io.IOException
- on failurepublic QueryCapability readXML(java.io.InputStream docIs, java.net.URI uri) throws java.io.IOException
docIs
- : the InputStream to read fromuri
- : the URI of the document, used for resolving reletive references.java.io.IOException
- on failurepublic java.lang.String writeXML(QueryCapability dqc) throws java.io.IOException
dqc
- : write this QueryCapability to an XML representation.java.io.IOException
- on failurepublic void writeXML(QueryCapability dqc, java.io.OutputStream os) throws java.io.IOException
dqc
- : write this QueryCapability to an XML representation.os
- write to this OutputStreamjava.io.IOException
- on an error.public boolean writeXML(QueryCapability dqc, java.lang.String filename)
dqc
- : write this QueryCapability to an XML representation.filename
- write to this filenamepublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception