org.eclipse.ocl.examples.pivot.options
Enum ProblemOption

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

public enum ProblemOption
extends java.lang.Enum<ProblemOption>
implements Option<ProblemHandler.Severity>

Options for problem-reporting in parsing OCL constraints. These options determine the severity of usage of constructs that deviate from the OCL Specification.

Author:
Christian W. Damus (cdamus)

Enum Constant Summary
AMBIGUOUS_ASSOCIATION_ENDS
          Severity of the ambiguity when an unnavigable but named associend has the same name as the implicit name of an unnamed association end.
CLOSURE_ITERATOR
          Severity of using the non-spec closure iterator.
CONCEPTUAL_OPERATION_NAME
          Severity of making use of an operation name conceptually as in 7.4.8 .
ELEMENT_NAME_QUOTE_ESCAPE
          Severity of using the non-spec "..." escape sequence for element names consisting of multiple OCL tokens.
INHERITED_FEATURE_CONTEXT
          Severity of the problem to report when declaring (using the concrete syntax) an operation or property context in a classifier that inherits the feature (rather than declaring a redefinition of the feature as the context).
STRING_CASE_CONVERSION
          Severity of using the non-spec toUpper() and toLower() operations on Strings.
STRING_SINGLE_QUOTE_ESCAPE
          Severity of using the non-spec '' escape sequence for single-quotes in string literals.
 
Method Summary
 ProblemHandler.Severity getDefaultValue()
          Obtains the option's default value.
 java.lang.String getKey()
          Obtains my string key, which may be used for persistence in a preference store.
static ProblemOption valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ProblemOption[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CLOSURE_ITERATOR

public static final ProblemOption CLOSURE_ITERATOR
Severity of using the non-spec closure iterator. The default severity is WARNING.


STRING_CASE_CONVERSION

public static final ProblemOption STRING_CASE_CONVERSION
Severity of using the non-spec toUpper() and toLower() operations on Strings. The default severity is WARNING.


STRING_SINGLE_QUOTE_ESCAPE

public static final ProblemOption STRING_SINGLE_QUOTE_ESCAPE
Severity of using the non-spec '' escape sequence for single-quotes in string literals. The default severity is WARNING.


ELEMENT_NAME_QUOTE_ESCAPE

public static final ProblemOption ELEMENT_NAME_QUOTE_ESCAPE
Severity of using the non-spec "..." escape sequence for element names consisting of multiple OCL tokens. The default severity is WARNING.


AMBIGUOUS_ASSOCIATION_ENDS

public static final ProblemOption AMBIGUOUS_ASSOCIATION_ENDS
Severity of the ambiguity when an unnavigable but named associend has the same name as the implicit name of an unnamed association end. The default severity is ERROR.


INHERITED_FEATURE_CONTEXT

public static final ProblemOption INHERITED_FEATURE_CONTEXT
Severity of the problem to report when declaring (using the concrete syntax) an operation or property context in a classifier that inherits the feature (rather than declaring a redefinition of the feature as the context). This is allowed by the MDT OCL implementation but is not, strictly speaking, well-formed OCL. The default severity is WARNING.


CONCEPTUAL_OPERATION_NAME

public static final ProblemOption CONCEPTUAL_OPERATION_NAME
Severity of making use of an operation name conceptually as in 7.4.8 . The default severity is OK.

Method Detail

values

public static ProblemOption[] 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 (ProblemOption c : ProblemOption.values())
    System.out.println(c);

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

valueOf

public static ProblemOption 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

getKey

public java.lang.String getKey()
Description copied from interface: Option
Obtains my string key, which may be used for persistence in a preference store.

Specified by:
getKey in interface Option<ProblemHandler.Severity>
Returns:
my key. Is never null

getDefaultValue

public ProblemHandler.Severity getDefaultValue()
Description copied from interface: Option
Obtains the option's default value.

Specified by:
getDefaultValue in interface Option<ProblemHandler.Severity>
Returns:
my default value, which default-default is null