org.eclipse.emf.ecore.util
Interface ExtendedMetaData

All Known Implementing Classes:
BasicExtendedMetaData

public interface ExtendedMetaData

Interface for accessing and setting extended metadata on Ecore model elements. Such metadata is primarily used to support structures defined in XML schema and to retain additional information that a resource requires to produce conforming serializations. However, non-schema-based models may use this interface to support constructs such as mixed content, repeating model groups, and wildcard features, as well as to customize model serialization.

The extended metadata is stored on an Ecore model element as an annotation with source ANNOTATION_URI. Each piece of information is recorded as a key-value pair of strings in its details map. This interface provides the following utility methods to set and query those annotations:

In additional, a number of convenience lookup methods are provided.

A single instance can be used to handle all related (or unrelated) metadata, as its only state is the package registry from which to obtain metadata, and the demand package registry, which stores demand-created metadata when processing data for which metadata has not already been defined.


Field Summary
static String ANNOTATION_URI
          The URI used as the annotation source: "http:///org/eclipse/emf/ecore/util/ExtendedMetaData".
static int ATTRIBUTE_FEATURE
          The feature kind ID representing an attribute.
static int ATTRIBUTE_WILDCARD_FEATURE
          The feature kind ID representing an anyAttribute wildcard.
static int COLLAPSE_WHITE_SPACE
          The white space kind ID for collapse (all contiguous white space characters to a single space).
static String[] CONTENT_KINDS
          The strings used to represent the various content kinds in extended metadata annotations, indexed by kind ID.
static String[] DERIVATION_KINDS
          The strings used to represent the various derivation kinds , indexed by kind ID.
static int ELEMENT_FEATURE
          The feature kind ID representing an element.
static int ELEMENT_ONLY_CONTENT
          The content kind ID specifying element content.
static int ELEMENT_WILDCARD_FEATURE
          The feature kind ID representing an any element wildcard.
static int EMPTY_CONTENT
          The content kind ID specifying empty content.
static String[] FEATURE_KINDS
          The strings used to represent the various feature kinds in extended metadata annotations, indexed by kind ID.
static int GROUP_FEATURE
          The feature kind ID representing a repeating model group.
static ExtendedMetaData INSTANCE
          The default ExtendedMetaData instance, which obtains packages from the global package registry, EPackage.Registry.INSTANCE.
static int LAX_PROCESSING
          The processing kind ID for lax processing.
static int LIST_DERIVATION
          The derivation kind ID for list.
static int MIXED_CONTENT
          The content kind ID specifying mixed content.
static int PRESERVE_WHITE_SPACE
          The white space kind ID for preserve.
static String[] PROCESSING_KINDS
          The strings used to represent the various processing kinds in extended metadata annotations, indexed by kind ID.
static int REPLACE_WHITE_SPACE
          The white space kind ID for replace (each white space character by a space).
static int RESTRICTION_DERIVATION
          The derivation kind ID for restriction.
static int SIMPLE_CONTENT
          The content kind ID specifying simple content.
static int SIMPLE_FEATURE
          The feature kind ID representing a simple value.
static int SKIP_PROCESSING
          The processing kind ID for skip processing.
static int STRICT_PROCESSING
          The processing kind ID for strict processing.
static int UNION_DERIVATION
          The derivation kind ID for union.
static int UNSPECIFIED_CONTENT
          The content kind ID for an unspecified kind.
static int UNSPECIFIED_DERIVATION
          The derivation kind ID for an unspecified derivation.
static int UNSPECIFIED_FEATURE
          The feature kind ID for an unspecified kind.
static int UNSPECIFIED_PROCESSING
          The processing kind ID for unspecified processing.
static int UNSPECIFIED_WHITE_SPACE
          The white space kind ID for an unspecified kind.
static String[] WHITE_SPACE_KINDS
          The strings used to represent the various white space kinds in extended metadata annotations, indexed by kind ID.
static String XMI_URI
          The XMI namespace URI: "http://www.omg.org/XMI".
static String XML_SCHEMA_URI
          The XML Schema namespace URI: "http://www.w3.org/2001/XMLSchema".
static String XML_URI
          The XML namespace URI: "http://www.w3.org/XML/1998/namespace".
static String XMLNS_PREFIX
          The prefix reserved for XML namespaces: "xmlns".
static String XMLNS_URI
          The namespace URI for XML namespaces: "http://www.w3.org/2000/xmlns/".
static String XSI_PREFIX
          The prefix used for the XML Schema instance namespace.
static String XSI_URI
          The XML Schema instance namespace URI: "http://www.w3.org/2001/XMLSchema-instance".
 
