info.bioinfweb.jphyloio.exception

## Class IllegalEventException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - info.bioinfweb.jphyloio.exception.InconsistentAdapterDataException
        - - info.bioinfweb.jphyloio.exception.IllegalEventException

- All Implemented Interfaces:
    java.io.Serializable

      public class IllegalEventException
      extends InconsistentAdapterDataException

  This exception in thrown by implementations of `JPhyloIOEventReceiver` and indicates that a data adapter passed an event that is illegal at the current position according to the grammar defined in the documentation of `JPhyloIOEventReader`.

  The cause for this exception would usually be an error in the implementation of a data adapter.

  Since:
    0.0.0
  Author:
    Ben Stöver
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IllegalEventException(java.lang.String message, JPhyloIOEventReceiver receiver, JPhyloIOEvent parentEvent, JPhyloIOEvent invalidEvent)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JPhyloIOEvent` | `getInvalidEvent()`
    `JPhyloIOEvent` | `getParentEvent()`
    `JPhyloIOEventReceiver` | `getReceiver()`
    `static IllegalEventException` | `newInstance(JPhyloIOEventReceiver receiver, JPhyloIOEvent parentEvent, JPhyloIOEvent invalidEvent)` Tool method that creates a new instance of this class.
    `boolean` | `wasAtReceiverRootLevel()`

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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`

- - ### Constructor Detail

    - #### IllegalEventException

          public IllegalEventException(java.lang.String message,
                                       JPhyloIOEventReceiver receiver,
                                       JPhyloIOEvent parentEvent,
                                       JPhyloIOEvent invalidEvent)

  - ### Method Detail

    - #### newInstance

          public static IllegalEventException newInstance(JPhyloIOEventReceiver receiver,
                                                          JPhyloIOEvent parentEvent,
                                                          JPhyloIOEvent invalidEvent)

      Tool method that creates a new instance of this class. It uses the specified parent event. If that parent event should be `null`, a different exception message will be used.
      Parameters:
        `receiver` - the receiver throwing the returned exception
        `parentEvent` - the current parent event or `null`
        `invalidEvent` - the invalid element that was encountered
      Returns:
        the new instance

    - #### getReceiver

          public JPhyloIOEventReceiver getReceiver()

    - #### getParentEvent

          public JPhyloIOEvent getParentEvent()

    - #### wasAtReceiverRootLevel

          public boolean wasAtReceiverRootLevel()

    - #### getInvalidEvent

          public JPhyloIOEvent getInvalidEvent()