org.apache.commons.scxml.io
Class SCXMLDigester

java.lang.Object
  extended by org.apache.commons.scxml.io.SCXMLDigester

Deprecated. Use SCXMLParser instead, after updating the SCXML document as necessary, in line with newer Working Drafts.

public final class SCXMLDigester
extends Object

The SCXMLDigester provides the ability to digest a SCXML document into the Java object model provided in the model package.

The SCXMLDigester can be used for:

  1. Digest a SCXML file into the Commons SCXML Java object model.
  2. Obtain a SCXML Digester for further customization of the default ruleset.

NOTE: The SCXMLDigester assumes that the SCXML document to be parsed is well-formed and correct. If that assumption does not hold, any subsequent behavior is undefined.


Nested Class Summary
static class SCXMLDigester.DigestSrcAttributeRule
          Deprecated. Will be removed in version 1.0
static class SCXMLDigester.ParseDataRule
          Deprecated. Will be removed in version 1.0
static class SCXMLDigester.ParseExternalContentRule
          Deprecated. Will be removed in version 1.0
static class SCXMLDigester.SetExecutableParentRule
          Deprecated. Will be removed in version 1.0
static class SCXMLDigester.SetPathResolverRule
          Deprecated. Will be removed in version 1.0
static class SCXMLDigester.UpdateFinalizeRule
          Deprecated. Will be removed in version 1.0
static class SCXMLDigester.UpdateModelRule
          Deprecated. Will be removed in version 1.0
 
Method Summary
static SCXML digest(InputSource documentInputSource, ErrorHandler errHandler)
          Deprecated. API for standalone usage where the SCXML document is an InputSource.
static SCXML digest(InputSource documentInputSource, ErrorHandler errHandler, List customActions)
          Deprecated. API for standalone usage where the SCXML document is an InputSource.
static SCXML digest(String documentRealPath, ErrorHandler errHandler, PathResolver pathResolver)
          Deprecated. API for standalone usage where the SCXML document is a URI.
static SCXML digest(String documentRealPath, ErrorHandler errHandler, PathResolver pathResolver, List customActions)
          Deprecated. API for standalone usage where the SCXML document is a URI.
static SCXML digest(URL scxmlURL, ErrorHandler errHandler)
          Deprecated. API for standalone usage where the SCXML document is a URL.
static SCXML digest(URL scxmlURL, ErrorHandler errHandler, List customActions)
          Deprecated. API for standalone usage where the SCXML document is a URL, and the document uses custom actions.
static org.apache.commons.digester.Digester newInstance()
          Deprecated. Obtain a SCXML digester instance for further customization.
static org.apache.commons.digester.Digester newInstance(PathResolver pr)
          Deprecated. Obtain a SCXML digester instance for further customization.
static org.apache.commons.digester.Digester newInstance(SCXML scxml, PathResolver pr)
          Deprecated. Obtain a SCXML digester instance for further customization.
static org.apache.commons.digester.Digester newInstance(SCXML scxml, PathResolver pr, List customActions)
          Deprecated. Obtain a SCXML digester instance for further customization.
static void updateSCXML(SCXML scxml)
          Deprecated. Update the SCXML object model and make it SCXMLExecutor ready.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

digest

public static SCXML digest(URL scxmlURL,
                           ErrorHandler errHandler)
                    throws IOException,
                           SAXException,
                           ModelException
Deprecated. 

API for standalone usage where the SCXML document is a URL.

Parameters:
scxmlURL - a canonical absolute URL to parse (relative URLs within the top level document are to be resovled against this URL).
errHandler - The SAX ErrorHandler
Returns:
SCXML The SCXML object corresponding to the file argument
Throws:
IOException - Underlying Digester parsing threw an IOException
SAXException - Underlying Digester parsing threw a SAXException
ModelException - If the resulting document model has flaws
See Also:
ErrorHandler, PathResolver

digest

public static SCXML digest(String documentRealPath,
                           ErrorHandler errHandler,
                           PathResolver pathResolver)
                    throws IOException,
                           SAXException,
                           ModelException
Deprecated. 

API for standalone usage where the SCXML document is a URI. A PathResolver must be provided.

Parameters:
pathResolver - The PathResolver for this context
documentRealPath - The String pointing to the absolute (real) path of the SCXML document
errHandler - The SAX ErrorHandler
Returns:
SCXML The SCXML object corresponding to the file argument
Throws:
IOException - Underlying Digester parsing threw an IOException
SAXException - Underlying Digester parsing threw a SAXException
ModelException - If the resulting document model has flaws
See Also:
ErrorHandler, PathResolver

digest

public static SCXML digest(InputSource documentInputSource,
                           ErrorHandler errHandler)
                    throws IOException,
                           SAXException,
                           ModelException
Deprecated. 

API for standalone usage where the SCXML document is an InputSource. This method may be used when the SCXML document is packaged in a Java archive, or part of a compound document where the SCXML root is available as a org.w3c.dom.Element or via a java.io.Reader.