Method Summary
 Collection demandedPackages()
          Returns the instance's collection of demand-created packages.
 EStructuralFeature demandFeature(String namespace, String name, boolean isElement)
          Returns a feature corresponding to a global element or attribute from the namespace-specified package in the demand package registry, creating it, and the package, if necessary.
 EStructuralFeature demandFeature(String namespace, String name, boolean isElement, boolean isReference)
          Returns a feature corresponding to a global element or attribute from the namespace-specified package in the demand package registry, creating it, and the package, if necessary.
 EPackage demandPackage(String namespace)
          Returns a package from the demand package registry, creating it (with a document root class) if necessary.
 EClassifier demandType(String namespace, String name)
          Returns a class from the namespace-specified package in the demand package registry, demand creating it, and the package, if necessary.
 EStructuralFeature getAffiliation(EClass eClass, EStructuralFeature eStructuralFeature)
          Returns a structural feature within the given class that is or is associated with the given structural feature.
 EStructuralFeature getAffiliation(EStructuralFeature eStructuralFeature)
          Returns the substitution group affiliation for the given structural feature, that is, the feature corresponding to the head element of the substitution group to which the element corresponding to the given feature belongs.
 List getAllAttributes(EClass eClass)
          Returns all the structural features of the given class, and its superclasses, corresponding to XML attributes and attribute wildcards.
 List getAllElements(EClass eClass)
          Returns all the structural features of the given class, and its superclasses, corresponding to elements, element wildards, and model groups.
 EStructuralFeature getAttribute(EClass eClass, String namespace, String name)
          Returns a structural feature within a class, corresponding to a local attribute with the given namespace and name, or, failing that, a document root feature corresponding to a global attribute with the given namespace and name that is affiliated with a feature in the class.
 EStructuralFeature getAttribute(String namespace, String name)
          Returns the structural feature with the given XML name that corresponds to a global attribute within the package with the given namespace.
 List getAttributes(EClass eClass)
          Returns the structural features of the given class corresponding to XML attributes and attribute wildcards.
 EStructuralFeature getAttributeWildcardAffiliation(EClass eClass, String namespace, String name)
          Returns a wildcard feature in the given class that allows allows attribute values from the given namespace.
 EDataType getBaseType(EDataType eDataType)
          If a datatype corresponds to simple type that derives from another by restriction, returns the datatype corresponding to the base type.
 int getContentKind(EClass eClass)
          Returns the kind of XML content of the type corresponding to the given class.
 int getDerivationKind(EDataType eDataType)
          Returns the derivation kind of the simple type corresponding to the given datatype.
 EClass getDocumentRoot(EPackage ePackage)
          Returns the class corresponding to the document root in the given package.
 EStructuralFeature getElement(EClass eClass, String namespace, String name)
          Returns a structural feature within a class, corresponding to a local element with the given namespace and name, or, failing that, a document root feature corresponding to a global element with the given namespace and name that is affiliated with a feature in the class.
 EStructuralFeature getElement(String namespace, String name)
          Returns the structural feature with the given XML name that corresponds to a global element within the package with the given namespace.
 List getElements(EClass eClass)
          Returns the structural features of the given class corresponding to elements, element wildcards, and model groups.
 EStructuralFeature getElementWildcardAffiliation(EClass eClass, String namespace, String name)
          Returns a wildcard feature in the given class that allows allows element values from the given namespace.
 List getEnumerationFacet(EDataType eDataType)
          Returns the enumeration constraint on the given datatype.
 int getFeatureKind(EStructuralFeature eStructuralFeature)
          Returns the kind of XML structure that should be used to represent the given structural feature.
 int getFractionDigitsFacet(EDataType eDataType)
          Returns the fraction digits constraint on the given datatype.
 EStructuralFeature getGroup(EStructuralFeature eStructuralFeature)
          Returns the feature respresenting the model group or subtitution group head feature to which the implementation of the given feature is delegated.
 EDataType getItemType(EDataType eDataType)
          If a datatype corresponds to a list type, returns the datatype corresponding to its item type.
 int getLengthFacet(EDataType eDataType)
          Returns the length constraint on the given datatype.
 String getMaxExclusiveFacet(EDataType eDataType)
          Returns the maximum (exclusive) constraint on the given datatype.
 String getMaxInclusiveFacet(EDataType eDataType)
          Returns the maximum (inclusive) constraint on the given datatype.
 int getMaxLengthFacet(EDataType eDataType)
          Returns the maximum length constraint on the given datatype.
 List getMemberTypes(EDataType eDataType)
          If a datatype corresponds to a union type, returns the datatypes corresponding to its member types.
 String getMinExclusiveFacet(EDataType eDataType)
          Returns the minimum (exclusive) constraint on the given datatype.
 String getMinInclusiveFacet(EDataType eDataType)
          Returns the minimum (inclusive) constraint on the given datatype.
 int getMinLengthFacet(EDataType eDataType)
          Returns the minumum length constraint on the given datatype.
 EAttribute getMixedFeature(EClass eClass)
          If the given class represents mixed content, returns the wildcard element feature used to store its content.
 String getName(EClassifier eClassifier)
          Returns the XML name for a classifier.
 String getName(EStructuralFeature eStructuralFeature)
          Returns the XML name for a structural feature.
 String getNamespace(EClassifier eClassifier)
          Returns the namespace to use for instances of the given classifier, the same namespace as for the package that contains it.
 String getNamespace(EPackage ePackage)
          Returns the namespace to use for model instance serializations of the specified package.
 String getNamespace(EStructuralFeature eStructuralFeature)
          Returns the namespace associated with the specified structural feature.
 EPackage getPackage(String namespace)
          Retrieves the package with the specified namespace URI from the package registry associated with this instance.
 List getPatternFacet(EDataType eDataType)
          Returns the pattern constraint on the given datatype.
 int getProcessingKind(EStructuralFeature eStructuralFeature)
          Returns the kind of contents processing to be used for a structural feature corresponding to an any wildcard.
 EStructuralFeature getSimpleFeature(EClass eClass)
          If the given class represents simple content, returns the simple feature used to store its content.
 int getTotalDigitsFacet(EDataType eDataType)
          Returns the total digits constraint on the given datatype.
 EClassifier getType(EPackage ePackage, String name)
          Returns the classifier with the given XML name within the given package.
 EClassifier getType(String namespace, String name)
          Returns the classifier with the given XML name within the package with the given namespace.
 int getWhiteSpaceFacet(EDataType eDataType)
          Returns the white space constraint on the given datatype.
 List getWildcards(EStructuralFeature eStructuralFeature)
          Returns the allowable namespace patterns for a structural feature corresponding to an any or anyAttribute wildcard.
 EReference getXMLNSPrefixMapFeature(EClass eClass)
          If the given class has mixed content type, returns the "xmlns:prefix" feature, which is used to store namespace prefix-to-URI mappings.
 EReference getXSISchemaLocationMapFeature(EClass eClass)
          If the given class has mixed content type, returns the "xsi:schemaLocation" feature, which is used to store namespace URI-schema location pairs.
 boolean isAnonymous(EClassifier eClassifier)
          Returns whether the given classifier's XML name contains "_._", which is used to indicate an anonymous type declaration.
 boolean isQualified(EPackage ePackage)
          Returns whether model instance serializations of the specified package should use namespace qualification.
 boolean matches(List wildcards, String namespace)
          Tests whether any of a list of wildcards matches a given namespace.
 boolean matches(String wildcard, String namespace)
          Tests whether a wildcard matches a given namesapce.
 void putPackage(String namespace, EPackage ePackage)
          Adds the package to the package registry associated with this instance, keyed by the given namespace URI.
 void setAffiliation(EStructuralFeature eStructuralFeature, EStructuralFeature affiliation)
          Sets the substitution group affiliation for the given structural feature.
 void setBaseType(EDataType eDataType, EDataType baseType)
          Sets the base type for a datatype, indicating that the datatype corresponds to a simple type that derives from another by restriction.
 void setContentKind(EClass eClass, int kind)
          Sets the kind of XML content of the type corresponding to the given class.
 void setDocumentRoot(EClass eClass)
          Sets the specified class to be a document root.
 void setEnumerationFacet(EDataType eDataType, List literals)
          Sets the enumeration constraint on the given datatype.
 void setFeatureKind(EStructuralFeature eStructuralFeature, int kind)
          Sets the kind of XML structure that should be used to represent the given structural feature.
 void setFractionDigitsFacet(EDataType eDataType, int digits)
          Sets the fraction digits constraint on the given datatype.
 void setGroup(EStructuralFeature eStructuralFeature, EStructuralFeature group)
          Sets a group or substitution group head feature, to which the implementation of the given feature should be delegated.
 void setItemType(EDataType eDataType, EDataType itemType)
          Sets the item type for a datatype, indicating that the datatype corresponds to a list type.
 void setLengthFacet(EDataType eDataType, int length)
          Sets the length constraint on the given datatype.
 void setMaxExclusiveFacet(EDataType eDataType, String literal)
          Sets the maximum (exclusive) constraint on the given datatype.
 void setMaxInclusiveFacet(EDataType eDataType, String literal)
          Sets the maximum (inclusive) constraint on the given datatype.
 void setMaxLengthFacet(EDataType eDataType, int length)
          Sets the maximum length constraint on the given datatype.
 void setMemberTypes(EDataType eDataType, List memberTypes)
          Sets the member types for a datatype, indicating that the datatype corresponds to a union type.
 void setMinExclusiveFacet(EDataType eDataType, String literal)
          Sets the minimum (exclusive) constraint on the given datatype.
 void setMinInclusiveFacet(EDataType eDataType, String literal)
          Sets the minimum (inclusive) constraint on the given datatype.
 void setMinLengthFacet(EDataType eDataType, int length)
          Sets the minimum length constraint on the given datatype.
 void setName(EClassifier eClassifier, String name)
          Sets the XML name for a classifier.
 void setName(EStructuralFeature eStructuralFeature, String name)
          Set the XML name for a structural feature.
 void setNamespace(EStructuralFeature eStructuralFeature, String namespace)
          Sets the namespace associated with the specified structural feature.
 void setPatternFacet(EDataType eDataType, List pattern)
          Sets the pattern constraint on the given datatype.
 void setProcessingKind(EStructuralFeature eStructuralFeature, int processingKind)
          Sets the kind of contents processing to be used for a structural feature corresponding to an any wildcard.
 void setQualified(EPackage ePackage, boolean isQualified)
          Sets whether model instance serializations of the specified package should use namespace qualification.
 void setTotalDigitsFacet(EDataType eDataType, int digits)
          Sets the total digits constraint on the given datatype.
 void setWhiteSpaceFacet(EDataType eDataType, int whiteSpace)
          Sets the white space constraint on the given datatype.
 void setWildcards(EStructuralFeature eStructuralFeature, List wildcards)
          Sets the allowable namespace patterns for a structural feature corresponding to an any or anyAttribute wildcard.
 

