JSAPI 2.0

javax.speech.synthesis
Class SpeakableExceptionDetail

Object
  extended by SpeakableExceptionDetail

public class SpeakableExceptionDetail
extends Object

Describes a problem found during processing of an item placed on the Synthesizer output queue. This is usually bundled with a SpeakableException.

Multiple SpeakableExceptionDetail objects may be encapsulated by a single SpeakableException.

See Also:
Synthesizer, SpeakableException

Field Summary
static int SYNTAX_ERROR
          Detail type when markup contains a syntax error.
static int UNKNOWN_TYPE
          Constant representing an unknown type.
static int UNKNOWN_VALUE
          Constant representing an unknown value.
static int UNSUPPORTED_ALPHABET
          Detail type representing an unsupported phoneme alphabet.
static int UNSUPPORTED_AUDIO
          Detail type when audio cannot be played.
static int UNSUPPORTED_INTERPRETATION
          Detail type when the Synthesizer does not support the specified value of an attribute for the say-as element.
static int UNSUPPORTED_LANGUAGE
          Detail type representing an unsupported language.
static int UNSUPPORTED_LEXEME
          Detail type representing an unsupported lexeme.
static int UNSUPPORTED_LEXICON
          Detail type representing an unsupported lexicon.
static int UNSUPPORTED_PHONEME
          Detail type representing an unsupported phoneme.
static int UNSUPPORTED_VOICE
          Detail type representing an unsupported voice.
 
Constructor Summary
SpeakableExceptionDetail(int type, String textInfo, int lineNumber, int charNumber, String message)
          Constructs a SpeakableExceptionDetail object with the information provided.
 
Method Summary
 int getCharNumber()
          Gets the character number in a line in text containing this problem.
 int getLineNumber()
          Gets the line number in text containing this problem.
 String getMessage()
          Gets a printable String describing this problem.
 String getTextInfo()
          Gets text information specific to the problem encountered.
 int getType()
          Gets the detail type for this problem.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_VALUE

public static final int UNKNOWN_VALUE
Constant representing an unknown value.

See Also:
getLineNumber, getCharNumber, Constant Field Values

UNKNOWN_TYPE

public static final int UNKNOWN_TYPE
Constant representing an unknown type. getTextInfo returns the empty String in this case.

See Also:
getType, getTextInfo, Constant Field Values

UNSUPPORTED_ALPHABET

public static final int UNSUPPORTED_ALPHABET
Detail type representing an unsupported phoneme alphabet.

getTextInfo returns the markup containing the problem. Specifically, the value of the alphabet attribute. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values

UNSUPPORTED_AUDIO

public static final int UNSUPPORTED_AUDIO
Detail type when audio cannot be played.

getTextInfo returns the markup containing the problem. Specifically, the value of the src attribute from the audio element. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values

UNSUPPORTED_INTERPRETATION

public static final int UNSUPPORTED_INTERPRETATION
Detail type when the Synthesizer does not support the specified value of an attribute for the say-as element. In particular, the interpret-as, format, and detail attributes may include unsupported values.

getTextInfo returns the markup containing the problem. Specifically, the unsupported attribute='value' pair. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values

UNSUPPORTED_LANGUAGE

public static final int UNSUPPORTED_LANGUAGE
Detail type representing an unsupported language. The specified xml:lang attribute value is not supported.

getTextInfo returns the markup containing the problem. Specifically, the value of the unsupported language. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values

UNSUPPORTED_LEXEME

public static final int UNSUPPORTED_LEXEME
Detail type representing an unsupported lexeme. A lexeme is a meaningful linguistic unit that is an item in the vocabulary of a language.

getTextInfo returns the unsupported lexeme. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, VocabularyManager, Constant Field Values

UNSUPPORTED_LEXICON

public static final int UNSUPPORTED_LEXICON
Detail type representing an unsupported lexicon.

getTextInfo returns the markup containing the problem. Specifically, the unsupported lexicon reference. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values

UNSUPPORTED_PHONEME

public static final int UNSUPPORTED_PHONEME
Detail type representing an unsupported phoneme.

The Engine should ignore the phoneme and continue processing.

getTextInfo returns the markup containing the problem. Specifically, the unsupported phoneme requested. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values

UNSUPPORTED_VOICE

public static final int UNSUPPORTED_VOICE
Detail type representing an unsupported voice. The voice element specified in the markup cannot be matched.

The Synthesizer will issue a VOICED_CHANGED event for the closest matching voice, which may be the current voice.

getTextInfo returns the markup containing the problem. Specifically, the markup for the voice element. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, SpeakableEvent.VOICE_CHANGED, Constant Field Values

SYNTAX_ERROR

public static final int SYNTAX_ERROR
Detail type when markup contains a syntax error.

getTextInfo returns the markup containing the error. This can include an an unexpected element name, attribute name, or attribute value. getTextInfo may return the empty String if more specific information is unavailable. getMessage may return more detailed information.

See Also:
getTextInfo, getMessage, Constant Field Values
Constructor Detail

SpeakableExceptionDetail

public SpeakableExceptionDetail(int type,
                                String textInfo,
                                int lineNumber,
                                int charNumber,
                                String message)
                         throws IllegalArgumentException
Constructs a SpeakableExceptionDetail object with the information provided. The associated accessor methods provide more detail about the parameters and allowable values.

Parameters:
type - a constant providing the detail type
textInfo - text from item text specific to the detail type
lineNumber - line number of the problem in the item text
charNumber - character number (within lineNumber) in the item text
message - a printable description string
Throws:
IllegalArgumentException - if called with an invalid parameter value
See Also:
getType, getTextInfo, getLineNumber, getCharNumber, getMessage
Method Detail

getLineNumber

public int getLineNumber()
Gets the line number in text containing this problem. This a positive integer if known. Otherwise, UNKNOWN_VALUE is returned.

Returns:
the line number in the text containing this problem
See Also:
getCharNumber, UNKNOWN_VALUE

getCharNumber

public int getCharNumber()
Gets the character number in a line in text containing this problem. This a positive integer if known. Otherwise, UNKNOWN_VALUE is returned.

This value will be UNKNOWN_VALUE if getLineNumber returns UNKNOWN_VALUE.

Returns:
character number in a line in text containing this problem
See Also:
getLineNumber, UNKNOWN_VALUE

getMessage

public String getMessage()
Gets a printable String describing this problem. May be null.

Returns:
a String description of this problem

getTextInfo

public String getTextInfo()
Gets text information specific to the problem encountered. The text information is specific to the value returned by getType. See that method for details.

Returns:
text information specific to the problem encountered
See Also:
getType()

getType

public int getType()
Gets the detail type for this problem. This will be one of the defined detail types or UNKNOWN_TYPE in the case where it is not known.

An application may use this value to take appropriate action.

Returns:
the detail type for this problem
See Also:
UNKNOWN_TYPE, UNSUPPORTED_ALPHABET, UNSUPPORTED_AUDIO, UNSUPPORTED_INTERPRETATION, UNSUPPORTED_LANGUAGE, UNSUPPORTED_LEXEME, UNSUPPORTED_LEXICON, UNSUPPORTED_PHONEME, UNSUPPORTED_VOICE, SYNTAX_ERROR

JSAPI 2.0

JavaTM Speech API 2.0, Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.

Free Web Hosting