All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ocl.options.ProblemOption Maven / Gradle / Ivy

/**
 *  
 *
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   IBM - Initial API and implementation
 *
 * 
 *
 * $Id: ProblemOption.java,v 1.3 2009/11/09 21:57:32 ewillink Exp $
 */
package org.eclipse.ocl.options;

import org.eclipse.ocl.lpg.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)
 */
public enum ProblemOption implements Option {
	/**
	 * Severity of using the non-spec closure iterator.
	 * The default severity is WARNING.
	 */
	CLOSURE_ITERATOR("iterators.closure", Severity.WARNING), //$NON-NLS-1$
	
	/**
	 * Severity of using the non-spec toUpper() and toLower()
	 * operations on Strings.
	 * The default severity is WARNING.
	 */
	STRING_CASE_CONVERSION("string.caseconv", Severity.WARNING), //$NON-NLS-1$
	
	/**
	 * Severity of using the non-spec '' escape sequence for single-quotes
	 * in string literals.
	 * The default severity is WARNING.
	 */
	STRING_SINGLE_QUOTE_ESCAPE("string.escapes.squote", Severity.WARNING), //$NON-NLS-1$
	
	/**
	 * Severity of using the non-spec "..." escape sequence for
	 * element names consisting of multiple OCL tokens.
	 * The default severity is WARNING.
	 */
	ELEMENT_NAME_QUOTE_ESCAPE("string.escapes.element", Severity.WARNING), //$NON-NLS-1$
    
    /**
     * 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.
     */
    AMBIGUOUS_ASSOCIATION_ENDS("ambiguous.association.ends", Severity.ERROR), //$NON-NLS-1$
    
    /**
     * 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.
     */
    INHERITED_FEATURE_CONTEXT("inherited.feature.context", Severity.WARNING), //$NON-NLS-1$
	
	/**
	 * Severity of making use of an operation name conceptually as
	 * in 7.4.8 .
	 * The default severity is OK.
	 * @since 3.0
	 */
	CONCEPTUAL_OPERATION_NAME("conceptual.operation.name", Severity.ERROR); //$NON-NLS-1$
	
	private final String key;
	private final Severity defaultValue;
	
	ProblemOption(String key, Severity defaultValue) {
		this.key = key;
		this.defaultValue = defaultValue;
	}
	
	public String getKey() {
		return key;
	}
	
	public Severity getDefaultValue() {
		return defaultValue;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy