Package org.aspectj.bridge
Class Message
java.lang.Object
org.aspectj.bridge.Message
- All Implemented Interfaces:
IMessage
- Direct Known Subclasses:
LintMessage
,WeaveMessage
Implement messages. This implementation is immutable if ISourceLocation is immutable.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aspectj.bridge.IMessage
IMessage.Kind
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMessage(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.Message(String message, String details, IMessage.Kind kind, ISourceLocation sLoc, Throwable thrown, ISourceLocation[] otherLocs, boolean declared, int id, int sourcestart, int sourceend)
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.Message(String message, ISourceLocation location, boolean isError)
Create a (compiler) error or warning messageMessage(String message, ISourceLocation location, boolean isError, ISourceLocation[] extraSourceLocations)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Caller can verify if this message came about because of a DEOWReturn a List ofISourceLocation
instances that indicate additional source locations relevent to this message as specified by the message creator.int
getID()
Return the ID of the message where applicable, see IProblem for list of valid IDsgetKind()
int
Return the end position of the problem (inclusive), or -1 if unknown.int
Return the start position of the problem (inclusive), or -1 if unknown.boolean
isAbort()
boolean
isDebug()
boolean
isError()
boolean
isFailed()
boolean
isInfo()
boolean
boolean
isUsage()
boolean
toString()
-
Constructor Details
-
Message
Create a (compiler) error or warning message- Parameters:
message
- the String used as the underlying messagelocation
- the ISourceLocation, if any, associated with this messageisError
- 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.- Parameters:
message
- the String used as the underlying messagekind
- the IMessage.Kind of message - not nullthrown
- the Throwable, if any, associated with this messagesourceLocation
- the ISourceLocation, if any, associated with this messagedetails
- descriptive information about the message- Throws:
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.- Parameters:
message
- the String used as the underlying messagekind
- the IMessage.Kind of message - not nullthrown
- the Throwable, if any, associated with this messagesourceLocation
- the ISourceLocation, if any, associated with this message- Throws:
IllegalArgumentException
- if message is null and thrown is null or has a null message, or if kind is null and thrown is null.
-
-
Method Details
-
getKind
-
isError
public boolean isError() -
isWarning
public boolean isWarning() -
isDebug
public boolean isDebug() -
isUsage
public boolean isUsage() -
isTaskTag
public boolean isTaskTag() -
isInfo
public boolean isInfo() -
isAbort
public boolean isAbort() -
getDeclared
public boolean getDeclared()Caller can verify if this message came about because of a DEOW- Specified by:
getDeclared
in interfaceIMessage
-
isFailed
public boolean isFailed() -
getMessage
- Specified by:
getMessage
in interfaceIMessage
- Returns:
- non-null String with simple message
-
getThrown
-
getSourceLocation
- Specified by:
getSourceLocation
in interfaceIMessage
- Returns:
- ISourceLocation associated with this message, or null if none
-
toString
-
getDetails
- Specified by:
getDetails
in interfaceIMessage
- Returns:
- Detailed information about the message. For example, for declare error/warning messages this returns information about the corresponding join point's static part.
-
getExtraSourceLocations
Description copied from interface:IMessage
Return a List ofISourceLocation
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 fromgetSourceLocation()
.
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.
- Specified by:
getExtraSourceLocations
in interfaceIMessage
- Returns:
- a list of additional source locations
- See Also:
- AspectJ bug 41952
-
getID
public int getID()Description copied from interface:IMessage
Return the ID of the message where applicable, see IProblem for list of valid IDs -
getSourceStart
public int getSourceStart()Description copied from interface:IMessage
Return the start position of the problem (inclusive), or -1 if unknown.- Specified by:
getSourceStart
in interfaceIMessage
-
getSourceEnd
public int getSourceEnd()Description copied from interface:IMessage
Return the end position of the problem (inclusive), or -1 if unknown.- Specified by:
getSourceEnd
in interfaceIMessage
-