public final class InternalGrammarDocument extends java.lang.Object implements GrammarDocument
GrammarDocument referencing a grammar inside a VoiceXML document.| Constructor and Description |
|---|
InternalGrammarDocument(org.jvoicexml.xml.srgs.Grammar node)
Constructs a new object from a grammar node.
|
| 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 InternalGrammarDocument(org.jvoicexml.xml.srgs.Grammar node)
node - the grammar nodepublic 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 since internal documents are for sure ASCII.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