Field Detail

ANNOTATION_URI

public static final String ANNOTATION_URI
The URI used as the annotation source: "http:///org/eclipse/emf/ecore/util/ExtendedMetaData".

See Also:
Constant Field Values

XMLNS_URI

public static final String XMLNS_URI
The namespace URI for XML namespaces: "http://www.w3.org/2000/xmlns/".

See Also:
Constant Field Values

XML_URI

public static final String XML_URI
The XML namespace URI: "http://www.w3.org/XML/1998/namespace".

See Also:
Constant Field Values

XSI_URI

public static final String XSI_URI
The XML Schema instance namespace URI: "http://www.w3.org/2001/XMLSchema-instance".

See Also:
Constant Field Values

XML_SCHEMA_URI

public static final String XML_SCHEMA_URI
The XML Schema namespace URI: "http://www.w3.org/2001/XMLSchema".

See Also:
Constant Field Values

XMI_URI

public static final String XMI_URI
The XMI namespace URI: "http://www.omg.org/XMI".

See Also:
Constant Field Values

XMLNS_PREFIX

public static final String XMLNS_PREFIX
The prefix reserved for XML namespaces: "xmlns".

See Also:
Constant Field Values

XSI_PREFIX

public static final String XSI_PREFIX
The prefix used for the XML Schema instance namespace.

