org.eclipse.xsd.XSDForm 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 'Form'.
* @see org.eclipse.xsd.XSDSchema#getAttributeFormDefault()
* @see org.eclipse.xsd.XSDSchema#getElementFormDefault()
* @see org.eclipse.xsd.XSDFeature#getForm()
* @
* @see org.eclipse.xsd.XSDPackage#getXSDForm()
* @model
* @generated
*/
public enum XSDForm implements Enumerator
{
/**
* The 'Qualified' literal object.
*
*
*
*
* @see #QUALIFIED
* @generated
* @ordered
*/
QUALIFIED_LITERAL(0, "qualified", "qualified"),
/**
* The 'Unqualified' literal object.
*
*
*
*
* @see #UNQUALIFIED
* @generated
* @ordered
*/
UNQUALIFIED_LITERAL(1, "unqualified", "unqualified");
/**
* The 'Qualified' literal value.
*
*
* This is used to indicate that the {@link org.eclipse.xsd.XSDFeature feature} is qualified,
* i.e., the value of the '{@link org.eclipse.xsd.XSDNamedComponent Target Namespace}' attribute
* will be that of the {@link org.eclipse.xsd.XSDSchema#getTargetNamespace() schema}.
*
*
* @see #QUALIFIED_LITERAL
* @model name="qualified"
* @generated
* @ordered
*/
public static final int QUALIFIED = 0;
/**
* The 'Unqualified' literal value.
*
*
* This is used to indicate that the {@link org.eclipse.xsd.XSDFeature feature} is unqualified,
* i.e., the value of the '{@link org.eclipse.xsd.XSDNamedComponent Target Namespace}' attribute
* will be null
.
*
*
* @see #UNQUALIFIED_LITERAL
* @model name="unqualified"
* @generated
* @ordered
*/
public static final int UNQUALIFIED = 1;
/**
* An array of all the 'Form' enumerators.
*
*
* @generated
*/
private static final XSDForm[] VALUES_ARRAY =
new XSDForm[]
{
QUALIFIED_LITERAL,
UNQUALIFIED_LITERAL,
};
/**
* A public read-only list of all the 'Form' enumerators.
*
*
* @generated
*/
public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the 'Form' literal with the specified literal value.
*
*
* @param literal the literal.
* @return the matching enumerator or null
.
* @generated
*/
public static XSDForm get(String literal)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
XSDForm result = VALUES_ARRAY[i];
if (result.toString().equals(literal))
{
return result;
}
}
return null;
}
/**
* Returns the 'Form' literal with the specified name.
*
*
* @param name the name.
* @return the matching enumerator or null
.
* @generated
*/
public static XSDForm getByName(String name)
{
for (int i = 0; i < VALUES_ARRAY.length; ++i)
{
XSDForm result = VALUES_ARRAY[i];
if (result.getName().equals(name))
{
return result;
}
}
return null;
}
/**
* Returns the 'Form' literal with the specified integer value.
*
*
* @param value the integer value.
* @return the matching enumerator or null
.
* @generated
*/
public static XSDForm get(int value)
{
switch (value)
{
case QUALIFIED: return QUALIFIED_LITERAL;
case UNQUALIFIED: return UNQUALIFIED_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 XSDForm(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;
}
}