Class WarningMessage
java.lang.Object
org.codehaus.groovy.control.messages.Message
org.codehaus.groovy.control.messages.SimpleMessage
org.codehaus.groovy.control.messages.LocatedMessage
org.codehaus.groovy.control.messages.WarningMessage
A class for warning messages.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Warning indicates likely errorstatic final int
Ignore all (for querying)static final int
Warning indicates paranoia on the part of the compilerstatic final int
Warning indicates possible errorFields inherited from class org.codehaus.groovy.control.messages.SimpleMessage
data, message, owner
-
Constructor Summary
ConstructorDescriptionWarningMessage
(int importance, String message, Object data, CSTNode context, SourceUnit owner) Creates a new warning message.WarningMessage
(int importance, String message, CSTNode context, SourceUnit owner) Creates a new warning message. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isRelevant
(int importance) Returns true if this message is as or more important than the specified importance level.static boolean
isRelevant
(int actual, int limit) Returns true if a warning would be relevant to the specified level.void
write
(PrintWriter writer, Janitor janitor) Writes this message to the specifiedPrintWriter
.Methods inherited from class org.codehaus.groovy.control.messages.LocatedMessage
getContext
Methods inherited from class org.codehaus.groovy.control.messages.SimpleMessage
getMessage
-
Field Details
-
NONE
public static final int NONEIgnore all (for querying)- See Also:
-
LIKELY_ERRORS
public static final int LIKELY_ERRORSWarning indicates likely error- See Also:
-
POSSIBLE_ERRORS
public static final int POSSIBLE_ERRORSWarning indicates possible error- See Also:
-
PARANOIA
public static final int PARANOIAWarning indicates paranoia on the part of the compiler- See Also:
-
-
Constructor Details
-
WarningMessage
Creates a new warning message.- Parameters:
importance
- the warning levelmessage
- the message textcontext
- for locating the offending source text
-
WarningMessage
public WarningMessage(int importance, String message, Object data, CSTNode context, SourceUnit owner) Creates a new warning message.- Parameters:
importance
- the warning levelmessage
- the message textdata
- data needed for generating the messagecontext
- for locating the offending source text
-
-
Method Details
-
isRelevant
public static boolean isRelevant(int actual, int limit) Returns true if a warning would be relevant to the specified level. -
isRelevant
public boolean isRelevant(int importance) Returns true if this message is as or more important than the specified importance level. -
write
Description copied from class:Message
Writes this message to the specifiedPrintWriter
.- Overrides:
write
in classLocatedMessage
-