public EClass getDocumentRoot(EPackage epackage) { for (int i = 0; i < docRoots.size(); i += 2) { if (docRoots.get(i) == epackage) { return (EClass)docRoots.get(++i); } } docRoots.add(epackage); EClass docRoot = extendedMetaData.getDocumentRoot(epackage); docRoots.add(docRoot); return docRoot; }
public EClass getDocumentRoot(EPackage epackage) { for (int i = 0; i < docRoots.size(); i += 2) { if (docRoots.get(i) == epackage) { return (EClass)docRoots.get(++i); } } docRoots.add(epackage); EClass docRoot = extendedMetaData.getDocumentRoot(epackage); docRoots.add(docRoot); return docRoot; }
public boolean isDocumentRoot() { return getExtendedMetaData().getDocumentRoot(getEcoreClass().getEPackage()) == getEcoreClass(); }
protected void fixEStructuralFeatures(EClass eClass) { List<EStructuralFeature> features = eClass.getEStructuralFeatures(); if (!features.isEmpty()) { // The container class must be null for the open content features of the document root // to ensure that they are looked up in the actual eClass() // rather than assumed to be a feature with a feature ID relative to the actual class. // Otherwise, it's good to have this optimization. // Class<?> containerClass = ExtendedMetaData.INSTANCE.getDocumentRoot(this) == eClass ? null : eClass.getInstanceClass(); int id = eClass.getFeatureID(features.get(0)); for (Iterator<EStructuralFeature> i = features.iterator(); i.hasNext(); ) { EStructuralFeatureImpl eStructuralFeature = (EStructuralFeatureImpl)i.next(); eStructuralFeature.setFeatureID(id++); eStructuralFeature.setContainerClass(containerClass); } } }
protected void fixEStructuralFeatures(EClass eClass) { List<EStructuralFeature> features = eClass.getEStructuralFeatures(); if (!features.isEmpty()) { // The container class must be null for the open content features of the document root // to ensure that they are looked up in the actual eClass() // rather than assumed to be a feature with a feature ID relative to the actual class. // Otherwise, it's good to have this optimization. // Class<?> containerClass = ExtendedMetaData.INSTANCE.getDocumentRoot(this) == eClass ? null : eClass.getInstanceClass(); int id = eClass.getFeatureID(features.get(0)); for (Iterator<EStructuralFeature> i = features.iterator(); i.hasNext(); ) { EStructuralFeatureImpl eStructuralFeature = (EStructuralFeatureImpl)i.next(); eStructuralFeature.setFeatureID(id++); eStructuralFeature.setContainerClass(containerClass); } } }
public boolean isDocumentRoot() { return getExtendedMetaData().getDocumentRoot(getEcoreClass().getEPackage()) == getEcoreClass(); }
public GenClass getDocumentRoot() { EClass documentRoot = getExtendedMetaData().getDocumentRoot(getEcorePackage()); return documentRoot == null ? null : findGenClass(documentRoot); }
public boolean hasDocumentRoot() { if (getResource() != GenResourceKind.XML_LITERAL) { return false; } return getExtendedMetaData().getDocumentRoot(getEcorePackage()) != null; }
public GenClass getDocumentRoot() { EClass documentRoot = getExtendedMetaData().getDocumentRoot(getEcorePackage()); return documentRoot == null ? null : findGenClass(documentRoot); }
public boolean hasDocumentRoot() { if (getResource() != GenResourceKind.XML_LITERAL) { return false; } return getExtendedMetaData().getDocumentRoot(getEcorePackage()) != null; }
EClass eClass = top.eClass(); helper.populateNameInfo(nameInfo, eClass); if (extendedMetaData == null || extendedMetaData.getDocumentRoot(eClass.getEPackage()) != eClass)
/** * Searches the document root object package for a changeable (non-abstract) element * that is affiliated with the given feature in the given class * and a classifier that exactly matches the given classifier * @param extendedMetaData the extended meta data in which to look up type information. * @param ePackage the package whose document root to search. * @param eContainingClass the containing class of the feature. * @param eStructuralFeature the target feature. * @param eClassifier the type of object being matched. * @return the substitution group feature or <code>null</code>. */ protected EStructuralFeature getSubstitutionGroup (ExtendedMetaData extendedMetaData, EPackage ePackage, EClass eContainingClass, EStructuralFeature eStructuralFeature, EClassifier eClassifier) { EClass eClass = extendedMetaData.getDocumentRoot(ePackage); if (eClass != null) { for (EStructuralFeature element : extendedMetaData.getElements(eClass)) { if (element.getEType() == eClassifier && element.isChangeable() && extendedMetaData.getAffiliation(eContainingClass, element) == eStructuralFeature) { return element; } } } return null; } }
wildcards = new UniqueEList<String>(); wildcards.add(XMLTypePackage.eNS_URI); if (ExtendedMetaData.INSTANCE.getDocumentRoot(containingClass.getEPackage()) == containingClass)
/** * Searches the document root object package for a changeable (non-abstract) element * that is affiliated with the given feature in the given class * and a classifier that exactly matches the given classifier * @param extendedMetaData the extended meta data in which to look up type information. * @param ePackage the package whose document root to search. * @param eContainingClass the containing class of the feature. * @param eStructuralFeature the target feature. * @param eClassifier the type of object being matched. * @return the substitution group feature or <code>null</code>. */ protected EStructuralFeature getSubstitutionGroup (ExtendedMetaData extendedMetaData, EPackage ePackage, EClass eContainingClass, EStructuralFeature eStructuralFeature, EClassifier eClassifier) { EClass eClass = extendedMetaData.getDocumentRoot(ePackage); if (eClass != null) { for (EStructuralFeature element : extendedMetaData.getElements(eClass)) { if (element.getEType() == eClassifier && element.isChangeable() && extendedMetaData.getAffiliation(eContainingClass, element) == eStructuralFeature) { return element; } } } return null; } }
EClass eClass = top.eClass(); helper.populateNameInfo(nameInfo, eClass); if (extendedMetaData == null || extendedMetaData.getDocumentRoot(eClass.getEPackage()) != eClass)
EClass eClass = extendedMetaData.getDocumentRoot(eClassifier.getEPackage()); if (eClass != null && eClass != XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT) eClass = extendedMetaData.getDocumentRoot(ePackage); if (eClass != null)
EClass eClass = extendedMetaData.getDocumentRoot(eClassifier.getEPackage()); if (eClass != null && eClass != XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT) eClass = extendedMetaData.getDocumentRoot(ePackage); if (eClass != null)
public GenFeature getRootFeature() { EClass documentRoot = getExtendedMetaData().getDocumentRoot(getEcorePackage()); if (documentRoot != null) { for (EStructuralFeature eStructuralFeature : getExtendedMetaData().getAllElements(documentRoot)) { if (eStructuralFeature instanceof EReference && !((EClass)eStructuralFeature.getEType()).isAbstract() && eStructuralFeature.isChangeable()) { return findGenFeature(eStructuralFeature); } } } return null; }
public GenFeature getRootFeature() { EClass documentRoot = getExtendedMetaData().getDocumentRoot(getEcorePackage()); if (documentRoot != null) { for (EStructuralFeature eStructuralFeature : getExtendedMetaData().getAllElements(documentRoot)) { if (eStructuralFeature instanceof EReference && !((EClass)eStructuralFeature.getEType()).isAbstract() && eStructuralFeature.isChangeable()) { return findGenFeature(eStructuralFeature); } } } return null; }
EClass documentRootEClass = extendedMetaData.getDocumentRoot(ePackage); if (documentRootEClass == null)