public final class ExternalGrammarDocument extends java.lang.Object implements GrammarDocument
GrammarDocument.| Constructor and Description |
|---|
ExternalGrammarDocument(java.net.URI source,
byte[] content,
java.lang.String encoding,
boolean ascii)
Creates a new grammar document.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(GrammarDocument other)
Checks if this grammar document is equal to the given grammar document.
|
boolean |
equals(java.lang.Object obj) |
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.
|
int |
hashCode() |
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 grammartype)
Sets the media type of this document.
|
void |
setModeType(org.jvoicexml.xml.srgs.ModeType modeType)
Sets the mode type.
|
void |
setURI(java.net.URI value)
Sets the URI of this grammar document.
|
java.lang.String |
toString() |
public ExternalGrammarDocument(java.net.URI source,
byte[] content,
java.lang.String encoding,
boolean ascii)
source - URI of the grammar documentcontent - the grammar itselfencoding - guessed encoding of the grammarascii - true if content is in ASCII formatpublic boolean isCacheable()
isCacheable in interface GrammarDocumenttrue if this grammar document can be cached.public void setURI(java.net.URI value)
setURI in interface GrammarDocumentvalue - the new URIpublic java.net.URI getURI()
getURI in interface GrammarDocumentpublic org.jvoicexml.xml.srgs.GrammarType getMediaType()
getMediaType in interface GrammarDocumentpublic void setMediaType(org.jvoicexml.xml.srgs.GrammarType grammartype)
setMediaType in interface GrammarDocumentgrammartype - the new media type.public boolean isAscii()
isAscii in interface GrammarDocumenttrue if the document is an ASCII document.public byte[] getBuffer()
GrammarDocument.isAscii() return false, otherwise the contents of
the string based buffer is returned via String.getBytes().getBuffer in interface GrammarDocumentpublic java.lang.String getDocument()
getDocument in interface GrammarDocumentpublic java.lang.String getTextContent()
GrammarDocument.getDocument()
this method returns the text content of a node if it was loaded from a
Grammar node of a
VoiceXmlNode.getTextContent in interface GrammarDocumentpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean equals(GrammarDocument other)
equals in interface GrammarDocumentother - the grammar document to compare with.true if the GrammarDocuments share the same
bufferpublic int hashCode()
hashCode in class java.lang.Objectpublic org.jvoicexml.xml.srgs.ModeType getModeType()
getModeType in interface GrammarDocumentpublic void setModeType(org.jvoicexml.xml.srgs.ModeType modeType)
setModeType in interface GrammarDocumentmodeType - the mode typepublic java.lang.String toString()
toString in class java.lang.Object