Top Description Fields Constructors Methods
org.aspectj.bridge

public Class Message

extends Object
implements IMessage
Class Inheritance
All Implemented Interfaces
org.aspectj.bridge.IMessage
Known Direct Subclasses
org.aspectj.bridge.WeaveMessage, org.aspectj.weaver.LintMessage
Imports
java.util.Arrays, .Collections, .List

Implement messages. This implementation is immutable if ISourceLocation is immutable.

Field Summary

Modifier and TypeField and Description
private final boolean
private final String
private final List<ISourceLocation>
private final int
private final IMessage.Kind
private final String
private final int
private final ISourceLocation
private final int
private final Throwable

Constructor Summary

AccessConstructor and Description
public
Message(String
the String used as the underlying message
message
,
ISourceLocation
the ISourceLocation, if any, associated with this message
location
,
boolean
if true, use IMessage.ERROR; else use IMessage.WARNING
isError
)

Create a (compiler) error or warning message

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

public
Message(String
the String used as the underlying message
message
,
String
descriptive information about the message
details
,
IMessage.Kind
the IMessage.Kind of message - not null
kind
,
ISourceLocation
the ISourceLocation, if any, associated with this message
sourceLocation
,
Throwable
the Throwable, if any, associated with this message
thrown
,
ISourceLocation[] extraSourceLocations)

Create a message, handling null values for message and kind if thrown is not null.

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

public
Message(String
the String used as the underlying message
message
,
IMessage.Kind
the IMessage.Kind of message - not null
kind
,
Throwable
the Throwable, if any, associated with this message
thrown
,
ISourceLocation
the ISourceLocation, if any, associated with this message
sourceLocation
)

Create a message, handling null values for message and kind if thrown is not null.

Method Summary

Modifier and TypeMethod and Description
public boolean
getDeclared()

Implements org.aspectj.bridge.IMessage.getDeclared.

Caller can verify if this message came about because of a DEOW
public String
public List<ISourceLocation>
getExtraSourceLocations()

Implements org.aspectj.bridge.IMessage.getExtraSourceLocations.

Return a List of ISourceLocation instances that indicate additional source locations relevent to this message as specified by the message creator.
public int
getID()

Implements org.aspectj.bridge.IMessage.getID.

Return the ID of the message where applicable, see IProblem for list of valid IDs
public IMessage.Kind

Returns:

the kind of this message
getKind
()

Implements org.aspectj.bridge.IMessage.getKind.

public final String

Returns:

non-null String with simple message
getMessage
()

Implements org.aspectj.bridge.IMessage.getMessage.

public int
getSourceEnd()

Implements org.aspectj.bridge.IMessage.getSourceEnd.

Return the end position of the problem (inclusive), or -1 if unknown.
public final ISourceLocation

Returns:

ISourceLocation associated with this message, or null if none
getSourceLocation
()

Implements org.aspectj.bridge.IMessage.getSourceLocation.

public int
getSourceStart()

Implements org.aspectj.bridge.IMessage.getSourceStart.

Return the start position of the problem (inclusive), or -1 if unknown.
public final Throwable

Returns:

Throwable associated with this message, or null if none
getThrown
()

Implements org.aspectj.bridge.IMessage.getThrown.

public boolean

Returns:

true if kind == IMessage.ABORT
isAbort
()

Implements org.aspectj.bridge.IMessage.isAbort.

public boolean

Returns:

true if kind == IMessage.DEBUG
isDebug
()

Implements org.aspectj.bridge.IMessage.isDebug.

public boolean

Returns:

true if kind == IMessage.ERROR
isError
()

Implements org.aspectj.bridge.IMessage.isError.

public boolean

Returns:

true if kind == IMessage.FAIL
isFailed
()

Implements org.aspectj.bridge.IMessage.isFailed.

public boolean

Returns:

true if kind == IMessage.INFO
isInfo
()

Implements org.aspectj.bridge.IMessage.isInfo.

public boolean
public boolean

Returns:

true if kind == IMessage.USAGE
isUsage
()

Implements org.aspectj.bridge.IMessage.isUsage.

public boolean

Returns:

true if kind == IMessage.WARNING
isWarning
()

Implements org.aspectj.bridge.IMessage.isWarning.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

declaredback to summary
private final boolean declared
detailsback to summary
private final String details
extraSourceLocationsback to summary
private final List<ISourceLocation> extraSourceLocations
idback to summary
private final int id
kindback to summary
private final IMessage.Kind kind
messageback to summary
private final String message
sourceEndback to summary
private final int sourceEnd
sourceLocationback to summary
private final ISourceLocation sourceLocation
sourceStartback to summary
private final int sourceStart
thrownback to summary
private final Throwable thrown

Constructor Detail

Messageback to summary
public Message(String message, ISourceLocation location, boolean isError)

Create a (compiler) error or warning message

Parameters
message:String

the String used as the underlying message

location:ISourceLocation