See Also:
Constant Field Values

UNSPECIFIED_FEATURE

public static final int UNSPECIFIED_FEATURE
The feature kind ID for an unspecified kind.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

SIMPLE_FEATURE

public static final int SIMPLE_FEATURE
The feature kind ID representing a simple value.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

ATTRIBUTE_FEATURE

public static final int ATTRIBUTE_FEATURE
The feature kind ID representing an attribute.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

ATTRIBUTE_WILDCARD_FEATURE

public static final int ATTRIBUTE_WILDCARD_FEATURE
The feature kind ID representing an anyAttribute wildcard.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

ELEMENT_FEATURE

public static final int ELEMENT_FEATURE
The feature kind ID representing an element.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

ELEMENT_WILDCARD_FEATURE

public static final int ELEMENT_WILDCARD_FEATURE
The feature kind ID representing an any element wildcard.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

GROUP_FEATURE

public static final int GROUP_FEATURE
The feature kind ID representing a repeating model group.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

FEATURE_KINDS

public static final String[] FEATURE_KINDS
The strings used to represent the various feature kinds in extended metadata annotations, indexed by kind ID.

See Also:
getFeatureKind(org.eclipse.emf.ecore.EStructuralFeature), setFeatureKind(org.eclipse.emf.ecore.EStructuralFeature, int)

UNSPECIFIED_CONTENT

public static final int UNSPECIFIED_CONTENT
The content kind ID for an unspecified kind.

See Also:
getContentKind(org.eclipse.emf.ecore.EClass), setContentKind(org.eclipse.emf.ecore.EClass, int), Constant Field Values

EMPTY_CONTENT

public static final int EMPTY_CONTENT
The content kind ID specifying empty content.

See Also:
getContentKind(org.eclipse.emf.ecore.EClass), setContentKind(org.eclipse.emf.ecore.EClass, int), Constant Field Values

SIMPLE_CONTENT

public static final int SIMPLE_CONTENT
The content kind ID specifying simple content.

See Also:
getContentKind(org.eclipse.emf.ecore.EClass), setContentKind(org.eclipse.emf.ecore.EClass, int), Constant Field Values

MIXED_CONTENT

public static final int MIXED_CONTENT
The content kind ID specifying mixed content.

See Also:
getContentKind(org.eclipse.emf.ecore.EClass), setContentKind(org.eclipse.emf.ecore.EClass, int), Constant Field Values

ELEMENT_ONLY_CONTENT

public static final int ELEMENT_ONLY_CONTENT
The content kind ID specifying element content.

See Also:
getContentKind(org.eclipse.emf.ecore.EClass), setContentKind(org.eclipse.emf.ecore.EClass, int), Constant Field Values

CONTENT_KINDS

public static final String[] CONTENT_KINDS
The strings used to represent the various content kinds in extended metadata annotations, indexed by kind ID.

See Also:
getContentKind(org.eclipse.emf.ecore.EClass), setContentKind(org.eclipse.emf.ecore.EClass, int)

UNSPECIFIED_DERIVATION

public static final int UNSPECIFIED_DERIVATION
The derivation kind ID for an unspecified derivation.

See Also:
getDerivationKind(org.eclipse.emf.ecore.EDataType), Constant Field Values

RESTRICTION_DERIVATION

public static final int RESTRICTION_DERIVATION
The derivation kind ID for restriction.

See Also:
getDerivationKind(org.eclipse.emf.ecore.EDataType), Constant Field Values

LIST_DERIVATION

public static final int LIST_DERIVATION
The derivation kind ID for list.

See Also:
getDerivationKind(org.eclipse.emf.ecore.EDataType), Constant Field Values

UNION_DERIVATION

