org.knime.core.node.port.pmml
Class PMMLMasterContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.knime.core.node.port.pmml.PMMLContentHandler
          extended by org.knime.core.node.port.pmml.PMMLMasterContentHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class PMMLMasterContentHandler
extends PMMLContentHandler

Author:
Fabian Dill, University of Konstanz

Constructor Summary
PMMLMasterContentHandler()
           
 
Method Summary
 boolean addContentHandler(String id, PMMLContentHandler defaultHandler)
          Adds a default PMML content handler, that is able to extract the newcessary information from the PMML file for the referring model.
 void characters(char[] ch, int start, int length)
          
 void endDocument()
          
 void endElement(String uri, String localName, String name)
          
 void error(SAXParseException exception)
          
 void fatalError(SAXParseException exception)
          
 PMMLContentHandler getDefaultHandler(String id)
           
 String getVersion()
           
 boolean removeContentHandler(String id)
           
 void startElement(String uri, String localName, String name, Attributes atts)
          
 void warning(SAXParseException exception)
          
 
Methods inherited from class org.knime.core.node.port.pmml.PMMLContentHandler
endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
notationDecl, resolveEntity, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMMLMasterContentHandler

public PMMLMasterContentHandler()
Method Detail

getVersion

public String getVersion()
Returns:
the version of the parsed PMML file

addContentHandler

public boolean addContentHandler(String id,
                                 PMMLContentHandler defaultHandler)
Adds a default PMML content handler, that is able to extract the newcessary information from the PMML file for the referring model.

Parameters:
id - id in order to retrieve the handler after parsing
defaultHandler - handler that understands a specific model
Returns:
false, if the id is already in use, true if the handler was successfully registered

removeContentHandler

public boolean removeContentHandler(String id)
Parameters:
id - the id under which the handler is registered
Returns:
true if handler successfully removed, false if it wasn't registered

getDefaultHandler

public PMMLContentHandler getDefaultHandler(String id)
Parameters:
id - id under which the handler is registered
Returns:
the handler if it was found under this id, null otherwise

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException

Specified by:
characters in interface ContentHandler
Specified by:
characters in class PMMLContentHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException

Specified by:
endDocument in interface ContentHandler
Specified by:
endDocument in class PMMLContentHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String name)
                throws SAXException

Specified by:
endElement in interface ContentHandler
Specified by:
endElement in class PMMLContentHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String name,
                         Attributes atts)
                  throws SAXException

Specified by:
startElement in interface ContentHandler
Specified by:
startElement in class PMMLContentHandler
Throws:
SAXException

error

public void error(SAXParseException exception)
           throws SAXException

Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException

Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
Throws:
SAXException

warning

public void warning(SAXParseException exception)
             throws SAXException

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler
Throws:
SAXException


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.