Class DatatypeException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    InvalidDatatypeFacetException, InvalidDatatypeValueException

    public class DatatypeException
    extends 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$
    Author:
    Sandy Gao, IBM
    See Also:
    Serialized Form
    • Field Detail

      • key

        protected final String key
      • args

        protected final Object[] args
    • Constructor Detail

      • DatatypeException

        public DatatypeException​(String key,
                                 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 String getKey()
        Return the error code
        Returns:
        error code
      • getArgs

        public Object[] getArgs()
        Return the list of error arguments
        Returns:
        error arguments
      • getMessage

        public 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 Throwable