java.lang.Object
omix.util.io.AbstractModelIOHandler
omix.util.io.AbstractModelIODomHandler
omix.util.io.StandardModelIODomHandler
- All Implemented Interfaces:
ModelIOHandlerInterface
,EntityResolver
,ErrorHandler
public abstract class StandardModelIODomHandler extends AbstractModelIODomHandler
Realizes XML reading and writing with a
DocumentBuilder
and Transformer
.- Since:
- Omix 1.3
- Author:
- Dr. Peter Droste, Omix Visualization
-
Constructor Summary
Constructors Constructor Description StandardModelIODomHandler(boolean validateOnRead, boolean validateOnWrite)
Sets the validation parameters. -
Method Summary
Modifier and Type Method Description protected abstract AbstractDomReader
getDomReader(String suffix, URLConnection urlConnection, InputUtilities utilities)
Subclasses must implement this method and deliver a DOM reader building a network upon the content from a XML document.protected abstract AbstractDomWriter
getDomWriter(String suffix, URLConnection urlConnection, OutputUtilities utilities)
Subclasses must implement this method and deliver a DOM writer building a XML document from a network.protected void
readFromDom(String suffix, URLConnection connection, Model model, InputUtilities utilities)
Manages the parsing of a XML file into aDocument
.protected void
writeToDom(String suffix, URLConnection connection, Model model, OutputUtilities utilities)
Manages the writing parsing of aDocument
into a XML file.Methods inherited from class omix.util.io.AbstractModelIODomHandler
error, fatalError, read, resolveEntity, warning, write
Methods inherited from class omix.util.io.AbstractModelIOHandler
canRead, canWrite, getDescription, getSuffixes, readThumbnail, supports
-
Constructor Details
-
StandardModelIODomHandler
public StandardModelIODomHandler(boolean validateOnRead, boolean validateOnWrite)Sets the validation parameters.- Parameters:
validateOnRead
- document builder shall validate during file read proceduresvalidateOnWrite
- document builder shall validate during file write procedures- See Also:
DocumentBuilderFactory.setValidating(boolean)
-
-
Method Details
-
readFromDom
protected final void readFromDom(String suffix, URLConnection connection, Model model, InputUtilities utilities) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, IllegalArgumentException, TransformerException, IllegalAccessException, NoSuchFieldException, ComponentExistsException, IllegalComponentException, ThrowableManages the parsing of a XML file into aDocument
. Uses anAbstractDomReader
for analyzing the file content.- Specified by:
readFromDom
in classAbstractModelIODomHandler
- Throws:
ParserConfigurationException
SAXException
IOException
TransformerConfigurationException
IllegalArgumentException
TransformerException
IllegalAccessException
NoSuchFieldException
ComponentExistsException
IllegalComponentException
Throwable
- See Also:
AbstractModelIODomHandler.readFromDom(java.lang.String, java.net.URLConnection, omix.plugin.model.writable.Model, omix.plugin.io.util.InputUtilities)
-
writeToDom
protected final void writeToDom(String suffix, URLConnection connection, Model model, OutputUtilities utilities) throws ParserConfigurationException, IllegalArgumentException, SAXException, IOException, IllegalAccessException, NoSuchFieldException, TransformerFactoryConfigurationError, TransformerException, ThrowableManages the writing parsing of aDocument
into a XML file. Uses anAbstractDomWriter
for creating the document upon the given network.- Specified by:
writeToDom
in classAbstractModelIODomHandler
- Throws:
ParserConfigurationException
IllegalArgumentException
SAXException
IOException
IllegalAccessException
NoSuchFieldException
TransformerFactoryConfigurationError
TransformerException
Throwable
- See Also:
AbstractModelIODomHandler.writeToDom(java.lang.String, java.net.URLConnection, omix.plugin.model.Model, omix.plugin.io.util.OutputUtilities)
-
getDomWriter
protected abstract AbstractDomWriter getDomWriter(String suffix, URLConnection urlConnection, OutputUtilities utilities)Subclasses must implement this method and deliver a DOM writer building a XML document from a network.- Parameters:
suffix
- the file suffix (identifier of the valid file filter).urlConnection
- helps to write the file (URLConnection.getOutputStream()
).utilities
- utilities for file writing and reading network contents- Returns:
- AbstractDomWriter
-
getDomReader
protected abstract AbstractDomReader getDomReader(String suffix, URLConnection urlConnection, InputUtilities utilities)Subclasses must implement this method and deliver a DOM reader building a network upon the content from a XML document.- Parameters:
suffix
- the file suffix (identifier of the valid file filter).urlConnection
- helps to open the file (URLConnection.getInputStream()
).utilities
- utilities for file reading and creating a network- Returns:
- AbstractDomReader
-