|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.scxml.io.SCXMLParser
public final class SCXMLParser
The SCXMLParser provides the ability to parse a SCXML document into the Java object model provided in the model package.
The SCXMLParser can be used for:
If switching from SCXMLDigester
, changes need to be made to
the SCXML documents, such as:
http://commons.apache.org/scxml
See latest version of the SCXML Working Draft for more details.
NOTE: The SCXMLParser assumes that the SCXML document to be parsed is well-formed and correct. If that assumption does not hold, any subsequent behavior is undefined.
Method Summary | |
---|---|
static org.apache.commons.digester.Digester |
newInstance()
Obtain a SCXML digester instance for further customization. |
static org.apache.commons.digester.Digester |
newInstance(PathResolver pr)
Obtain a SCXML digester instance for further customization. |
static org.apache.commons.digester.Digester |
newInstance(SCXML scxml,
PathResolver pr)
Obtain a SCXML digester instance for further customization. |
static org.apache.commons.digester.Digester |
newInstance(SCXML scxml,
PathResolver pr,
List customActions)
Obtain a SCXML digester instance for further customization. |
static SCXML |
parse(InputSource documentInputSource,
ErrorHandler errHandler)
API for standalone usage where the SCXML document is an InputSource. |
static SCXML |
parse(InputSource documentInputSource,
ErrorHandler errHandler,
List customActions)
API for standalone usage where the SCXML document is an InputSource. |
static SCXML |
parse(String documentRealPath,
ErrorHandler errHandler,
PathResolver pathResolver)
API for standalone usage where the SCXML document is a URI. |
static SCXML |
parse(String documentRealPath,
ErrorHandler errHandler,
PathResolver pathResolver,
List customActions)
API for standalone usage where the SCXML document is a URI. |
static SCXML |
parse(URL scxmlURL,
ErrorHandler errHandler)
API for standalone usage where the SCXML document is a URL. |
static SCXML |
parse(URL scxmlURL,
ErrorHandler errHandler,
List customActions)
API for standalone usage where the SCXML document is a URL, and the document uses custom actions. |
static void |
updateSCXML(SCXML scxml)
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 |
---|
public static SCXML parse(URL scxmlURL, ErrorHandler errHandler) throws IOException, SAXException, ModelException
API for standalone usage where the SCXML document is a URL.
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
IOException
- Underlying Digester parsing threw an IOException
SAXException
- Underlying Digester parsing threw a SAXException
ModelException
- If the resulting document model has flawsErrorHandler
,
PathResolver
public static SCXML parse(String documentRealPath, ErrorHandler errHandler, PathResolver pathResolver) throws IOException, SAXException, ModelException
API for standalone usage where the SCXML document is a URI. A PathResolver must be provided.
pathResolver
- The PathResolver for this contextdocumentRealPath
- The String pointing to the absolute (real) path of the
SCXML documenterrHandler
- The SAX ErrorHandler
IOException
- Underlying Digester parsing threw an IOException
SAXException
- Underlying Digester parsing threw a SAXException
ModelException
- If the resulting document model has flawsErrorHandler
,
PathResolver
public static SCXML parse(InputSource documentInputSource, ErrorHandler errHandler) throws IOException, SAXException, ModelException
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.
documentInputSource
- The InputSource for the SCXML documenterrHandler
- The SAX ErrorHandler
IOException
- Underlying Digester parsing threw an IOException
SAXException
- Underlying Digester parsing threw a SAXException
ModelException
- If the resulting document model has flawsErrorHandler
public static SCXML parse(URL scxmlURL, ErrorHandler errHandler, List customActions) throws IOException, SAXException, ModelException
API for standalone usage where the SCXML document is a URL, and the document uses custom actions.
scxmlURL
- a canonical absolute URL to parse (relative URLs within the
top level document are to be resovled against this URL).errHandler
- The SAX ErrorHandlercustomActions
- The list of CustomAction
s this digester
instance will process, can be null or empty
IOException
- Underlying Digester parsing threw an IOException
SAXException
- Underlying Digester parsing threw a SAXException
ModelException
- If the resulting document model has flawsErrorHandler
,
PathResolver
public static SCXML parse(String documentRealPath, ErrorHandler errHandler, PathResolver pathResolver, List customActions) throws IOException, SAXException, ModelException
API for standalone usage where the SCXML document is a URI. A PathResolver must be provided.
pathResolver
- The PathResolver for this contextdocumentRealPath
- The String pointing to the absolute (real) path of the
SCXML documenterrHandler
- The SAX ErrorHandlercustomActions
- The list of CustomAction
s this digester
instance will process, can be null or empty
IOException
- Underlying Digester parsing threw an IOException
SAXException
- Underlying Digester parsing threw a SAXException
ModelException
- If the resulting document model has flawsErrorHandler
,
PathResolver
public static SCXML parse(InputSource documentInputSource, ErrorHandler errHandler, List customActions) throws IOException, SAXException, ModelException
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.
documentInputSource
- The InputSource for the SCXML documenterrHandler
- The SAX ErrorHandlercustomActions
- The list of CustomAction
s this digester
instance will process, can be null or empty
IOException
- Underlying Digester parsing threw an IOException
SAXException
- Underlying Digester parsing threw a SAXException
ModelException
- If the resulting document model has flawsErrorHandler
public static org.apache.commons.digester.Digester newInstance()
Obtain a SCXML digester instance for further customization.
API Notes:updateSCXML(SCXML)
method in this class.
updateSCXML(SCXML)
public static org.apache.commons.digester.Digester newInstance(PathResolver pr)
Obtain a SCXML digester instance for further customization.
API Notes:updateSCXML(SCXML)
method in this class.
pr
- The PathResolver, may be null for standalone documents
updateSCXML(SCXML)
public static org.apache.commons.digester.Digester newInstance(SCXML scxml, PathResolver pr)
Obtain a SCXML digester instance for further customization.
API Notes:updateSCXML(SCXML)
method in this class.
scxml
- The parent SCXML document if there is one (in case of
state templates for example), null otherwisepr
- The PathResolver, may be null for standalone documents
updateSCXML(SCXML)
public static org.apache.commons.digester.Digester newInstance(SCXML scxml, PathResolver pr, List customActions)
Obtain a SCXML digester instance for further customization.
API Notes:updateSCXML(SCXML)
method in this class.
scxml
- The parent SCXML document if there is one (in case of
state templates for example), null otherwisepr
- The PathResolver, may be null for standalone documentscustomActions
- The list of CustomAction
s this digester
instance will process, can be null or empty
updateSCXML(SCXML)
public static void updateSCXML(SCXML scxml) throws ModelException
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.
scxml
- The SCXML object (output from Digester)
ModelException
- If the document model has flaws
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |