org.knime.core.data.xml
Class PMMLCellFactory

java.lang.Object
  extended by org.knime.core.data.xml.PMMLCellFactory

public class PMMLCellFactory
extends Object

Cell factory that creates XML cells. Depending on the size either normal DataCells or BlobDataCells are created.

Author:
Heiko Hofer

Field Summary
static int DEF_MIN_BLOB_SIZE_IN_BYTES
          Minimum size for blobs in bytes.
static DataType TYPE
          Type for PMML cells.
 
Method Summary
static DataCell create(Document dom)
          Factory method to create DataCell representing Document.
static DataCell create(InputStream is)
          Factory method to create DataCell representing Document.
static DataCell create(String pmml)
          Factory method to create DataCell representing Document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_MIN_BLOB_SIZE_IN_BYTES

public static final int DEF_MIN_BLOB_SIZE_IN_BYTES
Minimum size for blobs in bytes. That is, if a given string is at least as large as this value, it will be represented by a blob cell

See Also:
Constant Field Values

TYPE

public static final DataType TYPE
Type for PMML cells.

Method Detail

create

public static DataCell create(String pmml)
                       throws IOException,
                              ParserConfigurationException,
                              SAXException,
                              XMLStreamException
Factory method to create DataCell representing Document. The returned cell is either of type PMMLCell (for small documents) or PMMLBlobCell (otherwise, default threshold is 8192 bytes or larger).

Parameters:
pmml - String representing the PMML document
Returns:
DataCell representing the PMML document
Throws:
IOException - if an io error occurs while reading the PMML string
SAXException - if an error occurs while parsing
ParserConfigurationException - if the parser cannot be instantiated
XMLStreamException
NullPointerException - if argument is null

create

public static DataCell create(Document dom)
Factory method to create DataCell representing Document. The returned cell is either of type PMMLCell (for small documents) or PMMLBlobCell (otherwise, default threshold is 8192 bytes or larger).

Parameters:
dom - the returned data cell encapsulates this DOM
Returns:
DataCell representing the PMML document
Throws:
NullPointerException - if argument is null

create

public static DataCell create(InputStream is)
                       throws IOException,
                              ParserConfigurationException,
                              SAXException,
                              XMLStreamException
Factory method to create DataCell representing Document. The returned cell is either of type PMMLCell (for small documents) or PMMLBlobCell (otherwise, default threshold is 8192 bytes or larger).

Parameters:
is - The stream containing the PMML document
Returns:
DataCell representing the PMML document
Throws:
IOException - if an io error occurs while reading the PMML string
SAXException - if an error occurs while parsing
ParserConfigurationException - if the parser cannot be instantiated
XMLStreamException
NullPointerException - if argument is null


Copyright, 2003 - 2012. 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.