Class WarningEvent

  • All Implemented Interfaces:
    LoggableEvent

    public class WarningEvent
    extends java.lang.Object
    implements LoggableEvent
    An event fired when the user should be warned they tried to do something unsupported, such as trying to generate code with an operation that does not support code gen.

    The event contains a short header text describing the warning and a detailed body text that lets the user know why what they attempted was not allowed.

    • Constructor Summary

      Constructors 
      Constructor Description
      WarningEvent​(java.lang.String header, java.lang.String body)
      Creates a new warning event.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String asLoggableString()
      Creates a string representation of this event to be logged.
      java.lang.String getBody()
      Gets the warning body.
      java.lang.String getHeader()
      Gets the warning header.
      java.util.logging.Level logLevel()
      Gets log level of this event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WarningEvent

        public WarningEvent​(java.lang.String header,
                            java.lang.String body)
        Creates a new warning event.
        Parameters:
        header - the header or title of the warning (e.g. "Cannot generate code"). This should be short and descriptive.
        body - the body of the warning. This should go into detail about what the user did wrong.
    • Method Detail

      • getHeader

        public java.lang.String getHeader()
        Gets the warning header.
      • getBody

        public java.lang.String getBody()
        Gets the warning body.
      • logLevel

        public java.util.logging.Level logLevel()
        Description copied from interface: LoggableEvent
        Gets log level of this event. Defaults to Level.INFO.
        Specified by:
        logLevel in interface LoggableEvent
      • asLoggableString

        public java.lang.String asLoggableString()
        Description copied from interface: LoggableEvent
        Creates a string representation of this event to be logged. Defaults to toString().
        Specified by:
        asLoggableString in interface LoggableEvent