public static final int UNION_DERIVATION
The derivation kind ID for union.

See Also:
getDerivationKind(org.eclipse.emf.ecore.EDataType), Constant Field Values

DERIVATION_KINDS

public static final String[] DERIVATION_KINDS
The strings used to represent the various derivation kinds , indexed by kind ID.

See Also:
getDerivationKind(org.eclipse.emf.ecore.EDataType)

UNSPECIFIED_PROCESSING

public static final int UNSPECIFIED_PROCESSING
The processing kind ID for unspecified processing.

See Also:
getProcessingKind(org.eclipse.emf.ecore.EStructuralFeature), setProcessingKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

STRICT_PROCESSING

public static final int STRICT_PROCESSING
The processing kind ID for strict processing. This requires that metadata be available in order to parse content.

See Also:
getProcessingKind(org.eclipse.emf.ecore.EStructuralFeature), setProcessingKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

LAX_PROCESSING

public static final int LAX_PROCESSING
The processing kind ID for lax processing.

See Also:
getProcessingKind(org.eclipse.emf.ecore.EStructuralFeature), setProcessingKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

SKIP_PROCESSING

public static final int SKIP_PROCESSING
The processing kind ID for skip processing.

See Also:
getProcessingKind(org.eclipse.emf.ecore.EStructuralFeature), setProcessingKind(org.eclipse.emf.ecore.EStructuralFeature, int), Constant Field Values

PROCESSING_KINDS

public static final String[] PROCESSING_KINDS
The strings used to represent the various processing kinds in extended metadata annotations, indexed by kind ID.

See Also:
getProcessingKind(org.eclipse.emf.ecore.EStructuralFeature), setProcessingKind(org.eclipse.emf.ecore.EStructuralFeature, int)

UNSPECIFIED_WHITE_SPACE

public static final int UNSPECIFIED_WHITE_SPACE
The white space kind ID for an unspecified kind.

See Also:
getWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType), setWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType, int), Constant Field Values

PRESERVE_WHITE_SPACE

public static final int PRESERVE_WHITE_SPACE
The white space kind ID for preserve.

See Also:
getWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType), setWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType, int), Constant Field Values

REPLACE_WHITE_SPACE

public static final int REPLACE_WHITE_SPACE
The white space kind ID for replace (each white space character by a space).

See Also:
getWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType), setWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType, int), Constant Field Values

COLLAPSE_WHITE_SPACE

public static final int COLLAPSE_WHITE_SPACE
The white space kind ID for collapse (all contiguous white space characters to a single space).

See Also:
getWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType), setWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType, int), Constant Field Values

WHITE_SPACE_KINDS

public static final String[] WHITE_SPACE_KINDS
The strings used to represent the various white space kinds in extended metadata annotations, indexed by kind ID.

See Also:
getWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType), setWhiteSpaceFacet(org.eclipse.emf.ecore.EDataType, int)

INSTANCE

public static final ExtendedMetaData INSTANCE
The default ExtendedMetaData instance, which obtains packages from the global package registry, EPackage.Registry.INSTANCE.

Method Detail

getPackage

public EPackage getPackage(String namespace)
Retrieves the package with the specified namespace URI from the package registry associated with this instance.


putPackage

public void putPackage(String namespace,
                       EPackage ePackage)
Adds the package to the package registry associated with this instance, keyed by the given namespace URI.


getDocumentRoot

public EClass getDocumentRoot(EPackage ePackage)
Returns the class corresponding to the document root in the given package. The document root class holds attributes and references corresponding to attributes and elements declared globally in a schema. It is identified by its XML name, an empty string.


setDocumentRoot

public void setDocumentRoot(EClass eClass)
Sets the specified class to be a document root. The document root class holds attributes and references corresponding to attributes and elements declared globally in a schema. Its XML name is set to an empty string, and its content kind to mixed content.


getXMLNSPrefixMapFeature

public EReference getXMLNSPrefixMapFeature(EClass eClass)
If the given class has mixed content type, returns the "xmlns:prefix" feature, which is used to store namespace prefix-to-URI mappings.


getXSISchemaLocationMapFeature

public EReference getXSISchemaLocationMapFeature(EClass eClass)
If the given class has mixed content type, returns the "xsi:schemaLocation" feature, which is used to store namespace URI-schema location pairs.


isQualified

public boolean isQualified(EPackage ePackage)
Returns whether model instance serializations of the specified package should use namespace qualification.

details key: "qualified"


setQualified

public void setQualified(EPackage ePackage,
                         boolean isQualified)
Sets whether model instance serializations of the specified package should use namespace qualification.

details key: "qualified"


getNamespace

public String getNamespace(EPackage ePackage)
Returns the namespace to use for model instance serializations of the specified package. If namespace qualification is being used, this is the package's namespace URI; if not, it is simply null.

details key: "namespace"


getNamespace

public String getNamespace(EClassifier eClassifier)
Returns the namespace to use for instances of the given classifier, the same namespace as for the package that contains it.


getNamespace

public String getNamespace(EStructuralFeature eStructuralFeature)
Returns the namespace associated with the specified structural feature. This allows features to be included in a class that correspond to elements and attributes defined in another schema (i.e. an attribute or element reference).


