Klasse Message

java.lang.Object
org.aspectj.bridge.Message
Alle implementierten Schnittstellen:
IMessage
Bekannte direkte Unterklassen:
LintMessage, WeaveMessage

public class Message extends Object implements IMessage
Implement messages. This implementation is immutable if ISourceLocation is immutable.
  • Konstruktordetails

    • Message

      public Message(String message, ISourceLocation location, boolean isError)
      Create a (compiler) error or warning message
      Parameter:
      message - the String used as the underlying message
      location - the ISourceLocation, if any, associated with this message
      isError - if true, use IMessage.ERROR; else use IMessage.WARNING
    • Message

      public Message(String message, ISourceLocation location, boolean isError, ISourceLocation[] extraSourceLocations)
    • Message

      public Message(String message, String details, IMessage.Kind kind, ISourceLocation sourceLocation, Throwable thrown, ISourceLocation[] extraSourceLocations)
      Create a message, handling null values for message and kind if thrown is not null.
      Parameter:
      message - the String used as the underlying message
      details - descriptive information about the message
      kind - the IMessage.Kind of message - not null
      sourceLocation - the ISourceLocation, if any, associated with this message
      thrown - the Throwable, if any, associated with this message
      Löst aus:
      IllegalArgumentException - if message is null and thrown is null or has a null message, or if kind is null and thrown is null.
    • Message

      public Message(String message, String details, IMessage.Kind kind, ISourceLocation sLoc, Throwable thrown, ISourceLocation[] otherLocs, boolean declared, int id, int sourcestart, int sourceend)
    • Message

      public Message(String message, IMessage.Kind kind, Throwable thrown, ISourceLocation sourceLocation)
      Create a message, handling null values for message and kind if thrown is not null.
      Parameter:
      message - the String used as the underlying message
      kind - the IMessage.Kind of message - not null
      thrown - the Throwable, if any, associated with this message
      sourceLocation - the ISourceLocation, if any, associated with this message
      Löst aus:
      IllegalArgumentException - if message is null and thrown is null or has a null message, or if kind is null and thrown is null.
  • Methodendetails

    • getKind

      public IMessage.Kind getKind()
      Angegeben von:
      getKind in Schnittstelle IMessage
      Gibt zurück:
      the kind of this message
    • isError

      public boolean isError()
      Angegeben von:
      isError in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.ERROR
    • isWarning

      public boolean isWarning()
      Angegeben von:
      isWarning in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.WARNING
    • isDebug

      public boolean isDebug()
      Angegeben von:
      isDebug in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.DEBUG
    • isUsage

      public boolean isUsage()
      Angegeben von:
      isUsage in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.USAGE
    • isTaskTag

      public boolean isTaskTag()
      Angegeben von:
      isTaskTag in Schnittstelle IMessage
      Gibt zurück:
      true if this is a task tag message
    • isInfo

      public boolean isInfo()
      Angegeben von:
      isInfo in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.INFO
    • isAbort

      public boolean isAbort()
      Angegeben von:
      isAbort in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.ABORT
    • getDeclared

      public boolean getDeclared()
      Caller can verify if this message came about because of a DEOW
      Angegeben von:
      getDeclared in Schnittstelle IMessage
    • isFailed

      public boolean isFailed()
      Angegeben von:
      isFailed in Schnittstelle IMessage
      Gibt zurück:
      true if kind == IMessage.FAIL
    • getMessage

      public final String getMessage()
      Angegeben von:
      getMessage in Schnittstelle IMessage
      Gibt zurück:
      non-null String with simple message
    • getThrown

      public final Throwable getThrown()
      Angegeben von:
      getThrown in Schnittstelle IMessage
      Gibt zurück:
      Throwable associated with this message, or null if none
    • getSourceLocation

      public final ISourceLocation getSourceLocation()
      Angegeben von:
      getSourceLocation in Schnittstelle IMessage
      Gibt zurück:
      ISourceLocation associated with this message, or null if none
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • getDetails

      public String getDetails()
      Angegeben von:
      getDetails in Schnittstelle IMessage
      Gibt zurück:
      Detailed information about the message. For example, for declare error/warning messages this returns information about the corresponding join point's static part.
    • getExtraSourceLocations

      public List<ISourceLocation> getExtraSourceLocations()
      Beschreibung aus Schnittstelle kopiert: IMessage
      Return a List of ISourceLocation instances that indicate additional source locations relevent to this message as specified by the message creator. The list should not include the primary source location associated with the message which can be obtained from getSourceLocation().

      An example of using extra locations would be in a warning message that flags all shadow locations that will go unmatched due to a pointcut definition being based on a subtype of a defining type.

      Angegeben von:
      getExtraSourceLocations in Schnittstelle IMessage
      Gibt zurück:
      a list of additional source locations
      Siehe auch:
    • getID

      public int getID()
      Beschreibung aus Schnittstelle kopiert: IMessage
      Return the ID of the message where applicable, see IProblem for list of valid IDs
      Angegeben von:
      getID in Schnittstelle IMessage
    • getSourceStart

      public int getSourceStart()
      Beschreibung aus Schnittstelle kopiert: IMessage
      Return the start position of the problem (inclusive), or -1 if unknown.
      Angegeben von:
      getSourceStart in Schnittstelle IMessage
    • getSourceEnd

      public int getSourceEnd()
      Beschreibung aus Schnittstelle kopiert: IMessage
      Return the end position of the problem (inclusive), or -1 if unknown.
      Angegeben von:
      getSourceEnd in Schnittstelle IMessage