Class DataStoreException

    • Constructor Detail

      • DataStoreException

        public DataStoreException()
        Creates an exception with no cause and no details message.
      • DataStoreException

        public DataStoreException​(String message)
        Creates an exception with the specified details message.
        Parameters:
        message - the detail message in the default locale.
      • DataStoreException

        public DataStoreException​(Throwable cause)
        Creates an exception with the specified cause and no details message.
        Parameters:
        cause - the cause for this exception.
      • DataStoreException

        public DataStoreException​(String message,
                                  Throwable cause)
        Creates an exception with the specified details message and cause.
        Parameters:
        message - the detail message in the default locale.
        cause - the cause for this exception.
      • DataStoreException

        public DataStoreException​(Locale locale,
                                  String format,
                                  String filename,
                                  Object store)
        Creates a localized exception with a message saying that the given store can not be processed. Location in the file where the error occurred while be fetched from the given store argument if possible, for example by invoking the Line­Number­Reader​.get­Line­Number() or XMLStream­Reader​.get­Location() method. If the given store argument is not one of the recognized types, then it is ignored.

        Examples of messages created by this constructor:

        • Can not read “Foo” as a file in the Bar format.
        • Can not read after column 10 or line 100 of “Foo” as part of a file in the Bar format.
        Parameters:
        locale - the locale of the message to be returned by get­Localized­Message(), or null.
        format - short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", etc).
        filename - name of the file or data store where the error occurred.
        store - the input or output object from which to get the current position, or null if none. This can be a Line­Number­Reader or XMLStream­Reader for example.
        Since:
        0.8
    • Method Detail

      • getLocalizedMessage

        public String getLocalizedMessage()
        Returns a localized version of the exception message, typically for final user. This is often the same message than the one returned by get­Message(), but may in some occasions be different if Data­Store​.set­Locale(Locale) has been invoked with a different locale.
        get­Message() versus get­Localized­Message()
        When get­Message() and get­Localized­Message() are not equivalent, the Apache SIS policy is that get­Message() returns the message in the default locale while get­Localized­Message() returns the message in a locale that depends on the context in which the exception has been thrown. In a client-server architecture, the former is often the locale on the server side while the later is the locale on the client side if that information has been provided to the Data­Store.
        Specified by:
        get­Localized­Message in interface Localized­Exception
        Overrides:
        get­Localized­Message in class Throwable
        Returns:
        the localized message of this exception.
        Since:
        0.8
        See Also:
        Data­Store​.set­Locale(Locale)
      • getInternationalMessage

        public InternationalString getInternationalMessage()
        If this exception is capable to return the message in various locales, returns that message. Otherwise returns null.
        Specified by:
        get­International­Message in interface Localized­Exception
        Returns:
        the exception message, or null if this exception can not produce international message.
        Since:
        0.8