KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > util > ExtendedMetaData


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2003-2005 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: ExtendedMetaData.java,v 1.9 2005/06/08 06:20:10 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.util;
18
19
20 import java.util.Collection JavaDoc;
21 import java.util.List JavaDoc;
22
23 import org.eclipse.emf.ecore.EAttribute;
24 import org.eclipse.emf.ecore.EClass;
25 import org.eclipse.emf.ecore.EClassifier;
26 import org.eclipse.emf.ecore.EDataType;
27 import org.eclipse.emf.ecore.EPackage;
28 import org.eclipse.emf.ecore.EReference;
29 import org.eclipse.emf.ecore.EStructuralFeature;
30
31
32 /**
33  * Interface for accessing and setting extended metadata on Ecore model elements. Such metadata is primarily used to
34  * support structures defined in XML schema and to retain additional information that a resource requires to produce
35  * conforming serializations. However, non-schema-based models may use this interface to support constructs such as
36  * mixed content, repeating model groups, and wildcard features, as well as to customize model serialization.
37  *
38  * <p>
39  * The extended metadata is stored on an Ecore model element as an annotation with source {@link #ANNOTATION_URI}. Each
40  * piece of information is recorded as a key-value pair of strings in its details map. This interface provides
41  * the following utility methods to set and query those annotations:
42  *
43  * <ul>
44  * <li>{@link #isQualified isQualified}/{@link #setQualified setQualified}</li>
45  * <li>{@link #getNamespace getNamespace}/{@link #setNamespace setNamespace}</li>
46  * <li>{@link #getName(EClassifier) getName}/{@link #setName(EClassifier, String) setName} (classifer)</li>
47  * <li>{@link #getName(EStructuralFeature getName) getName}/{@link #setName(EStructuralFeature, String) setName} (structural feature)</li>
48  * <li>{@link #getFeatureKind getFeatureKind}/{@link #setFeatureKind setFeatureKind}</li>
49  * <li>{@link #getContentKind getContentKind}/{@link #setContentKind setContentKind}</li>
50  * <li>{@link #getBaseType getBaseType}/{@link #setBaseType setBaseType}</li>
51  * <li>{@link #getItemType getItemType}/{@link #setItemType setItemType}</li>
52  * <li>{@link #getMemberTypes getMemberTypes}/{@link #setMemberTypes setMemberTypes}</li>
53  * <li>{@link #getWildcards getWildcards}/{@link #setWildcards setWildcards}</li>
54  * <li>{@link #getProcessingKind getProcessingKind}/{@link #setProcessingKind setProcessingKind}</li>
55  * <li>{@link #getAffiliation(EClass, EStructuralFeature) getAffiliation}/{@link #setAffiliation setAffiliation}</li>
56  * <li>{@link #getGroup getGroup}/{@link #setGroup setGroup}</li>
57  * <li>{@link #getWhiteSpaceFacet getWhiteSpaceFacet}/{@link #setWhiteSpaceFacet setWhiteSpaceFacet}</li>
58  * <li>{@link #getEnumerationFacet getEnumerationFacet}/{@link #setEnumerationFacet setEnumerationFacet}</li>
59  * <li>{@link #getPatternFacet getPatternFacet}/{@link #setPatternFacet setPatternFacet}</li>
60  * <li>{@link #getTotalDigitsFacet getTotalDigitsFacet}/{@link #setTotalDigitsFacet setTotalDigitsFacet}</li>
61  * <li>{@link #getFractionDigitsFacet getFractionDigitsFacet}/{@link #setFractionDigitsFacet setFractionDigitsFacet}</li>
62  * <li>{@link #getLengthFacet getLengthFacet}/{@link #setLengthFacet setLengthFacet}</li>
63  * <li>{@link #getMinLengthFacet getMinLengthFacet}/{@link #setMinLengthFacet setMinLengthFacet}</li>
64  * <li>{@link #getMaxLengthFacet getMaxLengthFacet}/{@link #setMaxLengthFacet setMaxLengthFacet}</li>
65  * <li>{@link #getMinExclusiveFacet getMinExclusiveFacet}/{@link #setMinExclusiveFacet setMinExclusiveFacet}</li>
66  * <li>{@link #getMaxExclusiveFacet getMaxExclusiveFacet}/{@link #setMaxExclusiveFacet setMaxExclusiveFacet}</li>
67  * <li>{@link #getMinInclusiveFacet getMinInclusiveFacet}/{@link #setMinInclusiveFacet setMinInclusiveFacet}</li>
68  * <li>{@link #getMaxInclusiveFacet getMaxInclusiveFacet}/{@link #setMaxInclusiveFacet setMaxInclusiveFacet}</li>
69  * </ul>
70  *
71  * <p>
72  * In additional, a number of convenience lookup methods are provided.
73  *
74  * <p>
75  * A single instance can be used to handle all related (or unrelated) metadata, as its only state is the package
76  * registry from which to obtain metadata, and the demand package registry, which stores demand-created metadata when
77  * processing data for which metadata has not already been defined.
78  */