setNamespace

public void setNamespace(EStructuralFeature eStructuralFeature,
                         String namespace)
Sets the namespace associated with the specified structural feature. This allows features to be included in a class that correspond to elements and attributes defined in another schema (i.e. an attribute or element reference).


getName

public String getName(EClassifier eClassifier)
Returns the XML name for a classifier. This is the original name specified for the type in the schema, which may be mapped into a valid and conventional Java class name for the Ecore class.

details key: "name"


setName

public void setName(EClassifier eClassifier,
                    String name)
Sets the XML name for a classifier. This should be the original name specified for the type in the schema, which may be mapped into a valid and conventional Java class name for the Ecore class.

details key: "name"


isAnonymous

public boolean isAnonymous(EClassifier eClassifier)
Returns whether the given classifier's XML name contains "_._", which is used to indicate an anonymous type declaration.


getName

public String getName(EStructuralFeature eStructuralFeature)
Returns the XML name for a structural feature. This is the original name specified for the element or attribute in the schema, which may be mapped into a valid and conventional Java field name for the Ecore strucutral feature. This is also the name which should be used for the element or attribute in instance documents.

details key: "name"


setName

public void setName(EStructuralFeature eStructuralFeature,
                    String name)
Set the XML name for a structural feature. This shoudl be the original name specified for the element or attribute in the schema, which may be mapped into a valid and conventional Java field name for the Ecore strucutral feature. This is also the name which should be used for the element or attribute in instance documents.

details key: "name"


getType

public EClassifier getType(String namespace,
                           String name)
Returns the classifier with the given XML name within the package with the given namespace.


getAttribute

public EStructuralFeature getAttribute(String namespace,
                                       String name)
Returns the structural feature with the given XML name that corresponds to a global attribute within the package with the given namespace.


getElement

public EStructuralFeature getElement(String namespace,
                                     String name)
Returns the structural feature with the given XML name that corresponds to a global element within the package with the given namespace.


getType

public EClassifier getType(EPackage ePackage,
                           String name)
Returns the classifier with the given XML name within the given package.


getAttribute

public EStructuralFeature getAttribute(EClass eClass,
                                       String namespace,
                                       String name)
Returns a structural feature within a class, corresponding to a local attribute with the given namespace and name, or, failing that, a document root feature corresponding to a global attribute with the given namespace and name that is affiliated with a feature in the class.


getElement

public EStructuralFeature getElement(EClass eClass,
                                     String namespace,
                                     String name)
Returns a structural feature within a class, corresponding to a local element with the given namespace and name, or, failing that, a document root feature corresponding to a global element with the given namespace and name that is affiliated with a feature in the class.


getSimpleFeature

public EStructuralFeature getSimpleFeature(EClass eClass)
If the given class represents simple content, returns the simple feature used to store its content.


getMixedFeature

public EAttribute getMixedFeature(EClass eClass)
If the given class represents mixed content, returns the wildcard element feature used to store its content.


getFeatureKind

public int getFeatureKind(EStructuralFeature eStructuralFeature)
Returns the kind of XML structure that should be used to represent the given structural feature.

details key: "kind"

See Also:
UNSPECIFIED_FEATURE, SIMPLE_FEATURE, ATTRIBUTE_FEATURE, ATTRIBUTE_WILDCARD_FEATURE, ELEMENT_FEATURE, ELEMENT_WILDCARD_FEATURE, GROUP_FEATURE

setFeatureKind

public void setFeatureKind(EStructuralFeature eStructuralFeature,
                           int kind)
Sets the kind of XML structure that should be used to represent the given structural feature.

details key: "kind"

See Also:
UNSPECIFIED_FEATURE, SIMPLE_FEATURE, ATTRIBUTE_FEATURE, ATTRIBUTE_WILDCARD_FEATURE, ELEMENT_FEATURE, ELEMENT_WILDCARD_FEATURE, GROUP_FEATURE

getContentKind

public int getContentKind(EClass eClass)
Returns the kind of XML content of the type corresponding to the given class.

details key: "kind"

See Also:
UNSPECIFIED_CONTENT, EMPTY_CONTENT, SIMPLE_CONTENT, MIXED_CONTENT, ELEMENT_ONLY_CONTENT

setContentKind

public void setContentKind(EClass eClass,
                           int kind)
Sets the kind of XML content of the type corresponding to the given class.

details key: "kind"

See Also:
UNSPECIFIED_CONTENT, EMPTY_CONTENT, SIMPLE_CONTENT, MIXED_CONTENT, ELEMENT_ONLY_CONTENT

getDerivationKind

public int getDerivationKind(EDataType eDataType)
Returns the derivation kind of the simple type corresponding to the given datatype.

See Also:
UNSPECIFIED_DERIVATION, RESTRICTION_DERIVATION, LIST_DERIVATION, UNION_DERIVATION

getBaseType

public EDataType getBaseType(EDataType eDataType)
If a datatype corresponds to simple type that derives from another by restriction, returns the datatype corresponding to the base type.

details key: "baseType"


setBaseType

public void setBaseType(EDataType eDataType,
                        EDataType baseType)
