|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.dialog.scxml.config.ConfigurationParser
public final class ConfigurationParser
Configuration utility for parsing SCXML documents as resources for defining dialogs. This class has no dependencies on web tier APIs, only on the Commons SCXML state machine engine library, and on the parsing technology (Commons Digester) being used.
The configuration for each Shale dialog exists as a standalone SCXML document, with additional dialog "metadata" file(s) that serve as the entry point for the Shale Dialog Manager.
These dialog-config.xml file(s) look like this:
<dialogs> <dialog name="Foo" scxmlconfig="foo.scxml" /> <dialog name="Bar" scxmlconfig="bar.scxml" dataclassname="org.apache.shale.examples.Bar" /> <dialog name="Baz" scxmlconfig="baz.scxml" /> <!-- etc. --> </dialogs>
To use this utility, instantiate a new instance and set the
dialogs
, resource
, and validating
properties. Then, call the parse()
method. You can parse
more than one resource by resetting the resource
property and calling parse()
again.
Constructor Summary | |
---|---|
ConfigurationParser()
|
Method Summary | |
---|---|
Map |
getDialogs()
Return the Map of Dialog instances
into which parsed information will be stored, keyed by dialog
name. |
URL |
getResource()
Return the URL of the configuration resource to be parsed. |
boolean |
isValidating()
Return a flag indicating whether we will be doing a validating parse or not. |
void |
parse()
Parse the configuration resource identified by the resource
property, storing resulting information in the Map specified
by the dialogs property. |
void |
setDialogs(Map dialogs)
Set the Map of Dialog instances
into which parsed information will be stored, keyed by dialog
name. |
void |
setResource(URL resource)
Set the URL of the configuration resource to be parsed. |
void |
setValidating(boolean validating)
Set a flag indicating whether we will be doing a validating parse or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationParser()
Method Detail |
---|
public Map getDialogs()
Return the Map
of Dialog
instances
into which parsed information will be stored, keyed by dialog
name.
public void setDialogs(Map dialogs)
Set the Map
of Dialog
instances
into which parsed information will be stored, keyed by dialog
name.
dialogs
- The new mappublic URL getResource()
Return the URL of the configuration resource to be parsed.
public void setResource(URL resource)
Set the URL of the configuration resource to be parsed.
resource
- The new resource URLpublic boolean isValidating()
Return a flag indicating whether we will be doing a validating parse
or not. Default value is false
.
public void setValidating(boolean validating)
Set a flag indicating whether we will be doing a validating parse or not.
validating
- New flag valuepublic void parse() throws IOException, SAXException
Parse the configuration resource identified by the resource
property, storing resulting information in the Map
specified
by the dialogs
property.
IOException
- if an input/output error occurs
SAXException
- if an XML parsing error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |