org.knime.core.node.config
Class XMLConfig

java.lang.Object
  extended by org.knime.core.node.config.XMLConfig

final class XMLConfig
extends Object

A class used to load and save Config objects into an XML file.

This implementation uses a SAX Parser to create and save the xml files. This got necessary since predictive params may get big and using a DOM parser keeps the entire xml-tree in memory.

Author:
Bernd Wiswedel, University of Konstanz

Field Summary
(package private) static String DTD_NAME
          dtd name from class name.
 
Method Summary
(package private) static void load(Config c, InputStream in)
          Reads from the given input stream into the given config object.
(package private) static void save(Config config, OutputStream os)
          Saves given Config into an XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DTD_NAME

static final String DTD_NAME
dtd name from class name.

Method Detail

load

static void load(Config c,
                 InputStream in)
          throws SAXException,
                 IOException,
                 ParserConfigurationException
Reads from the given input stream into the given config object.

Parameters:
c - Where to put the results.
in - Where to read from, stream will be closed when done.
Throws:
SAXException - If stream can't be properly parsed.
IOException - If IO problem occur.
ParserConfigurationException - If not properly configured.
NullPointerException - If any argument is null.

save

static void save(Config config,
                 OutputStream os)
          throws IOException
Saves given Config into an XML stream. The stream is closed at the end.

Parameters:
config - the Config the save
os - the stream to write Config as XML to
Throws:
IOException - if the Config could not be stored


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.