Class ErrorWritingException

All Implemented Interfaces:
ErrorWriter, Serializable
Direct Known Subclasses:
ConversionException, ObjectAccessException

public abstract class ErrorWritingException extends XStreamException implements ErrorWriter
Abstract base class for exceptions supporting an ErrorWriter. It can be passed around to things accepting an ErrorWriter to add diagnostics.
Since:
1.4.9
See Also:
  • Field Details

  • Constructor Details

    • ErrorWritingException

      public ErrorWritingException(String message)
      Constructs a ErrorWritingException.
      Parameters:
      message - the error message
      Since:
      1.4.9
    • ErrorWritingException

      public ErrorWritingException(Throwable cause)
      Constructs a ErrorWritingException.
      Parameters:
      cause - the causing exception
      Since:
      1.4.9
    • ErrorWritingException

      public ErrorWritingException(String message, Throwable cause)
      Constructs a ErrorWritingException.
      Parameters:
      message - the error message
      cause - the causing exception
      Since:
      1.4.9
  • Method Details

    • addData

      private void addData(String msg, Throwable cause)
    • get

      public String get(String errorKey)
      Description copied from interface: ErrorWriter
      Retrieve information of the error message.
      Specified by:
      get in interface ErrorWriter
      Parameters:
      errorKey - the key of the message
      Returns:
      the value
    • add

      public void add(String name, String information)
      Description copied from interface: ErrorWriter
      Add some information to the error message. The information will be added even if the identifier is already in use.
      Specified by:
      add in interface ErrorWriter
      Parameters:
      name - something to identify the type of information (e.g. 'XPath').
      information - detail of the message (e.g. '/blah/moo[3]'
    • set

      public void set(String name, String information)
      Description copied from interface: ErrorWriter
      Set some information to the error message. If the identifier is already in use, the new information will replace the old one.
      Specified by:
      set in interface ErrorWriter
      Parameters:
      name - something to identify the type of information (e.g. 'XPath').
      information - detail of the message (e.g. '/blah/moo[3]'
    • keys

      public Iterator keys()
      Description copied from interface: ErrorWriter
      Retrieve an iterator over all keys of the error message.
      Specified by:
      keys in interface ErrorWriter
      Returns:
      an Iterator
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getShortMessage

      public String getShortMessage()