public interface GrammarDocument
DocumentServer.
VoiceXML is designed to support at least
Usually grammar documents will be text based, but also precompiled binary
grammars are supported. This can be checked by isAscii(). The
contents of text based grammars can be retrieved by getDocument().
The byte buffer of binary grammar documents can be retrieved by
getBuffer().
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(GrammarDocument other)
Checks if this grammar document is equal to the given grammar document.
|
byte[] |
getBuffer()
Retrieves the document's byte array.
|
java.lang.String |
getDocument()
Retrieves the document as a string.
|
org.jvoicexml.xml.srgs.GrammarType |
getMediaType()
Returns the declared media type of the grammar.
|
org.jvoicexml.xml.srgs.ModeType |
getModeType()
Returns the mode type of the grammar.
|
java.lang.String |
getTextContent()
Retrieves the document as a string.
|
java.net.URI |
getURI()
Retrieves the URI of the source grammar.
|
boolean |
isAscii()
Checks if the underlying document is an ASCII document.
|
boolean |
isCacheable()
Checks, if this grammar document can be cached or should be retrieved
anew.
|
void |
setMediaType(org.jvoicexml.xml.srgs.GrammarType type)
Sets the media type of this document.
|
void |
setModeType(org.jvoicexml.xml.srgs.ModeType type)
Sets the mode type.
|
void |
setURI(java.net.URI uri)
Sets the URI of this grammar document.
|
boolean isCacheable()
true if this grammar document can be cached.void setURI(java.net.URI uri)
uri - the new URIjava.net.URI getURI()
void setMediaType(org.jvoicexml.xml.srgs.GrammarType type)
type - the new media type.org.jvoicexml.xml.srgs.GrammarType getMediaType()
void setModeType(org.jvoicexml.xml.srgs.ModeType type)
type - the mode typeorg.jvoicexml.xml.srgs.ModeType getModeType()
boolean isAscii()
true if the document is an ASCII document.java.lang.String getDocument()
java.lang.String getTextContent()
getDocument()
this method returns the text content of a node if it was loaded from a
Grammar node of a
VoiceXmlNode.byte[] getBuffer()
isAscii() return false, otherwise the contents of
the string based buffer is returned via String.getBytes().boolean equals(GrammarDocument other)
other - the grammar document to compare with.true if the grammar documents are equal.