79 public interface ExtendedMetaData
80 {
81   /**
82    * The URI used as the annotation source: "http:///org/eclipse/emf/ecore/util/ExtendedMetaData".
83    */

84   String JavaDoc ANNOTATION_URI = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
85
86   /**
87    * The namespace URI for XML namespaces: "http://www.w3.org/2000/xmlns/".
88    */

89   String JavaDoc XMLNS_URI = "http://www.w3.org/2000/xmlns/";
90
91   /**
92    * The XML namespace URI: "http://www.w3.org/XML/1998/namespace".
93    */

94   String JavaDoc XML_URI = "http://www.w3.org/XML/1998/namespace";
95
96   /**
97    * The xML Schema instance namespace URI: "http://www.w3.org/2001/XMLSchema-instance".
98    */

99   String JavaDoc XSI_URI = "http://www.w3.org/2001/XMLSchema-instance";
100
101   /**
102    * The XML Schema namespace URI: "http://www.w3.org/2001/XMLSchema".
103    */

104   String JavaDoc XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema";
105
106   /**
107    * The XMI namespace URI: "http://www.omg.org/XMI".
108    */

109   String JavaDoc XMI_URI = "http://www.omg.org/XMI";
110
111   /**
112    * The prefix reserved for XML namespaces: "xmlns".
113    */

114   String JavaDoc XMLNS_PREFIX = "xmlns";
115
116   /**
117    * The prefix used for the XML Schema instance namespace.
118    */

119   String JavaDoc XSI_PREFIX = "xsi";
120
121   /**
122    * Retrieves the package with the specified namespace URI from the package registry associated with this instance.
123    */

124   EPackage getPackage(String JavaDoc namespace);
125
126   /**
127    * Adds the package to the package registry associated with this instance, keyed by the given namespace URI.
128    */

129   void putPackage(String JavaDoc namespace, EPackage ePackage);
130
131   /**
132    * Returns the class corresponding to the document root in the given package. The document root class holds attributes
133    * and references corresponding to attributes and elements declared globally in a schema. It is identified by its
134    * XML name, an empty string.
135    */

136   EClass getDocumentRoot(EPackage ePackage);
137
138   /**
139    * Sets the specified class to be a document root. The document root class holds attributes and references
140    * corresponding to attributes and elements declared globally in a schema. Its XML name is set to an empty string,
141    * and its content kind to mixed content.
142    */

143   void setDocumentRoot(EClass eClass);
144
145   /**
146    * If the given class has mixed content type, returns the "xmlns:prefix" feature, which is used to store namespace
147    * prefix-to-URI mappings.
148    */

149   EReference getXMLNSPrefixMapFeature(EClass eClass);
150
151   /**
152    * If the given class has mixed content type, returns the "xsi:schemaLocation" feature, which is used to store
153    * namespace URI-schema location pairs.
154    */

155   EReference getXSISchemaLocationMapFeature(EClass eClass);
156
157   /**
158    * Returns whether model instance serializations of the specified package should use namespace qualification.
159    * <p>details key: "qualified"
160    */

161   boolean isQualified(EPackage ePackage);
162
163   /**
164    * Sets whether model instance serializations of the specified package should use namespace qualification.
165    * <p>details key: "qualified"
166    */

167   void setQualified(EPackage ePackage, boolean isQualified);
168
169   /**
170    * Returns the namespace to use for model instance serializations of the specified package. If namespace qualification
171    * is being used, this is the package's namespace URI; if not, it is simply null.
172    * <p>details key: "namespace"
173    */

174   String JavaDoc getNamespace(EPackage ePackage);
175
176   /**
177    * Returns the namespace to use for instances of the given classifier, the same namespace as for the package that
178    * contains it.
179    */

180   String JavaDoc getNamespace(EClassifier eClassifier);
181
182   /**
183    * Returns the namespace associated with the specified structural feature. This allows features to be included in a
184    * class that correspond to elements and attributes defined in another schema (i.e. an attribute or element
185    * reference).
186    */

187   String JavaDoc getNamespace(EStructuralFeature eStructuralFeature);
188
189   /**
190    * Sets the namespace associated with the specified structural feature. This allows features to be included in a
191    * class that correspond to elements and attributes defined in another schema (i.e. an attribute or element
192    * reference).
193    */

194   void setNamespace(EStructuralFeature eStructuralFeature, String JavaDoc namespace);
195
196   /**
197    * Returns the XML name for a classifier. This is the original name specified for the type in the schema, which
198    * may be mapped into a valid and conventional Java class name for the Ecore class.
199    * <p>details key: "name"
200    */

201   String JavaDoc getName(EClassifier eClassifier);
202
203   /**
204    * Sets the XML name for a classifier. This should be the original name specified for the type in the schema, which
205    * may be mapped into a valid and conventional Java class name for the Ecore class.
206    * <p>details key: "name"
207    */

208   void setName(EClassifier eClassifier, String JavaDoc name);
209
210   /**
211    * Returns whether the given classifier's XML name contains "_._", which is used to indicate an anonymous type
212    * declaration.
213    */

214   boolean isAnonymous(EClassifier eClassifier);
215
216   /**
217    * Returns the XML name for a structural feature. This is the original name specified for the element or attribute
218    * in the schema, which may be mapped into a valid and conventional Java field name for the Ecore strucutral feature.
219    * This is also the name which should be used for the element or attribute in instance documents.
220    * <p>details key: "name"
221    */

222   String JavaDoc getName(EStructuralFeature eStructuralFeature);
223
224   /**
225    * Set the XML name for a structural feature. This shoudl be the original name specified for the element or attribute
226    * in the schema, which may be mapped into a valid and conventional Java field name for the Ecore strucutral feature.
227    * This is also the name which should be used for the element or attribute in instance documents.
228    * <p>details key: "name"
229    */

230   void setName(EStructuralFeature eStructuralFeature, String JavaDoc name);
231
232   /**
233    * Returns the classifier with the given XML name within the package with the given namespace.
234    */

235   EClassifier getType(String JavaDoc namespace, String JavaDoc name);
236
237   /**
238    * Returns the structural feature with the given XML name that corresponds to a global attribute within the package
239    * with the given namespace.
240    */

241   EStructuralFeature getAttribute(String JavaDoc namespace, String JavaDoc name);
242
243   /**
244    * Returns the structural feature with the given XML name that corresponds to a global element within the package
245    * with the given namespace.
246    */

247   EStructuralFeature getElement(String JavaDoc namespace, String JavaDoc name);
248
249   /**
250    * Returns the classifier with the given XML name within the given package.
251    */

252   EClassifier getType(EPackage ePackage, String JavaDoc name);
253
254   /**
255    * Returns a structural feature within a class, corresponding to a local attribute with the given namespace and name,
256    * or, failing that, a document root feature corresponding to a global attribute with the given namespace and name
257    * that is {@link #getAffiliation(EClass, EStructuralFeature) affiliated} with a feature in the class.
258    */

259   EStructuralFeature getAttribute(EClass eClass, String JavaDoc namespace, String JavaDoc name);
260
261   /**
262    * Returns a structural feature within a class, corresponding to a local element with the given namespace and name,
263    * or, failing that, a document root feature corresponding to a global element with the given namespace and name
264    * that is {@link #getAffiliation(EClass, EStructuralFeature) affiliated} with a feature in the class.
265    */

266   EStructuralFeature getElement(EClass eClass, String JavaDoc namespace, String JavaDoc name);
267
268   /**
269    * If the given class represents simple content, returns the simple feature used to store its content.
270    */

271   EStructuralFeature getSimpleFeature(EClass eClass);
272
273   /**
274    * If the given class represents mixed content, returns the wildcard element feature used to store its content.
275    */

276   EAttribute getMixedFeature(EClass eClass);
277
278   /**
279    * The feature kind ID for an unspecified kind.
280    * @see #getFeatureKind
281    * @see #setFeatureKind
282    */

283   int UNSPECIFIED_FEATURE = 0;
284
285   /**
286    * The feature kind ID representing a simple value.
287    * @see #getFeatureKind
288    * @see #setFeatureKind
289    */

290   int SIMPLE_FEATURE = 1;
291
292   /**
293    * The feature kind ID representing an attribute.
294    * @see #getFeatureKind
295    * @see #setFeatureKind
296    */

297   int ATTRIBUTE_FEATURE = 2;
298
299   /**
300    * The feature kind ID representing an anyAttribute wildcard.
301    * @see #getFeatureKind
302    * @see #setFeatureKind
303    */

304   int ATTRIBUTE_WILDCARD_FEATURE = 3;
305
306   /**
307    * The feature kind ID representing an element.
308    * @see #getFeatureKind
309    * @see #setFeatureKind
310    */

311   int ELEMENT_FEATURE = 4;
312
313   /**
314    * The feature kind ID representing an any element wildcard.
315    * @see #getFeatureKind
316    * @see #setFeatureKind
317    */

318   int ELEMENT_WILDCARD_FEATURE = 5;
319
320   /**
321    * The feature kind ID representing a repeating model group.
322    * @see #getFeatureKind
323    * @see #setFeatureKind
324    */

325   int GROUP_FEATURE = 6;
326
327   /**
328    * The strings used to represent the various feature kinds in extended metadata annotations, indexed by kind ID.
329    * @see #getFeatureKind
330    * @see #setFeatureKind
331    */

332   String JavaDoc [] FEATURE_KINDS = { "unspecified", "simple", "attribute", "attributeWildcard", "element", "elementWildcard", "group" };
333
334   /**
335    * Returns the kind of XML structure that should be used to represent the given structural feature.
336    * <p>details key: "kind"
337    * @see #UNSPECIFIED_FEATURE
338    * @see #SIMPLE_FEATURE
339    * @see #ATTRIBUTE_FEATURE
340    * @see #ATTRIBUTE_WILDCARD_FEATURE
341    * @see #ELEMENT_FEATURE
342    * @see #ELEMENT_WILDCARD_FEATURE
343    * @see #GROUP_FEATURE
344    */

345   int getFeatureKind(EStructuralFeature eStructuralFeature);
346
347   /**
348    * Sets the kind of XML structure that should be used to represent the given structural feature.
349    * <p>details key: "kind"
350    * @see #UNSPECIFIED_FEATURE
351    * @see #SIMPLE_FEATURE
352    * @see #ATTRIBUTE_FEATURE
353    * @see #ATTRIBUTE_WILDCARD_FEATURE
354    * @see #ELEMENT_FEATURE
355    * @see #ELEMENT_WILDCARD_FEATURE
356    * @see #GROUP_FEATURE
357    */

358   void setFeatureKind(EStructuralFeature eStructuralFeature, int kind);
359
360   /**
361    * The content kind ID for an unspecified kind.
362    * @see #getContentKind
363    * @see #setContentKind
364    */

365   int UNSPECIFIED_CONTENT = 0;
366
367   /**
368    * The content kind ID specifying empty content.
369    * @see #getContentKind
370    * @see #setContentKind
371    */

372   int EMPTY_CONTENT = 1;
373
374   /**
375    * The content kind ID specifying simple content.
376    * @see #getContentKind
377    * @see #setContentKind
378    */

379   int SIMPLE_CONTENT = 2;
380
381   /**
382    * The content kind ID specifying mixed content.
383    * @see #getContentKind
384    * @see #setContentKind
385    */

386   int MIXED_CONTENT = 3;
387
388   /**
389    * The content kind ID specifying element content.
390    * @see #getContentKind
391    * @see #setContentKind
392    */

393   int ELEMENT_ONLY_CONTENT = 4;
394
395   /**
396    * The strings used to represent the various content kinds in extended metadata annotations, indexed by kind ID.
397    * @see #getContentKind
398    * @see #setContentKind
399    */

400   String JavaDoc [] CONTENT_KINDS = { "unspecified", "empty", "simple", "mixed", "elementOnly" };
401
402   /**
403    * Returns the kind of XML content of the type corresponding to the given class.
404    * <p>details key: "kind"
405    * @see #UNSPECIFIED_CONTENT
406    * @see #EMPTY_CONTENT
407    * @see #SIMPLE_CONTENT
408    * @see #MIXED_CONTENT
409    * @see #ELEMENT_ONLY_CONTENT
410    */

411   int getContentKind(EClass eClass);
412
413   /**
414    * Sets the kind of XML content of the type corresponding to the given class.
415    * <p>details key: "kind"
416    * @see #UNSPECIFIED_CONTENT
417    * @see #EMPTY_CONTENT
418    * @see #SIMPLE_CONTENT
419    * @see #MIXED_CONTENT
420    * @see #ELEMENT_ONLY_CONTENT
421    */

422   void setContentKind(EClass eClass, int kind);
423
424   /**
425    * The derivation kind ID for an unspecified derivation.
426    * @see #getDerivationKind
427    */

428   int UNSPECIFIED_DERIVATION = 0;
429
430   /**
431    * The derivation kind ID for restriction.
432    * @see #getDerivationKind
433    */

434   int RESTRICTION_DERIVATION = 1;
435
436   /**
437    * The derivation kind ID for list.
438    * @see #getDerivationKind
439    */

440   int LIST_DERIVATION = 2;
441
442   /**
443    * The derivation kind ID for union.
444    * @see #getDerivationKind
445    */

446   int UNION_DERIVATION = 3;
447
448   /**
449    * The strings used to represent the various derivation kinds , indexed by kind ID.
450    * @see #getDerivationKind
451    */

452   String JavaDoc [] DERIVATION_KINDS = { "unspecified", "restriction", "list", "union" };
453
454   /**
455    * Returns the derivation kind of the simple type corresponding to the given datatype.
456    * @see #UNSPECIFIED_DERIVATION
457    * @see #RESTRICTION_DERIVATION
458    * @see #LIST_DERIVATION
459    * @see #UNION_DERIVATION
460    */

461   int getDerivationKind(EDataType eDataType);
462
463   /**
464    * If a datatype corresponds to simple type that derives from another by restriction, returns the datatype
465    * corresponding to the base type.
466    * <p>details key: "baseType"
467    */

468   EDataType getBaseType(EDataType eDataType);
469
470   /**
471    * Sets the base type for a datatype, indicating that the datatype corresponds to a simple type that derives from
472    * another by restriction.
473    * <p>details key: "baseType"
474    */

475   void setBaseType(EDataType eDataType, EDataType baseType);
476
477   /**
478    * If a datatype corresponds to a list type, returns the datatype corresponding to its item type.
479    * <p>details key: "itemType"
480    */

481   EDataType getItemType(EDataType eDataType);
482
483   /**
484    * Sets the item type for a datatype, indicating that the datatype corresponds to a list type.
485    * <p>details key: "itemType"
486    */

487   void setItemType(EDataType eDataType, EDataType itemType);
488
489   /**
490    * If a datatype corresponds to a union type, returns the datatypes corresponding to its member types.
491    * <p>details key: "memberTypes"
492    */

493   List JavaDoc /*EDataType*/ getMemberTypes(EDataType eDataType);
494
495   /**
496    * Sets the member types for a datatype, indicating that the datatype corresponds to a union type.
497    * <p>details key: "memberTypes"
498    */

499   void setMemberTypes(EDataType eDataType, List JavaDoc /*EDataType*/memberTypes);
500
501   /**
502    * Returns all the structural features of the given class, and its superclasses, corresponding to XML attributes
503    * and attribute wildcards.
504    */

505   List JavaDoc /*EStructuralFeature*/ getAllAttributes(EClass eClass);
506
507   /**
508    * Returns all the structural features of the given class, and its superclasses, corresponding to elements, element
509    * wildards, and model groups.
510    */

511   List JavaDoc /*EStructuralFeature*/ getAllElements(EClass eClass);
512
513   /**
514    * Returns the structural features of the given class corresponding to XML attributes and attribute wildcards.
515    */

516   List JavaDoc /*EStructuralFeature*/ getAttributes(EClass eClass);
517
518   /**
519    * Returns the structural features of the given class corresponding to elements, element wildcards, and model groups.
520    */

521   List JavaDoc /*EStructuralFeature*/ getElements(EClass eClass);
522
523   /**
524    * Tests whether any of a list of wildcards matches a given namespace.
525    */

526   boolean matches(List JavaDoc /*String*/ wildcards, String JavaDoc namespace);
527
528   /**
529    * Tests whether a wildcard matches a given namesapce.
530    */

531   boolean matches(String JavaDoc wildcard, String JavaDoc namespace);
532
533   /**
534    * Returns the allowable namespace patterns for a structural feature corresponding to an any or anyAttribute wildcard.
535    * <p>details key: "wildcards"
536    */

537   List JavaDoc /*String*/ getWildcards(EStructuralFeature eStructuralFeature);
538
539   /**
540    * Sets the allowable namespace patterns for a structural feature corresponding to an any or anyAttribute wildcard.
541    * <p>details key: "wildcards"
542    */

543   void setWildcards(EStructuralFeature eStructuralFeature, List JavaDoc wildcards);
544
545   /**
546    * The processing kind ID for unspecified processing.
547    * @see #getProcessingKind
548    * @see #setProcessingKind
549    */

550   int UNSPECIFIED_PROCESSING = 0;
551
552   /**
553    * The processing kind ID for strict processing. This requires that metadata be available in order to parse content.
554    * @see #getProcessingKind
555    * @see #setProcessingKind
556    */

557   int STRICT_PROCESSING = 1;
558
559   /**
560    * The processing kind ID for lax processing.
561    * @see #getProcessingKind
562    * @see #setProcessingKind
563    */

564   int LAX_PROCESSING = 2;
565
566   /**
567    * The processing kind ID for skip processing.
568    * @see #getProcessingKind
569    * @see #setProcessingKind
570    */

571   int SKIP_PROCESSING = 3;
572
573   /**
574    * The strings used to represent the various processing kinds in extended metadata annotations, indexed by kind ID.
575    * @see #getProcessingKind
576    * @see #setProcessingKind
577    */

578   String JavaDoc [] PROCESSING_KINDS = { "unspecified", "strict", "lax", "skip" };
579
580   /**
581    * Returns the kind of contents processing to be used for a structural feature corresponding to an any wildcard.
582    * <p>details key: "processing"
583    * @see #UNSPECIFIED_PROCESSING
584    * @see #STRICT_PROCESSING
585    * @see #LAX_PROCESSING
586    * @see #SKIP_PROCESSING
587    */

588   int getProcessingKind(EStructuralFeature eStructuralFeature);
589
590   /**
591    * Sets the kind of contents processing to be used for a structural feature corresponding to an any wildcard.
592    * <p>details key: "processing"
593    * @see #UNSPECIFIED_PROCESSING
594    * @see #STRICT_PROCESSING
595    * @see #LAX_PROCESSING
596    * @see #SKIP_PROCESSING
597    */

598   void setProcessingKind(EStructuralFeature eStructuralFeature, int processingKind);
599
600   /**
601    * Returns the substitution group affiliation for the given structural feature, that is, the feature corresponding to
602    * the head element of the substitution group to which the element corresponding to the given feature belongs.
603    * <p>details key: "affiliation"
604    */

605   EStructuralFeature getAffiliation(EStructuralFeature eStructuralFeature);
606
607   /**
608    * Sets the substitution group affiliation for the given structural feature. Both feature and its affiliation feature
609    * should be in a document root class, such that they correspond to global structural feature declarations.
610    * <p>details key: "affiliation"
611    */

612   void setAffiliation(EStructuralFeature eStructuralFeature, EStructuralFeature affiliation);
613
614   /**
615    * Returns the feature respresenting the model group or subtitution group head feature to which the implementation
616    * of the given feature is delegated.
617    * <p>details key: "group"
618    */

619   EStructuralFeature getGroup(EStructuralFeature eStructuralFeature);
620
621   /**
622    * Sets a group or substitution group head feature, to which the implementation of the given feature should be
623    * delegated.
624    * <p>details key: "group"
625    */

626   void setGroup(EStructuralFeature eStructuralFeature, EStructuralFeature group);
627
628   /**
629    * Returns a structural feature within the given class that is or is associated with the given structural feature.
630    * If the feature corresponds to an attribute, it will return the given feature itself, a feature matching the given
631    * one in the document root (corresponding to a reference to the global attribute), or a wildcard attribute feature
632    * appropriate for the namespace of the given feature. If it corresponds to an element, it will return the feature
633    * itself, a feature matching it in the document root or its affiliations (corresponding to a reference to the global
634    * element, or its head, or its head's head, etc.), the mixed content feature for an XML type (text, CDATA, or
635    * comment), or a wildcard element feature appropriate for the namespace of the given feature.
636    */

637   EStructuralFeature getAffiliation(EClass eClass, EStructuralFeature eStructuralFeature);
638
639   /**
640    * Returns a wildcard feature in the given class that allows allows attribute values from the given namespace.
641    */

642   EStructuralFeature getAttributeWildcardAffiliation(EClass eClass, String JavaDoc namespace, String JavaDoc name);
643
644   /**
645    * Returns a wildcard feature in the given class that allows allows element values from the given namespace.
646    */

647   EStructuralFeature getElementWildcardAffiliation(EClass eClass, String JavaDoc namespace, String JavaDoc name);
648
649   /**
650    * The white space kind ID for an unspecified kind.
651    * @see #getWhiteSpaceFacet
652    * @see #setWhiteSpaceFacet
653    */

654   int UNSPECIFIED_WHITE_SPACE = 0;
655
656   /**
657    * The white space kind ID for preserve.
658    * @see #getWhiteSpaceFacet
659    * @see #setWhiteSpaceFacet
660    */

661   int PRESERVE_WHITE_SPACE = 1;
662
663   /**
664    * The white space kind ID for replace (each white space character by a space).
665    * @see #getWhiteSpaceFacet
666    * @see #setWhiteSpaceFacet
667    */

668   int REPLACE_WHITE_SPACE = 2;
669
670   /**
671    * The white space kind ID for collapse (all contiguous white space characters to a single space).
672    * @see #getWhiteSpaceFacet
673    * @see #setWhiteSpaceFacet
674    */

675   int COLLAPSE_WHITE_SPACE = 3;
676
677   /**
678    * The strings used to represent the various white space kinds in extended metadata annotations, indexed by kind ID.
679    * @see #getWhiteSpaceFacet
680    * @see #setWhiteSpaceFacet
681    */

682   String JavaDoc [] WHITE_SPACE_KINDS = { "unspecified", "preserve", "replace", "collapse" };
683
684   /**
685    * Returns the white space constraint on the given datatype.
686    * <p>details key: "whiteSpace"
687    * @see #UNSPECIFIED_WHITE_SPACE
688    * @see #PRESERVE_WHITE_SPACE
689    * @see #REPLACE_WHITE_SPACE
690    * @see #COLLAPSE_WHITE_SPACE
691    */

692   int getWhiteSpaceFacet(EDataType eDataType);
693
694   /**
695    * Sets the white space constraint on the given datatype.
696    * <p>details key: "whiteSpace"
697    * @see #UNSPECIFIED_WHITE_SPACE
698    * @see #PRESERVE_WHITE_SPACE
699    * @see #REPLACE_WHITE_SPACE
700    * @see #COLLAPSE_WHITE_SPACE
701    */

702   void setWhiteSpaceFacet(EDataType eDataType, int whiteSpace);
703
704   /**
705    * Returns the enumeration constraint on the given datatype.
706    * <p>details key: "enumeration"
707    */

708   List JavaDoc getEnumerationFacet(EDataType eDataType);
709
710   /**
711    * Sets the enumeration constraint on the given datatype.
712    * <p>details key: "enumeration"
713    */

714   void setEnumerationFacet(EDataType eDataType, List JavaDoc literals);
715
716   /**
717    * Returns the pattern constraint on the given datatype.
718    * <p>details key: "pattern"
719    */

720   List JavaDoc getPatternFacet(EDataType eDataType);
721
722   /**
723    * Sets the pattern constraint on the given datatype.
724    * <p>details key: "pattern"
725    */

726   void setPatternFacet(EDataType eDataType, List JavaDoc pattern);
727
728   /**
729    * Returns the total digits constraint on the given datatype.
730    * <p>details key: "totalDigits"
731    */

732   int getTotalDigitsFacet(EDataType eDataType);
733
734   /**
735    * Sets the total digits constraint on the given datatype.
736    * <p>details key: "totalDigits"
737    */

738   void setTotalDigitsFacet(EDataType eDataType, int digits);
739
740   /**
741    * Returns the fraction digits constraint on the given datatype.
742    * <p>details key: "fractionDigits"
743    */

744   int getFractionDigitsFacet(EDataType eDataType);
745
746   /**
747    * Sets the fraction digits constraint on the given datatype.
748    * <p>details key: "fractionDigits"
749    */

750   void setFractionDigitsFacet(EDataType eDataType, int digits);
751
752   /**
753    * Returns the length constraint on the given datatype.
754    * <p>details key: "length"
755    */

756   int getLengthFacet(EDataType eDataType);
757
758   /**
759    * Sets the length constraint on the given datatype.
760    * <p>details key: "length"
761    */

762   void setLengthFacet(EDataType eDataType, int length);
763
764   /**
765    * Returns the minumum length constraint on the given datatype.
766    * <p>details key: "minLength"
767    */

768   int getMinLengthFacet(EDataType eDataType);
769
770   /**
771    * Sets the minimum length constraint on the given datatype.
772    * <p>details key: "minLength"
773    */

774   void setMinLengthFacet(EDataType eDataType, int length);
775
776   /**
777    * Returns the maximum length constraint on the given datatype.
778    * <p>details key: "maxLength"
779    */

780   int getMaxLengthFacet(EDataType eDataType);
781
782   /**
783    * Sets the maximum length constraint on the given datatype.
784    * <p>details key: "maxLength"
785    */

786   void setMaxLengthFacet(EDataType eDataType, int length);
787
788   /**
789    * Returns the minimum (exclusive) constraint on the given datatype.
790    * <p>details key: "minExclusive"
791    */

792   String JavaDoc getMinExclusiveFacet(EDataType eDataType);
793
794   /**
795    * Sets the minimum (exclusive) constraint on the given datatype.
796    * <p>details key: "minExclusive"
797    */

798   void setMinExclusiveFacet(EDataType eDataType, String JavaDoc literal);
799
800   /**
801    * Returns the maximum (exclusive) constraint on the given datatype.
802    * <p>details key: "maxExclusive"
803    */

804   String JavaDoc getMaxExclusiveFacet(EDataType eDataType);
805
806   /**
807    * Sets the maximum (exclusive) constraint on the given datatype.
808    * <p>details key: "maxExclusive"
809    */

810   void setMaxExclusiveFacet(EDataType eDataType, String JavaDoc literal);
811
812   /**
813    * Returns the minimum (inclusive) constraint on the given datatype.
814    * <p>details key: "minInclusive"
815    */

816   String JavaDoc getMinInclusiveFacet(EDataType eDataType);
817
818   /**
819    * Sets the minimum (inclusive) constraint on the given datatype.
820    * <p>details key: "minInclusive"
821    */

822   void setMinInclusiveFacet(EDataType eDataType, String JavaDoc literal);
823
824   /**
825    * Returns the maximum (inclusive) constraint on the given datatype.
826    * <p>details key: "maxInclusive"
827    */

828   String JavaDoc getMaxInclusiveFacet(EDataType eDataType);
829
830   /**
831    * Sets the maximum (inclusive) constraint on the given datatype.
832    * <p>details key: "maxInclusive"
833    */

834   void setMaxInclusiveFacet(EDataType eDataType, String JavaDoc literal);
835
836   /**
837    * Returns a package from the demand package registry, creating it (with a document root class) if necessary.
838    */

839   EPackage demandPackage(String JavaDoc namespace);
840
841   /**
842    * Returns a class from the namespace-specified package in the demand package registry, demand creating it, and the
843    * package, if necessary.
844    */

845   EClassifier demandType(String JavaDoc namespace, String JavaDoc name);
846
847   /**
848    * Returns a feature corresponding to a global element or attribute from the namespace-specified package in the
849    * demand package registry, creating it, and the package, if necessary. Elements are created as references and
850    * attributes as attributes.
851    */

852   EStructuralFeature demandFeature(String JavaDoc namespace, String JavaDoc name, boolean isElement);
853
854   /**
855    * Returns a feature corresponding to a global element or attribute from the namespace-specified package in the
856    * demand package registry, creating it, and the package, if necessary.
857    */

858   EStructuralFeature demandFeature(String JavaDoc namespace, String JavaDoc name, boolean isElement, boolean isReference);
859
860   /**
861    * Returns the instance's collection of demand-created packages.
862    */

863   Collection JavaDoc demandedPackages();
864
865   /**
866    * The default ExtendedMetaData instance, which obtains packages from the global package registry, {@link
867    * org.eclipse.emf.ecore.EPackage.Registry#INSTANCE EPackage.Registry.INSTANCE}.
868    */

869   ExtendedMetaData INSTANCE = new BasicExtendedMetaData();
870 }
871
Popular Tags