org.apache.xerces.impl.dv

## Class DatatypeException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.apache.xerces.impl.dv.DatatypeException

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    InvalidDatatypeFacetException, InvalidDatatypeValueException

      public class DatatypeException
      extends java.lang.Exception

  Base class for datatype exceptions. For DTD types, the exception can be created from an error message. For Schema types, it needs an error code (as defined in Appendix C of the structure spec), plus an array of arguments, for error message substitution.
  Version:
    $Id: DatatypeException.java 809242 2009-08-30 03:34:31Z mrglavas $
  Author:
    Sandy Gao, IBM
  See Also:
    Serialized Form

  # INTERNAL:

    Usage of this class is not supported. It may be altered or removed at any time.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Object[]` | `args`
    `protected java.lang.String` | `key`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatatypeException(java.lang.String key, java.lang.Object[] args)` Create a new datatype exception by providing an error code and a list of error message substitution arguments.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object[]` | `getArgs()` Return the list of error arguments
    `java.lang.String` | `getKey()` Return the error code
    `java.lang.String` | `getMessage()` Overrides this method to get the formatted&localized error message.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### key

          protected final java.lang.String key

    - #### args

          protected final java.lang.Object[] args

  - ### Constructor Detail

    - #### DatatypeException

          public DatatypeException(java.lang.String key,
                           java.lang.Object[] args)

      Create a new datatype exception by providing an error code and a list of error message substitution arguments.
      Parameters:
        `key` - error code
        `args` - error arguments

  - ### Method Detail

    - #### getKey

          public java.lang.String getKey()

      Return the error code
      Returns:
        error code

    - #### getArgs

          public java.lang.Object[] getArgs()

      Return the list of error arguments
      Returns:
        error arguments

    - #### getMessage

          public java.lang.String getMessage()

      Overrides this method to get the formatted&localized error message. REVISIT: the system locale is used to load the property file. do we want to allow the appilcation to specify a different locale?
      Overrides:
        `getMessage` in class `java.lang.Throwable`

Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.