Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.6
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.control.messages
[Java] 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

    public class WarningMessage
    extends LocatedMessage

A class for warning messages.

Authors:
  Chris Poirier

Version:
  \$Id: WarningMessage.java 6778 2007-07-02 10:40:33Z glaforge \$

Field Summary
`static int` | `LIKELY_ERRORS`
`static int` | `NONE`
`static int` | `PARANOIA`
`static int` | `POSSIBLE_ERRORS`

Fields inherited from class LocatedMessage
context

Fields inherited from class SimpleMessage
data, message, owner

Constructor Summary
`WarningMessage(int importance, String message, CSTNode context, SourceUnit owner)` Creates a new warning message.
`WarningMessage(int importance, String message, Object data, CSTNode context, SourceUnit owner)` Creates a new warning message.

Method Summary
`static boolean` | `isRelevant(int actual, int limit)` Returns true if a warning would be relevant to the specified level.
`boolean` | `isRelevant(int importance)` Returns true if this message is as or more important than the specified importance level.
`void` | `write(PrintWriter writer, Janitor janitor)`

Methods inherited from class LocatedMessage
write

Methods inherited from class SimpleMessage
getMessage, write

Methods inherited from class Message
create, create, create, write, write

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

### LIKELY_ERRORS

    public static final int LIKELY_ERRORS

### NONE

    public static final int NONE

### PARANOIA

    public static final int PARANOIA

### POSSIBLE_ERRORS

    public static final int POSSIBLE_ERRORS

Constructor Detail

### WarningMessage

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

  Creates a new warning message.
  Parameters:
    `importance` - the warning level
    `message` - the message text
    `context` - context information 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 level
    `message` - the message text
    `data` - additional data needed when generating the message
    `context` - context information for locating the offending source text

Method Detail

### 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

    public void write(PrintWriter writer, Janitor janitor)

Copyright © 2003-2010 The Codehaus. All rights reserved.