Sets the base type for a datatype, indicating that the datatype corresponds to a simple type that derives from another by restriction.

details key: "baseType"


getItemType

public EDataType getItemType(EDataType eDataType)
If a datatype corresponds to a list type, returns the datatype corresponding to its item type.

details key: "itemType"


setItemType

public void setItemType(EDataType eDataType,
                        EDataType itemType)
Sets the item type for a datatype, indicating that the datatype corresponds to a list type.

details key: "itemType"


getMemberTypes

public List getMemberTypes(EDataType eDataType)
If a datatype corresponds to a union type, returns the datatypes corresponding to its member types.

details key: "memberTypes"


setMemberTypes

public void setMemberTypes(EDataType eDataType,
                           List memberTypes)
Sets the member types for a datatype, indicating that the datatype corresponds to a union type.

details key: "memberTypes"


getAllAttributes

public List getAllAttributes(EClass eClass)
Returns all the structural features of the given class, and its superclasses, corresponding to XML attributes and attribute wildcards.


getAllElements

public List getAllElements(EClass eClass)
Returns all the structural features of the given class, and its superclasses, corresponding to elements, element wildards, and model groups.


getAttributes

public List getAttributes(EClass eClass)
Returns the structural features of the given class corresponding to XML attributes and attribute wildcards.


getElements

public List getElements(EClass eClass)
Returns the structural features of the given class corresponding to elements, element wildcards, and model groups.


matches

public boolean matches(List wildcards,
                       String namespace)
Tests whether any of a list of wildcards matches a given namespace.


matches

public boolean matches(String wildcard,
                       String namespace)
Tests whether a wildcard matches a given namesapce.


getWildcards

public List getWildcards(EStructuralFeature eStructuralFeature)
Returns the allowable namespace patterns for a structural feature corresponding to an any or anyAttribute wildcard.

details key: "wildcards"


setWildcards

public void setWildcards(EStructuralFeature eStructuralFeature,
                         List wildcards)
Sets the allowable namespace patterns for a structural feature corresponding to an any or anyAttribute wildcard.

details key: "wildcards"


getProcessingKind

public int getProcessingKind(EStructuralFeature eStructuralFeature)
Returns the kind of contents processing to be used for a structural feature corresponding to an any wildcard.

details key: "processing"

See Also:
UNSPECIFIED_PROCESSING, STRICT_PROCESSING, LAX_PROCESSING, SKIP_PROCESSING

setProcessingKind

public void setProcessingKind(EStructuralFeature eStructuralFeature,
                              int processingKind)
Sets the kind of contents processing to be used for a structural feature corresponding to an any wildcard.

details key: "processing"

See Also:
UNSPECIFIED_PROCESSING, STRICT_PROCESSING, LAX_PROCESSING, SKIP_PROCESSING

getAffiliation

public EStructuralFeature getAffiliation(EStructuralFeature eStructuralFeature)
Returns the substitution group affiliation for the given structural feature, that is, the feature corresponding to the head element of the substitution group to which the element corresponding to the given feature belongs.

details key: "affiliation"


setAffiliation

public void setAffiliation(EStructuralFeature eStructuralFeature,
                           EStructuralFeature affiliation)
Sets the substitution group affiliation for the given structural feature. Both feature and its affiliation feature should be in a document root class, such that they correspond to global structural feature declarations.

details key: "affiliation"


getGroup

public EStructuralFeature getGroup(EStructuralFeature eStructuralFeature)
Returns the feature respresenting the model group or subtitution group head feature to which the implementation of the given feature is delegated.

details key: "group"


setGroup

public void setGroup(EStructuralFeature eStructuralFeature,
                     EStructuralFeature group)
Sets a group or substitution group head feature, to which the implementation of the given feature should be delegated.

details key: "group"


getAffiliation

public EStructuralFeature getAffiliation(EClass eClass,
                                         EStructuralFeature eStructuralFeature)
