public class MaryData extends Object
Constructor and Description |
---|
MaryData(MaryDataType type,
Locale locale) |
MaryData(MaryDataType type,
Locale locale,
boolean createStubDocument) |
Modifier and Type | Method and Description |
---|---|
void |
append(MaryData md) |
void |
appendAudio(AudioInputStream audioToAppend)
For audio data, append more audio data to the one currently present.
|
AudioInputStream |
getAudio() |
AudioFileFormat |
getAudioFileFormat() |
Object |
getData() |
String |
getDefaultEffects() |
String |
getDefaultStyle() |
Voice |
getDefaultVoice() |
Document |
getDocument() |
Locale |
getLocale() |
String |
getOutputParams() |
String |
getPlainText() |
MaryDataType |
getType() |
boolean |
getValidating() |
boolean |
getWarnClient()
Deprecated.
|
void |
readFrom(InputStream is)
Read data from input stream
is , in the appropriate way as determined by our type . |
void |
readFrom(InputStream is,
String endMarker)
Read data from input stream
is , in the appropriate way as determined by our type . |
void |
readFrom(Reader from)
Read data from reader
r in the appropriate way as determined by our type . |
void |
readFrom(Reader from,
String endMarker)
Read data from reader
r in the appropriate way as determined by our type . |
void |
setAudio(AudioInputStream audio)
Set the audio data.
|
void |
setAudioFileFormat(AudioFileFormat audioFileFormat)
The audio file format is required only for data types serving as input to modules producing AUDIO data (e.g., MBROLA data),
as well as for the AUDIO data itself.
|
void |
setData(String dataString)
Set the content data of this MaryData object from the given String.
|
void |
setDefaultEffects(String effects) |
void |
setDefaultStyle(String style) |
void |
setDefaultVoice(Voice voice) |
void |
setDocument(Document xmlDocument) |
void |
setOutputParams(String params) |
void |
setPlainText(String plainText) |
void |
setValidating(boolean doValidate) |
void |
setWarnClient(boolean doWarnClient)
Deprecated.
|
String |
toString() |
void |
writeTo(OutputStream os)
Write our internal representation to output stream
os , in the appropriate way as determined by our
type . |
void |
writeTo(Writer w)
Write our internal representation to writer
w , in the appropriate way as determined by our type . |
public MaryData(MaryDataType type, Locale locale)
public MaryData(MaryDataType type, Locale locale, boolean createStubDocument)
public boolean getValidating()
public void setValidating(boolean doValidate) throws ParserConfigurationException
ParserConfigurationException
@Deprecated public boolean getWarnClient()
@Deprecated public void setWarnClient(boolean doWarnClient)
public MaryDataType getType()
public Locale getLocale()
public void readFrom(InputStream is) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, TransformerException
is
, in the appropriate way as determined by our type
.is
- isParserConfigurationException
- ParserConfigurationExceptionSAXException
- SAXExceptionIOException
- IOExceptionTransformerConfigurationException
- TransformerConfigurationExceptionTransformerException
- TransformerExceptionpublic void readFrom(InputStream is, String endMarker) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, TransformerException
is
, in the appropriate way as determined by our type
.is
- the InputStream from which to read.endMarker
- a string marking end of file. If this is null, read until end-of-file; if it is non-null, read up to (and
including) the first line containing the end marker string. This will be ignored for audio data.ParserConfigurationException
- ParserConfigurationExceptionSAXException
- SAXExceptionIOException
- IOExceptionTransformerConfigurationException
- TransformerConfigurationExceptionTransformerException
- TransformerExceptionpublic void readFrom(Reader from) throws ParserConfigurationException, SAXException, IOException
r
in the appropriate way as determined by our type
. Only XML and Text data
can be read from a reader, audio data cannot.from
- fromParserConfigurationException
- ParserConfigurationExceptionSAXException
- SAXExceptionIOException
- IOExceptionpublic void readFrom(Reader from, String endMarker) throws ParserConfigurationException, SAXException, IOException
r
in the appropriate way as determined by our type
. Only XML and Text data
can be read from a reader, audio data cannot. "Helpers" needed to read the data, such as XML parser objects, are created
when they are needed. If doWarnClient is set to true, warning and error messages related to XML parsing are logged to the
log category connected to the client from which this request originated.from
- the Reader from which to read.endMarker
- a string marking end of file. If this is null, read until end-of-file; if it is non-null, read up to (and
including) the first line containing the end marker string.ParserConfigurationException
- ParserConfigurationExceptionSAXException
- SAXExceptionIOException
- IOExceptionpublic void setData(String dataString) throws ParserConfigurationException, SAXException, IOException
MaryDataType.isXMLType()
), parse
the String representation of the data into a DOM tree.dataString
- string representation of the input data.ParserConfigurationException
- ParserConfigurationExceptionIOException
- IOExceptionSAXException
- SAXExceptionIllegalArgumentException
- if this method is called for MaryDataTypes that are neither text nor XML.public void writeTo(OutputStream os) throws TransformerConfigurationException, FileNotFoundException, TransformerException, IOException, Exception
os
, in the appropriate way as determined by our
type
.os
- osTransformerConfigurationException
- TransformerConfigurationExceptionFileNotFoundException
- FileNotFoundExceptionTransformerException
- TransformerExceptionIOException
- IOExceptionException
- Exceptionpublic void writeTo(Writer w) throws TransformerConfigurationException, FileNotFoundException, TransformerException, IOException, Exception
w
, in the appropriate way as determined by our type
.
Only XML and Text data can be written to a writer, audio data cannot. "Helpers" needed to read the data, such as XML parser
objects, are created when they are needed.w
- wTransformerConfigurationException
- TransformerConfigurationExceptionFileNotFoundException
- FileNotFoundExceptionTransformerException
- TransformerExceptionIOException
- IOExceptionException
- Exceptionpublic Object getData()
public String getPlainText()
public void setPlainText(String plainText)
public Document getDocument()
public void setDocument(Document xmlDocument)
public AudioInputStream getAudio()
public void setAudio(AudioInputStream audio)
audio
- audiopublic void setDefaultVoice(Voice voice)
public Voice getDefaultVoice()
public void setDefaultStyle(String style)
public String getDefaultStyle()
public void setDefaultEffects(String effects)
public String getDefaultEffects()
public void setAudioFileFormat(AudioFileFormat audioFileFormat)
audioFileFormat
- audioFileFormatpublic AudioFileFormat getAudioFileFormat()
public void append(MaryData md)
public void appendAudio(AudioInputStream audioToAppend)
audioToAppend
- the new audio data to appendpublic void setOutputParams(String params)
public String getOutputParams()
Copyright © 2000–2016 DFKI GmbH. All rights reserved.