public class DataSetToXML
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DSML_SCHEMA2_0 |
protected boolean |
saveLocally |
protected boolean |
useDataSetRef
If true, then each dataset is put into a separate dsml file.
|
Constructor and Description |
---|
DataSetToXML() |
Modifier and Type | Method and Description |
---|---|
static AuditInfo[] |
createAuditInfo(java.net.URL base,
java.lang.String id) |
org.w3c.dom.Element |
createDocument(DataSet dataset,
java.io.File dataDirectory,
SeismogramFileTypes fileType) |
static java.lang.String |
createFileName(DataSet dataset) |
DataSet |
createWithStAX(javax.xml.stream.XMLStreamReader parser,
java.net.URL base)
Creates the dataset from the input.
|
DataSet |
extract(java.net.URL base,
org.w3c.dom.Element element)
Extracts the dataset from the element, which is assumed to be a
<dataset> element.
|
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder() |
org.w3c.dom.Element |
insert(org.w3c.dom.Document doc,
DataSet dataset,
java.io.File directory,
SeismogramFileTypes fileType)
DOM insert
|
org.w3c.dom.Element |
insert(org.w3c.dom.Element parent,
DataSet dataset,
java.io.File directory,
SeismogramFileTypes fileType)
DOM insert inserts the dataset, and all child datasets recursively, into
the document, along with dataset seismograms and parameters if they can
be stored.
|
org.w3c.dom.Element |
insert(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.Object parameter)
DOM insert inserts the parameter into the given element.
|
org.w3c.dom.Element |
insert(org.w3c.dom.Element parent,
URLDataSetSeismogram urlDSS,
java.net.URL base)
inserts a URLDataSetSeismogram element into the parent.
|
void |
insertInto(org.w3c.dom.Element element,
DataSet dataset,
java.io.File directory,
SeismogramFileTypes fileType)
DOM insertInto
|
org.w3c.dom.Element |
insertParameter(org.w3c.dom.Element parent,
java.lang.String name,
java.lang.String typeDef,
java.lang.String typeName,
java.lang.String value)
DOM insertParameter inserts the parameter into the given element.
|
org.w3c.dom.Element |
insertRef(org.w3c.dom.Element element,
DataSet dataset,
java.io.File directory)
DOM insertRef inserts the child dataset as a datasetRef element.
|
org.w3c.dom.Element |
insertRef(org.w3c.dom.Element parent,
java.lang.String datasetURL,
java.lang.String linkTitle)
DOM insertRef inserts the child dataset as a datasetRef element.
|
static DataSet |
load(java.net.URL datasetURL)
Load a xml dataset from a URL.
|
java.io.File |
save(DataSet dataset,
java.io.File saveDirectory)
Saves the given dataset to an xml file in the given directory.
|
java.io.File |
save(DataSet dataset,
java.io.File saveDirectory,
SeismogramFileTypes fileType)
Saves the given dataset to an xml file in the given directory.
|
void |
writeToFile(org.w3c.dom.Element datasetElement,
java.io.File outFile) |
public static final java.lang.String DSML_SCHEMA2_0
protected boolean saveLocally
protected boolean useDataSetRef
public java.io.File save(DataSet dataset, java.io.File saveDirectory) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public java.io.File save(DataSet dataset, java.io.File saveDirectory, SeismogramFileTypes fileType) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public static java.lang.String createFileName(DataSet dataset)
public void writeToFile(org.w3c.dom.Element datasetElement, java.io.File outFile) throws java.io.IOException, java.net.MalformedURLException
java.io.IOException
java.net.MalformedURLException
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public org.w3c.dom.Element createDocument(DataSet dataset, java.io.File dataDirectory, SeismogramFileTypes fileType) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public org.w3c.dom.Element insert(org.w3c.dom.Element parent, DataSet dataset, java.io.File directory, SeismogramFileTypes fileType) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public org.w3c.dom.Element insert(org.w3c.dom.Document doc, DataSet dataset, java.io.File directory, SeismogramFileTypes fileType) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public void insertInto(org.w3c.dom.Element element, DataSet dataset, java.io.File directory, SeismogramFileTypes fileType) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public org.w3c.dom.Element insert(org.w3c.dom.Element parent, URLDataSetSeismogram urlDSS, java.net.URL base)
public org.w3c.dom.Element insertRef(org.w3c.dom.Element element, DataSet dataset, java.io.File directory) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public org.w3c.dom.Element insertRef(org.w3c.dom.Element parent, java.lang.String datasetURL, java.lang.String linkTitle) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
public org.w3c.dom.Element insert(org.w3c.dom.Element parent, java.lang.String name, java.lang.Object parameter)
public org.w3c.dom.Element insertParameter(org.w3c.dom.Element parent, java.lang.String name, java.lang.String typeDef, java.lang.String typeName, java.lang.String value)
public static DataSet load(java.net.URL datasetURL) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, IncomprehensibleDSMLException, UnsupportedFileTypeException
datasetURL
- an URL
to an xml datasetXMLDataSet
populated form the URLjava.io.IOException
javax.xml.parsers.ParserConfigurationException
IncomprehensibleDSMLException
UnsupportedFileTypeException
public DataSet createWithStAX(javax.xml.stream.XMLStreamReader parser, java.net.URL base) throws javax.xml.stream.XMLStreamException, java.net.MalformedURLException, UnsupportedFileTypeException
javax.xml.stream.XMLStreamException
java.net.MalformedURLException
UnsupportedFileTypeException
public DataSet extract(java.net.URL base, org.w3c.dom.Element element) throws java.net.MalformedURLException, UnsupportedFileTypeException
java.net.MalformedURLException
UnsupportedFileTypeException
public static AuditInfo[] createAuditInfo(java.net.URL base, java.lang.String id)