public class VoiceXmlInterpreterContext
extends java.lang.Object
VoiceXmlInterpreter to interpret a
VoiceXmlDocument and that may also interact
with the ImplementationPlatform independent of the
VoiceXmlInterpreter.| Constructor and Description |
|---|
VoiceXmlInterpreterContext(JVoiceXmlSession currentSession,
Configuration config)
Creates a new object.
|
VoiceXmlInterpreterContext(JVoiceXmlSession currentSession,
Configuration config,
ScopeObserver observer)
Creates a new object in the context of the observing entity specified
by the observer.
|
| Modifier and Type | Method and Description |
|---|---|
GrammarDocument |
acquireExternalGrammar(java.net.URI uri,
FetchAttributes attributes)
Acquire the VoiceXML document with the given URI.
|
org.jvoicexml.xml.vxml.VoiceXmlDocument |
acquireVoiceXmlDocument(DocumentDescriptor descriptor)
Acquires the VoiceXML document with the given URI.
|
void |
close()
Closes all open resources.
|
void |
enterScope(Scope scope)
Enter a new scope for resolving variables. this is useful if we enter a
new block, but at least every file should have it's own scope.
|
void |
exitScope(Scope scope)
Return from a previously created scope. i.e. pop current scope from
stack.
|
ActiveGrammarSet |
getActiveGrammarSet()
Retrieves the active grammar set.
|
Application |
getApplication()
Retrieves the application.
|
CallControlProperties |
getCallControlProperties(FormInterpretationAlgorithm fia)
Loads the speech recognizer properties.
|
Configuration |
getConfiguration()
Retrieves the configuration.
|
DataModel |
getDataModel()
Lazy instantiation of the data model.
|
DocumentServer |
getDocumentServer()
Retrieves a reference to the document server.
|
DtmfRecognizerProperties |
getDtmfRecognizerProperties(FormInterpretationAlgorithm fia)
Loads the DTMF recognizer properties.
|
EventBus |
getEventBus()
Retrieves the event bus.
|
EventHandler |
getEventHandler()
Retrieves the event handler to use in this context.
|
GrammarProcessor |
getGrammarProcessor()
Retrieves a reference to the grammar processor.
|
ImplementationPlatform |
getImplementationPlatform()
Retrieves a reference to the used implementation platform.
|
Profile |
getProfile()
Retrieves the active profile.
|
java.lang.String |
getProperty(java.lang.String name)
Retrieves the value of the given property.
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defValue)
Retrieves the value of the given property.
|
ScopeObserver |
getScopeObserver()
Retrieves the scope observer for this session.
|
Session |
getSession()
Retrieves the current session.
|
SpeechRecognizerProperties |
getSpeechRecognizerProperties(FormInterpretationAlgorithm fia)
Loads the speech recognizer properties.
|
org.jvoicexml.xml.vxml.VoiceXmlDocument |
loadDocument(DocumentDescriptor descriptor)
Loads the document of the descriptor with the associated attributes and
adds it to the list of loaded documents.
|
void |
process(Application appl)
Starts processing the given application.
|
void |
processSubdialog(Application appl,
DocumentDescriptor desc,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Starts processing the given application.
|
void |
setApplication(Application value)
Sets the current application.
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets the property with the given name to the given value.
|
public VoiceXmlInterpreterContext(JVoiceXmlSession currentSession, Configuration config)
currentSession - the current sessionconfig - the configuration to use.public VoiceXmlInterpreterContext(JVoiceXmlSession currentSession, Configuration config, ScopeObserver observer)
currentSession - the current sessionconfig - the configuration to useobserver - the scope observerpublic Session getSession()
public Profile getProfile()
public ScopeObserver getScopeObserver()
public ImplementationPlatform getImplementationPlatform()
public GrammarProcessor getGrammarProcessor()
public Configuration getConfiguration()
public DataModel getDataModel()
public EventBus getEventBus()
public EventHandler getEventHandler()
public void enterScope(Scope scope)
scope - the new scope.public void exitScope(Scope scope)
scope - The scope which was left.public void close()
public ActiveGrammarSet getActiveGrammarSet()
public void setProperty(java.lang.String name,
java.lang.String value)
name - Name of the property.value - Value of the property.public java.lang.String getProperty(java.lang.String name)
name - Name of the property.public java.lang.String getProperty(java.lang.String name,
java.lang.String defValue)
name - name of the property.defValue - the default value, if the property is not defined.public SpeechRecognizerProperties getSpeechRecognizerProperties(FormInterpretationAlgorithm fia) throws ConfigurationException
fia - the current form interpretation algorithm, maybe
null.ConfigurationException - if the object could not be loaded.public DtmfRecognizerProperties getDtmfRecognizerProperties(FormInterpretationAlgorithm fia) throws ConfigurationException
fia - the current form interpretation algorithm, maybe
null.ConfigurationException - if the object could not be loaded.public CallControlProperties getCallControlProperties(FormInterpretationAlgorithm fia) throws ConfigurationException
fia - the current form interpretation algorithm, maybe
null.ConfigurationException - if the object could not be loaded.public void setApplication(Application value)
value - the new applicationpublic Application getApplication()
public void process(Application appl) throws ErrorEvent
appl - The application to process.ErrorEvent - Error processing the document.public void processSubdialog(Application appl, DocumentDescriptor desc, java.util.Map<java.lang.String,java.lang.Object> parameters) throws JVoiceXMLEvent
appl - the application to process.desc - the document descriptor for the subdialogparameters - passed parameters when executing this dialogJVoiceXMLEvent - Error processing the document.public org.jvoicexml.xml.vxml.VoiceXmlDocument loadDocument(DocumentDescriptor descriptor) throws BadFetchError
If an application is active, the descriptor is also modified to contain the resolved URI.
descriptor - descriptor of the next document to process.BadFetchError - Error retrieving the document.public DocumentServer getDocumentServer()
public org.jvoicexml.xml.vxml.VoiceXmlDocument acquireVoiceXmlDocument(DocumentDescriptor descriptor) throws BadFetchError
If a relative URI is given, the scheme and authority of the last document are used to create a hierarchical URI for the next document.
descriptor - descriptor of the next document to process.BadFetchError - Error retrieving the document.public GrammarDocument acquireExternalGrammar(java.net.URI uri, FetchAttributes attributes) throws BadFetchError
If a relative URI is given, the scheme and authority of the last document are used to create a hierarchical URI for the next document.
uri - URI of the next document to process.attributes - attributes governing the fetch.BadFetchError - Error retrieving the document.