org.eclipse.xsd.XSDDiagnosticSeverity Maven / Gradle / Ivy
/**
* Copyright (c) 2002-2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* IBM - Initial API and implementation
*/
package org.eclipse.xsd;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
/**
*
* A representation of the literals of the enumeration 'Diagnostic Severity'.
* @see org.eclipse.xsd.XSDDiagnostic#getSeverity()
* @
* @see org.eclipse.xsd.XSDPackage#getXSDDiagnosticSeverity()
* @model
* @generated
*/
public enum XSDDiagnosticSeverity implements Enumerator
{
/**
* The 'Fatal' literal object.
*
*
*
*
* @see #FATAL
* @generated
* @ordered
*/
FATAL_LITERAL(0, "fatal", "fatal"),
/**
* The 'Error' literal object.
*
*
*
*
* @see #ERROR
* @generated
* @ordered
*/
ERROR_LITERAL(1, "error", "error"),
/**
* The 'Warning' literal object.
*
*
*
*
* @see #WARNING
* @generated
* @ordered
*/
WARNING_LITERAL(2, "warning", "warning"),
/**
* The 'Information' literal object.
*
*
*
*
* @see #INFORMATION
* @generated
* @ordered
*/
INFORMATION_LITERAL(3, "information", "information");
/**
* The 'Fatal' literal value.
*
*
* This is used to indicate that the problem is really bad and that further processing is likely not possible.
*
*
* @see #FATAL_LITERAL
* @model name="fatal"
* @generated
* @ordered
*/
public static final int FATAL = 0;
/**
* The 'Error' literal value.
*
*
* This is used to indicate that the problem is bad and that the schema is likely not suitable for use.
*
*
* @see #ERROR_LITERAL
* @model name="error"
* @generated
* @ordered
*/
public static final int ERROR = 1;
/**
* The 'Warning' literal value.
*
*
* This is used to indicate that the problem is not too bad and that the schema is likely suitable for use.
*
*
* @see #WARNING_LITERAL
* @model name="warning"
* @generated
* @ordered
*/
public static final int WARNING = 2;
/**
* The 'Information' literal value.
*
*
* This is used to indicate that the problem is only potential and that the schema is very likely suitable for use.
*
*
* @see #INFORMATION_LITERAL
* @model name="information"
* @generated
* @ordered
*/
public static final int INFORMATION = 3;
/**
* An array of all the 'Diagnostic Severity' enumerators.
*
*
* @generated
*/
private static final XSDDiagnosticSeverity[] VALUES_ARRAY =
new XSDDiagnosticSeverity[]
{
FATAL_LITERAL,
ERROR_LITERAL,
WARNING_LITERAL,
INFORMATION_LITERAL,
};
/**
* A public read-only list of all the 'Diagnostic Severity' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Diagnostic Severity' literal with the specified literal value.
*
*
* @param literal the literal.
* @return the matching enumerator or null
.
* @generated
*/
public static XSDDiagnosticSeverity get(String literal)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
XSDDiagnosticSeverity result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
}
/**
* Returns the 'Diagnostic Severity' literal with the specified name.
*
*
* @param name the name.
* @return the matching enumerator or null
.
* @generated
*/
public static XSDDiagnosticSeverity getByName(String name)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
XSDDiagnosticSeverity result = VALUES_ARRAY[i];
if (result.getName().equals(name))
{
return result;
}
}
return null;
}
/**
* Returns the 'Diagnostic Severity' literal with the specified integer value.
*
*
* @param value the integer value.
* @return the matching enumerator or null
.
* @generated
*/
public static XSDDiagnosticSeverity get(int value)
{
switch (value)
{
case FATAL: return FATAL_LITERAL;
case ERROR: return ERROR_LITERAL;
case WARNING: return WARNING_LITERAL;
case INFORMATION: return INFORMATION_LITERAL;
}
return null;
}
/**
*
*
* @generated
*/
private final int value;
/**
*
*
* @generated
*/
private final String name;
/**
*
*
* @generated
*/
private final String literal;
/**
* Only this class can construct instances.
*
*
* @generated
*/
private XSDDiagnosticSeverity(int value, String name, String literal)
{
this.value = value;
this.name = name;
this.literal = literal;
}
/**
*
*
* @generated
*/
@Override
public int getValue()
{
return value;
}
/**
*
*
* @generated
*/
@Override
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
@Override
public String getLiteral()
{
return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
*
*
* @generated
*/
@Override
public String toString()
{
return literal;
}
}