org.eclipse.ocl.options
Enum ProblemOption

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

public enum ProblemOption
extends 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.


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.
ELEMENT_NAME_QUOTE_ESCAPE
          Severity of using the non-spec "..."
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.
 String getKey()
          Obtains my string key, which may be used for persistence in a preference store.
static ProblemOption valueOf(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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, 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.

Method Detail

values

public static final ProblemOption[] values()
Returns an array containing the constants of this enum type, in the order they're 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're declared

valueOf

public static ProblemOption valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name

getKey

public 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

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.