the ISourceLocation, if any, associated with this message

isError:boolean

if true, use IMessage.ERROR; else use IMessage.WARNING

Messageback to summary
public Message(String message, ISourceLocation location, boolean isError, ISourceLocation[] extraSourceLocations)
Messageback to summary
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:String

the String used as the underlying message

details:String

descriptive information about the message

kind:IMessage.Kind

the IMessage.Kind of message - not null

sourceLocation:ISourceLocation

the ISourceLocation, if any, associated with this message

thrown:Throwable

the Throwable, if any, associated with this message

Exceptions
IllegalArgumentException:
if message is null and thrown is null or has a null message, or if kind is null and thrown is null.
Messageback to summary
public Message(String message, String details, IMessage.Kind kind, ISourceLocation sLoc, Throwable thrown, ISourceLocation[] otherLocs, boolean declared, int id, int sourcestart, int sourceend)
Messageback to summary
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:String

the String used as the underlying message

kind:IMessage.Kind

the IMessage.Kind of message - not null

thrown:Throwable

the Throwable, if any, associated with this message

sourceLocation:ISourceLocation

the ISourceLocation, if any, associated with this message

Exceptions
IllegalArgumentException:
if message is null and thrown is null or has a null message, or if kind is null and thrown is null.

Method Detail

getDeclaredback to summary
public boolean getDeclared()

Implements org.aspectj.bridge.IMessage.getDeclared.

Caller can verify if this message came about because of a DEOW

getDetailsback to summary
public String getDetails()

Implements org.aspectj.bridge.IMessage.getDetails.

Returns:String

Doc from org.aspectj.bridge.IMessage.getDetails.

Detailed information about the message. For example, for declare error/warning messages this returns information about the corresponding join point's static part.

getExtraSourceLocationsback to summary
public List<ISourceLocation> getExtraSourceLocations()

Implements org.aspectj.bridge.IMessage.getExtraSourceLocations.

Doc from org.aspectj.bridge.IMessage.getExtraSourceLocations.

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.

Returns:List<ISourceLocation>

a list of additional source locations

getIDback to summary
public int getID()

Implements org.aspectj.bridge.IMessage.getID.

Doc from org.aspectj.bridge.IMessage.getID.

Return the ID of the message where applicable, see IProblem for list of valid IDs

getKindback to summary
public IMessage.Kind getKind()

Implements org.aspectj.bridge.IMessage.getKind.

Returns:IMessage.Kind

the kind of this message

getMessageback to summary
public final String getMessage()

Implements org.aspectj.bridge.IMessage.getMessage.

Returns:String

non-null String with simple message

getSourceEndback to summary
public int getSourceEnd()

Implements org.aspectj.bridge.IMessage.getSourceEnd.

Doc from org.aspectj.bridge.IMessage.getSourceEnd.

Return the end position of the problem (inclusive), or -1 if unknown.

getSourceLocationback to summary
public final ISourceLocation getSourceLocation()

Implements org.aspectj.bridge.IMessage.getSourceLocation.

Returns:ISourceLocation

ISourceLocation associated with this message, or null if none

getSourceStartback to summary
public int getSourceStart()

Implements org.aspectj.bridge.IMessage.getSourceStart.

Doc from org.aspectj.bridge.IMessage.getSourceStart.

Return the start position of the problem (inclusive), or -1 if unknown.

getThrownback to summary
public final Throwable getThrown()

Implements org.aspectj.bridge.IMessage.getThrown.

Returns:Throwable

Throwable associated with this message, or null if none

isAbortback to summary
public boolean isAbort()

Implements org.aspectj.bridge.IMessage.isAbort.

Returns:boolean

true if kind == IMessage.ABORT

isDebugback to summary
public boolean isDebug()

Implements org.aspectj.bridge.IMessage.isDebug.

Returns:boolean

true if kind == IMessage.DEBUG

isErrorback to summary
public boolean isError()

Implements org.aspectj.bridge.IMessage.isError.

Returns:boolean

true if kind == IMessage.ERROR

isFailedback to summary
public boolean isFailed()

Implements org.aspectj.bridge.IMessage.isFailed.

Returns:boolean

true if kind == IMessage.FAIL

isInfoback to summary
public boolean isInfo()

Implements org.aspectj.bridge.IMessage.isInfo.

Returns:boolean

true if kind == IMessage.INFO

isTaskTagback to summary
public boolean isTaskTag()

Implements org.aspectj.bridge.IMessage.isTaskTag.

Returns:boolean

Doc from org.aspectj.bridge.IMessage.isTaskTag.

true if this is a task tag message

isUsageback to summary
public boolean isUsage()

Implements org.aspectj.bridge.IMessage.isUsage.

Returns:boolean

true if kind == IMessage.USAGE

isWarningback to summary
public boolean isWarning()

Implements org.aspectj.bridge.IMessage.isWarning.

Returns:boolean

true if kind == IMessage.WARNING

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.