Returns a structural feature within the given class that is or is associated with the given structural feature. If the feature corresponds to an attribute, it will return the given feature itself, a feature matching the given one in the document root (corresponding to a reference to the global attribute), or a wildcard attribute feature appropriate for the namespace of the given feature. If it corresponds to an element, it will return the feature itself, a feature matching it in the document root or its affiliations (corresponding to a reference to the global element, or its head, or its head's head, etc.), the mixed content feature for an XML type (text, CDATA, or comment), or a wildcard element feature appropriate for the namespace of the given feature.


getAttributeWildcardAffiliation

public EStructuralFeature getAttributeWildcardAffiliation(EClass eClass,
                                                          String namespace,
                                                          String name)
Returns a wildcard feature in the given class that allows allows attribute values from the given namespace.


getElementWildcardAffiliation

public EStructuralFeature getElementWildcardAffiliation(EClass eClass,
                                                        String namespace,
                                                        String name)
Returns a wildcard feature in the given class that allows allows element values from the given namespace.


getWhiteSpaceFacet

public int getWhiteSpaceFacet(EDataType eDataType)
Returns the white space constraint on the given datatype.

details key: "whiteSpace"

See Also:
UNSPECIFIED_WHITE_SPACE, PRESERVE_WHITE_SPACE, REPLACE_WHITE_SPACE, COLLAPSE_WHITE_SPACE

setWhiteSpaceFacet

public void setWhiteSpaceFacet(EDataType eDataType,
                               int whiteSpace)
Sets the white space constraint on the given datatype.

details key: "whiteSpace"

See Also:
UNSPECIFIED_WHITE_SPACE, PRESERVE_WHITE_SPACE, REPLACE_WHITE_SPACE, COLLAPSE_WHITE_SPACE

getEnumerationFacet

public List getEnumerationFacet(EDataType eDataType)
Returns the enumeration constraint on the given datatype.

details key: "enumeration"


setEnumerationFacet

public void setEnumerationFacet(EDataType eDataType,
                                List literals)
Sets the enumeration constraint on the given datatype.

details key: "enumeration"


getPatternFacet

public List getPatternFacet(EDataType eDataType)
Returns the pattern constraint on the given datatype.

details key: "pattern"


setPatternFacet

public void setPatternFacet(EDataType eDataType,
                            List pattern)
Sets the pattern constraint on the given datatype.

details key: "pattern"


getTotalDigitsFacet

public int getTotalDigitsFacet(EDataType eDataType)
Returns the total digits constraint on the given datatype.

details key: "totalDigits"


setTotalDigitsFacet

public void setTotalDigitsFacet(EDataType eDataType,
                                int digits)
Sets the total digits constraint on the given datatype.

details key: "totalDigits"


getFractionDigitsFacet

public int getFractionDigitsFacet(EDataType eDataType)
Returns the fraction digits constraint on the given datatype.

details key: "fractionDigits"


setFractionDigitsFacet

public void setFractionDigitsFacet(EDataType eDataType,
                                   int digits)
Sets the fraction digits constraint on the given datatype.

details key: "fractionDigits"


getLengthFacet

public int getLengthFacet(EDataType eDataType)
Returns the length constraint on the given datatype.

details key: "length"


setLengthFacet

public void setLengthFacet(EDataType eDataType,
                           int length)
Sets the length constraint on the given datatype.

details key: "length"


getMinLengthFacet

public int getMinLengthFacet(EDataType eDataType)
Returns the minumum length constraint on the given datatype.

details key: "minLength"


setMinLengthFacet

public void setMinLengthFacet(EDataType eDataType,
                              int length)
Sets the minimum length constraint on the given datatype.

details key: "minLength"


getMaxLengthFacet

public int getMaxLengthFacet(EDataType eDataType)
Returns the maximum length constraint on the given datatype.

details key: "maxLength"


setMaxLengthFacet

public void setMaxLengthFacet(EDataType eDataType,
                              int length)
Sets the maximum length constraint on the given datatype.

details key: "maxLength"


getMinExclusiveFacet

public String getMinExclusiveFacet(EDataType eDataType)
Returns the minimum (exclusive) constraint on the given datatype.

details key: "minExclusive"


setMinExclusiveFacet

public void setMinExclusiveFacet(EDataType eDataType,
                                 String literal)
Sets the minimum (exclusive) constraint on the given datatype.

details key: "minExclusive"


getMaxExclusiveFacet

public String getMaxExclusiveFacet(EDataType eDataType)
Returns the maximum (exclusive) constraint on the given datatype.

details key: "maxExclusive"


setMaxExclusiveFacet

public void setMaxExclusiveFacet(EDataType eDataType,
                                 String literal)
Sets the maximum (exclusive) constraint on the given datatype.

details key: "maxExclusive"


getMinInclusiveFacet

public String getMinInclusiveFacet(EDataType eDataType)
Returns the minimum (inclusive) constraint on the given datatype.

details key: "minInclusive"


setMinInclusiveFacet

public void setMinInclusiveFacet(EDataType eDataType,
                                 String literal)
Sets the minimum (inclusive) constraint on the given datatype.

details key: "minInclusive"


getMaxInclusiveFacet

public String getMaxInclusiveFacet(EDataType eDataType)
Returns the maximum (inclusive) constraint on the given datatype.

details key: "maxInclusive"


setMaxInclusiveFacet

public void setMaxInclusiveFacet(EDataType eDataType,
                                 String literal)
Sets the maximum (inclusive) constraint on the given datatype.

details key: "maxInclusive"


demandPackage

public EPackage demandPackage(String namespace)
Returns a package from the demand package registry, creating it (with a document root class) if necessary.


demandType

public EClassifier demandType(String namespace,
                              String name)
Returns a class from the namespace-specified package in the demand package registry, demand creating it, and the package, if necessary.


demandFeature

public EStructuralFeature demandFeature(String namespace,
                                        String name,
                                        boolean isElement)
Returns a feature corresponding to a global element or attribute from the namespace-specified package in the demand package registry, creating it, and the package, if necessary. Elements are created as references and attributes as attributes.


demandFeature

public EStructuralFeature demandFeature(String namespace,
                                        String name,
                                        boolean isElement,
                                        boolean isReference)
Returns a feature corresponding to a global element or attribute from the namespace-specified package in the demand package registry, creating it, and the package, if necessary.


demandedPackages

public Collection demandedPackages()
Returns the instance's collection of demand-created packages.


Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.