Class ReadOnlyException

  • All Implemented Interfaces:
    Localizable, LocalizableObject, Serializable

    public class ReadOnlyException
    extends ApplicationException
    A ReadOnlyException is thrown if the modification of something failed because it is read-only. Here something can be the property of a java object, an attribute in a persistent store, a file, etc.
    ATTENTION:
    Please design your APIs in a way to prevent such exception where ever possible. However for generic access to objects that can be mutable or read-only this exception is the right choice.
    See Also:
    Serialized Form
    • Constructor Detail

      • ReadOnlyException

        public ReadOnlyException​(Object object)
        The constructor.
        Parameters:
        object - is the object that is read-only and can not be modified.
      • ReadOnlyException

        public ReadOnlyException​(Object object,
                                 Object attribute)
        The constructor.
        Parameters:
        object - is the object that is read-only and can not be modified.
        attribute - is the attribute of object that can not be modified.
        Since:
        3.1.0
      • ReadOnlyException

        public ReadOnlyException​(Throwable cause,
                                 Object object)
        The constructor.
        Parameters:
        cause - is the cause of this exception.
        object - is the object that is read-only and can not be modified.
      • ReadOnlyException

        public ReadOnlyException​(Throwable cause,
                                 Object object,
                                 Object attribute)
        The constructor.
        Parameters:
        cause - is the cause of this exception.
        object - is the object that is read-only and can not be modified.
        attribute - is the attribute of object that can not be modified.
    • Method Detail

      • getCode

        public String getCode()
        Description copied from class: ApplicationException
        This method gets the code that identifies the detailed type of this object. While UUID is unique per instance of a ApplicationException this code is a short and readable identifier representing the ApplicationException Class. The default implementation returns the simple name. However, the code should remain stable after refactoring (so at least after the rename the previous code should be returned as String literal). This code may be used as a compact identifier to reference the related problem or information as well as for automatic tests of error situations that should remain stable even if the message text gets improved or the locale is unknown.
        Overrides:
        getCode in class ApplicationException
        Returns:
        the error code.