Top Description Fields Constructors Methods
org.codehaus.groovy.control.messages

public Class WarningMessage

extends LocatedMessage
Class Inheritance
Imports
org.codehaus.groovy.control.Janitor, .SourceUnit, org.codehaus.groovy.syntax.CSTNode, java.io.PrintWriter

A class for warning messages.

Field Summary

Modifier and TypeField and Description
private final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
WarningMessage(int
the warning level
importance
,
String
the message text
message
,
CSTNode
context information for locating the offending source text
context
,
SourceUnit owner)

Creates a new warning message.

public
WarningMessage(int
the warning level
importance
,
String
the message text
message
,
Object
additional data needed when generating the message
data
,
CSTNode
context information for locating the offending source text
context
,
SourceUnit owner)

Creates a new warning message.

Method Summary

Modifier and TypeMethod and Description
public static boolean
isRelevant(int actual, int limit)

Returns true if a warning would be relevant to the specified level.

public boolean
isRelevant(int importance)

Returns true if this message is as or more important than the specified importance level.

public void
write(PrintWriter writer, Janitor janitor)

Overrides org.codehaus.groovy.control.messages.LocatedMessage.write.

Writes the message to the specified PrintWriter.
Inherited from org.codehaus.groovy.control.messages.LocatedMessage:
getContext

Field Detail

importanceback to summary
private final int importance
LIKELY_ERRORSback to summary
public static final int LIKELY_ERRORS
NONEback to summary
public static final int NONE
PARANOIAback to summary
public static final int PARANOIA
POSSIBLE_ERRORSback to summary
public static final int POSSIBLE_ERRORS

Constructor Detail

WarningMessageback to summary
public WarningMessage(int importance, String message, CSTNode context, SourceUnit owner)

Creates a new warning message.

Parameters
importance:int

the warning level

message:String

the message text

context:CSTNode

context information for locating the offending source text

WarningMessageback to summary
public WarningMessage(int importance, String message, Object data, CSTNode context, SourceUnit owner)

Creates a new warning message.

Parameters
importance:int

the warning level

message:String

the message text

data:Object

additional data needed when generating the message

context:CSTNode

context information for locating the offending source text

Method Detail

isRelevantback to summary
public static boolean isRelevant(int actual, int limit)

Returns true if a warning would be relevant to the specified level.

isRelevantback to summary
public boolean isRelevant(int importance)

Returns true if this message is as or more important than the specified importance level.

writeback to summary
public void write(PrintWriter writer, Janitor janitor)

Overrides org.codehaus.groovy.control.messages.LocatedMessage.write.

Doc from org.codehaus.groovy.control.messages.Message.write.

Writes the message to the specified PrintWriter. The supplied ProcessingUnit is the unit that holds this Message.