Note: Since there is no path resolution, the SCXML document must not have external state sources.

Parameters:
documentInputSource - The InputSource for the SCXML document
errHandler - The SAX ErrorHandler
Returns:
SCXML The SCXML object corresponding to the file argument
Throws:
IOException - Underlying Digester parsing threw an IOException
SAXException - Underlying Digester parsing threw a SAXException
ModelException - If the resulting document model has flaws
See Also:
ErrorHandler

digest

public static SCXML digest(URL scxmlURL,
                           ErrorHandler errHandler,
                           List customActions)
                    throws IOException,
                           SAXException,
                           ModelException
Deprecated. 

API for standalone usage where the SCXML document is a URL, and the document uses custom actions.

Parameters:
scxmlURL - a canonical absolute URL to parse (relative URLs within the top level document are to be resovled against this URL).
errHandler - The SAX ErrorHandler
customActions - The list of CustomActions this digester instance will process, can be null or empty
Returns:
SCXML The SCXML object corresponding to the file argument
Throws:
IOException - Underlying Digester parsing threw an IOException
SAXException - Underlying Digester parsing threw a SAXException
ModelException - If the resulting document model has flaws
See Also:
ErrorHandler, PathResolver

digest

public static SCXML digest(String documentRealPath,
                           ErrorHandler errHandler,
                           PathResolver pathResolver,
                           List customActions)
                    throws IOException,
                           SAXException,
                           ModelException
Deprecated. 

API for standalone usage where the SCXML document is a URI. A PathResolver must be provided.

Parameters:
pathResolver - The PathResolver for this context
documentRealPath - The String pointing to the absolute (real) path of the SCXML document
errHandler - The SAX ErrorHandler
customActions - The list of CustomActions this digester instance will process, can be null or empty
Returns:
SCXML The SCXML object corresponding to the file argument
Throws:
IOException - Underlying Digester parsing threw an IOException
SAXException - Underlying Digester parsing threw a SAXException
ModelException - If the resulting document model has flaws
See Also:
ErrorHandler, PathResolver

digest

public static SCXML digest(InputSource documentInputSource,
                           ErrorHandler errHandler,
                           List customActions)
                    throws IOException,
                           SAXException,
                           ModelException
Deprecated. 

API for standalone usage where the SCXML document is an InputSource. This method may be used when the SCXML document is packaged in a Java archive, or part of a compound document where the SCXML root is available as a org.w3c.dom.Element or via a java.io.Reader.

Note: Since there is no path resolution, the SCXML document must not have external state sources.

Parameters:
documentInputSource - The InputSource for the SCXML document
errHandler - The SAX ErrorHandler
customActions - The list of CustomActions this digester instance will process, can be null or empty
Returns:
SCXML The SCXML object corresponding to the file argument
Throws:
IOException - Underlying Digester parsing threw an IOException
SAXException - Underlying Digester parsing threw a SAXException
ModelException - If the resulting document model has flaws
See Also:
ErrorHandler

newInstance

public static org.apache.commons.digester.Digester newInstance()
Deprecated. 

Obtain a SCXML digester instance for further customization.

API Notes:

Returns:
Digester A newly configured SCXML digester instance
See Also:
updateSCXML(SCXML)

newInstance

public static org.apache.commons.digester.Digester newInstance(PathResolver pr)
Deprecated. 

Obtain a SCXML digester instance for further customization.

API Notes:

Parameters:
pr - The PathResolver, may be null for standalone documents
Returns:
Digester A newly configured SCXML digester instance
See Also:
updateSCXML(SCXML)

newInstance

public static org.apache.commons.digester.Digester newInstance(SCXML scxml,
                                                               PathResolver pr)
Deprecated. 

Obtain a SCXML digester instance for further customization.

API Notes:

Parameters:
scxml - The parent SCXML document if there is one (in case of state templates for example), null otherwise
pr - The PathResolver, may be null for standalone documents
Returns:
Digester A newly configured SCXML digester instance
See Also:
updateSCXML(SCXML)

newInstance

public static org.apache.commons.digester.Digester newInstance(SCXML scxml,
                                                               PathResolver pr,
                                                               List customActions)
Deprecated. 

Obtain a SCXML digester instance for further customization.

API Notes:

Parameters:
scxml - The parent SCXML document if there is one (in case of state templates for example), null otherwise
pr - The PathResolver, may be null for standalone documents
customActions - The list of CustomActions this digester instance will process, can be null or empty
Returns:
Digester A newly configured SCXML digester instance
See Also:
updateSCXML(SCXML)

updateSCXML

public static void updateSCXML(SCXML scxml)
                        throws ModelException
Deprecated. 

Update the SCXML object model and make it SCXMLExecutor ready. This is part of post-digester processing, and sets up the necessary object references throughtout the SCXML object model for the parsed document. Should be used only if a customized digester obtained using the newInstance() methods is needed.

Parameters:
scxml - The SCXML object (output from Digester)
Throws:
ModelException - If the document model has flaws


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.