|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthredds.catalog.query.DqcFactory
public class DqcFactory
Reads an XML document and constructs an QueryCapability 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.
Field Summary | |
---|---|
static boolean |
debugURL
|
static boolean |
debugVersion
|
static boolean |
showParsedXML
|
Constructor Summary | |
---|---|
DqcFactory(boolean validate)
Constructor. |
Method Summary | |
---|---|
void |
appendErr(String err)
|
void |
appendFatalErr(String err)
|
void |
appendWarning(String err)
|
static void |
main(String[] args)
|
QueryCapability |
readXML(InputStream docIs,
URI uri)
Create an QueryCapability from an InputStream. |
QueryCapability |
readXML(String uriString)
Create an QueryCapability from an XML document at a named URL. |
QueryCapability |
readXML(String docAsString,
URI uri)
|
static void |
setPersistenceCache(DiskCache2 dc)
|
String |
writeXML(QueryCapability dqc)
Write the catalog as an XML document to a String. |
void |
writeXML(QueryCapability dqc,
OutputStream os)
Write the catalog as an XML document to the specified stream. |
boolean |
writeXML(QueryCapability dqc,
String filename)
Write the catalog as an XML document to the specified filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean debugURL
public static boolean debugVersion
public static boolean showParsedXML
Constructor Detail |
---|
public DqcFactory(boolean validate)
validate
- : do XML validation or not.Method Detail |
---|
public static void setPersistenceCache(DiskCache2 dc)
public void appendErr(String err)
public void appendFatalErr(String err)
public void appendWarning(String err)
public QueryCapability readXML(String docAsString, URI uri) throws IOException
IOException
public QueryCapability readXML(String uriString) throws IOException
uriString
- : the URI name that the XML doc is at.
IOException
- on failurepublic QueryCapability readXML(InputStream docIs, URI uri) throws IOException
docIs
- : the InputStream to read fromuri
- : the URI of the document, used for resolving reletive references.
IOException
- on failurepublic String writeXML(QueryCapability dqc) throws IOException
dqc
- : write this QueryCapability to an XML representation.
IOException
- on failurepublic void writeXML(QueryCapability dqc, OutputStream os) throws IOException
dqc
- : write this QueryCapability to an XML representation.os
- write to this OutputStream
IOException
- on an error.public boolean writeXML(QueryCapability dqc, String filename)
dqc
- : write this QueryCapability to an XML representation.filename
- write to this filename
public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |