{
if (isOpen == type.isOpen()) return;
if (isOpen)
{
EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
((EClass)type).getEStructuralFeatures().add(eAttribute);
eAttribute.setName("any");
eAttribute.setUnique(false);
eAttribute.setUpperBound(ETypedElement.UNBOUNDED_MULTIPLICITY);
eAttribute.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
ExtendedMetaData.INSTANCE.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
ExtendedMetaData.INSTANCE.setProcessingKind(eAttribute, ExtendedMetaData.LAX_PROCESSING);
ExtendedMetaData.INSTANCE.setWildcards(eAttribute, Collections.singletonList("##any"));
if (type.isSequenced()) {
eAttribute.setDerived(true);
eAttribute.setTransient(true);
eAttribute.setVolatile(true);
}
}
else
{
EClass eClass = (EClass)type;
EAttribute any = (EAttribute)eClass.getEStructuralFeature("any");
eClass.getEStructuralFeatures().remove(any);
}
}