ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.conversation.base
Class CpXmlParser

java.lang.Object
  |
  +--com.ibm.conversation.base.CpXmlParser

public class CpXmlParser
extends java.lang.Object

The CpXmlParser class is responsible for reading and parsing cpXML files, then initializing CpStateMachines to match the file contents.

This supports cpXML version "2.0".


Constructor Summary
CpXmlParser()
          Constructs a CpXmlParser object.
 
Method Summary
 java.lang.String getCpXmlSchemaUri()
          Returns the URI for the cpXML schema appropriate to this parser.
 java.lang.String getCpXmlVersion()
          Returns the cpXML version name appropriate to this parser.
 void initCpStateMachine(CpStateMachine stateMachine)
          Initializes the given CpStateMachine to match the cpXML file already read.
 void loadDocument(java.lang.String uri)
          Reads and parses the cpXML file at the given URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CpXmlParser

public CpXmlParser()
Constructs a CpXmlParser object.
Method Detail

getCpXmlSchemaUri

public java.lang.String getCpXmlSchemaUri()
Returns the URI for the cpXML schema appropriate to this parser.

Returns:
The URI.

getCpXmlVersion

public java.lang.String getCpXmlVersion()
Returns the cpXML version name appropriate to this parser.

Returns:
The version name.

loadDocument

public void loadDocument(java.lang.String uri)
                  throws org.xml.sax.SAXException,
                         java.io.IOException
Reads and parses the cpXML file at the given URI.

This is the first of the two steps in initializing a CpStateMachine (initCpStateMachine() is the second). It uses a org.apache.xerces.parsers.DOMParser to read the URI and generate a Document object, which it stores for use when initCpStateMachine() is called.

The URI is presumed to point to a cpXML file.

Parameters:
uri - The URI of the cpXML file.
Throws:
org.xml.sax.SAXException - If the the XML parser throws one.
java.io.IOException - If the XML parser throws one.

initCpStateMachine

public void initCpStateMachine(CpStateMachine stateMachine)
Initializes the given CpStateMachine to match the cpXML file already read.

This is the second of the two steps in initializing a CpStateMachine (loadDocument() is the first). It clears the state machine and configures it according to the contents of the Document object created and stored when loadDocument() was called.

Parameters:
stateMachine - The state machine to initialize.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003