org.eclipse.ocl.examples.pivot
Enum ProblemHandler.Severity

java.lang.Object
  extended by java.lang.Enum<ProblemHandler.Severity>
      extended by org.eclipse.ocl.examples.pivot.ProblemHandler.Severity
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ProblemHandler.Severity>
Enclosing interface:
ProblemHandler

public static enum ProblemHandler.Severity
extends java.lang.Enum<ProblemHandler.Severity>

Standard problem severities. The values are defined in increasing order of their severity.

Author:
Christian W. Damus

Enum Constant Summary
CANCEL
          Severity constant indicating a deliberate cancellation of the parsing operation by the user.
ERROR
          Severity constant indicating an error problem that does not prevent the parser from proceeding, but which does indicate an ill-formed construct.
FATAL
          Severity constant indicating an error problem that prevents the parser from continuing to process the remainder of the input.
INFO
          Severity constant indicating an informational message that, really, is not a problem but a hint or suggestion.
OK
          Severity constant indicating absence of any problem.
WARNING
          Severity constant indicating a warning problem.
 
Method Summary
 int getDiagnosticSeverity()
           
 boolean isOK()
          Am I the "OK" severity?
 java.lang.String toString()
           
static ProblemHandler.Severity valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ProblemHandler.Severity[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OK

public static final ProblemHandler.Severity OK
Severity constant indicating absence of any problem. Corresponds to the EMF Diagnostic severity Diagnostic.OK and Eclipse IStatus.OK.


INFO

public static final ProblemHandler.Severity INFO
Severity constant indicating an informational message that, really, is not a problem but a hint or suggestion. Corresponds to the EMF Diagnostic severity Diagnostic.INFO and Eclipse IStatus.INFO.


WARNING

public static final ProblemHandler.Severity WARNING
Severity constant indicating a warning problem. Corresponds to the EMF Diagnostic severity Diagnostic.WARNING and Eclipse IStatus.WARNING.


ERROR

public static final ProblemHandler.Severity ERROR
Severity constant indicating an error problem that does not prevent the parser from proceeding, but which does indicate an ill-formed construct. Corresponds to the EMF Diagnostic severity Diagnostic.ERROR and Eclipse IStatus.ERROR.


FATAL

public static final ProblemHandler.Severity FATAL
Severity constant indicating an error problem that prevents the parser from continuing to process the remainder of the input. Corresponds to the EMF Diagnostic severity Diagnostic.ERROR and Eclipse IStatus.ERROR, because these frameworks do not distinguish between fatal and non-fatal conditions.


CANCEL

public static final ProblemHandler.Severity CANCEL
Severity constant indicating a deliberate cancellation of the parsing operation by the user. Corresponds to the EMF Diagnostic severity Diagnostic.CANCEL and Eclipse IStatus.CANCEL. Cancellation in both of these frameworks, and in OCL, does not actually indicate an error condition despite its having the highest value. However, an operation that was canceled is incomplete and any results produced are necessarily invalid as in the case of FATAL errors.

Method Detail

values

public static ProblemHandler.Severity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ProblemHandler.Severity c : ProblemHandler.Severity.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ProblemHandler.Severity valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getDiagnosticSeverity

public int getDiagnosticSeverity()

isOK

public boolean isOK()
Am I the "OK" severity?

Returns:
whether I am OK
See Also:
OK

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<ProblemHandler.Severity>