JSAPI 2.0

javax.speech.recognition
Class GrammarException

Object
  extended by Throwable
      extended by Exception
          extended by SpeechException
              extended by GrammarException

public class GrammarException
extends SpeechException

Thrown if a problem is found with grammar text from a resource or with a RuleGrammar object derived from grammar text.

Grammar problems are typically identified and fixed during application development. This class provides information that allows a debugging environment to handle the problem.

The exception message is a printable String. GrammarExceptionDetail may optionally be provided for each syntax problem.

See Also:
Grammar, RuleGrammar, GrammarExceptionDetail

Constructor Summary
GrammarException()
          Constructs a GrammarException with no detail message.
GrammarException(String message)
          Constructs a GrammarException with the specified detail message.
GrammarException(String message, GrammarExceptionDetail[] details)
          Constructs a GrammarException with the specified detail message and optional programmatic details of each problem.
 
Method Summary
 GrammarExceptionDetail[] getDetails()
          Gets the list of GrammarExceptionDetails.
 
Methods inherited from class Throwable
getMessage, printStackTrace, toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GrammarException

public GrammarException()
Constructs a GrammarException with no detail message.


GrammarException

public GrammarException(String message)
Constructs a GrammarException with the specified detail message.

Parameters:
message - a printable detail message
See Also:
getMessage

GrammarException

public GrammarException(String message,
                        GrammarExceptionDetail[] details)
                 throws IllegalArgumentException
Constructs a GrammarException with the specified detail message and optional programmatic details of each problem.

Parameters:
message - a printable detail message
details - a non-null array of details for problems encountered
Throws:
IllegalArgumentException - if called with an invalid parameter value
See Also:
getMessage, getDetails
Method Detail

getDetails

public GrammarExceptionDetail[] getDetails()
Gets the list of GrammarExceptionDetails. This provides additional detail for Grammar problems.

If no details are available, a zero-length array is returned.

Returns:
an array of GrammarExceptionDetail objects

JSAPI 2.0

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

Free Web Hosting