EClass eClass = o.eClass(); int contentKind = extendedMetaData == null ? ExtendedMetaData.UNSPECIFIED_CONTENT : extendedMetaData.getContentKind(eClass); switch (contentKind)
EClass eClass = o.eClass(); int contentKind = extendedMetaData == null ? ExtendedMetaData.UNSPECIFIED_CONTENT : extendedMetaData.getContentKind(eClass); if (!toDOM)
  protected boolean saveFeatures(EObject o)  {    EClass eClass = o.eClass();    int contentKind = extendedMetaData == null ? ExtendedMetaData.UNSPECIFIED_CONTENT : extendedMetaData.getContentKind(eClass);    switch (contentKind)    {      case ExtendedMetaData.MIXED_CONTENT:      case ExtendedMetaData.SIMPLE_CONTENT:      {        doc.setMixed(true);        break;      }    }    EStructuralFeature[] features = featureTable.getFeatures(eClass);    int[] featureKinds = featureTable.getKinds(eClass, features);    int[] elementFeatures = null;    int elementCount = 0;    String content = null;    // Process XML attributes    LOOP:    for (int i = 0; i < features.length; i++ )    {      int kind = featureKinds[i];      EStructuralFeature f = features[i];      if (kind != TRANSIENT && o.eIsSet(f))      {        switch (kind)        {          case DATATYPE_ELEMENT_SINGLE:          {            if (contentKind == ExtendedMetaData.SIMPLE_CONTENT)            {              content = getDataTypeElementSingleSimple(o, f);              continue LOOP;            }            break;          }          case DATATYPE_SINGLE:          {            saveDataTypeSingle(o, f);            continue LOOP;          }          case DATATYPE_SINGLE_NILLABLE:          {            if (!isNil(o, f))            {              saveDataTypeSingle(o, f);              continue LOOP;            }            break;          }          case OBJECT_HREF_SINGLE_UNSETTABLE:          {            if (isNil(o, f))            {              break;            }            // it's intentional to keep going          }          case OBJECT_HREF_SINGLE:          {            if (useEncodedAttributeStyle)            {              saveEObjectSingle(o, f);              continue LOOP;            }            else            {              switch (sameDocSingle(o, f))              {                case SAME_DOC:                {                  saveIDRefSingle(o, f);                  continue LOOP;                }                case CROSS_DOC:                {                  break;                }                default:                {                  continue LOOP;                }              }            }            break;          }          case OBJECT_HREF_MANY_UNSETTABLE:          {            if (isEmpty(o, f))            {              saveManyEmpty(f);              continue LOOP;            }            // It's intental to keep going.          }          case OBJECT_HREF_MANY:          {            if (useEncodedAttributeStyle)            {              saveEObjectMany(o, f);              continue LOOP;            }            else            {              switch (sameDocMany(o, f))              {                case SAME_DOC:                {                  saveIDRefMany(o, f);                  continue LOOP;                }                case CROSS_DOC:                {                  break;                }                default:                {                  continue LOOP;                }              }            }            break;          }          case OBJECT_ELEMENT_SINGLE_UNSETTABLE:          case OBJECT_ELEMENT_SINGLE:          {            if (contentKind == ExtendedMetaData.SIMPLE_CONTENT)            {              content = getElementReferenceSingleSimple(o, f);              continue LOOP;            }            break;          }          case OBJECT_ELEMENT_MANY:          {            if (contentKind == ExtendedMetaData.SIMPLE_CONTENT)            {              content = getElementReferenceManySimple(o, f);              continue LOOP;            }            break;          }          case OBJECT_ELEMENT_IDREF_SINGLE_UNSETTABLE:          case OBJECT_ELEMENT_IDREF_SINGLE:          {            if (contentKind == ExtendedMetaData.SIMPLE_CONTENT)            {              content = getElementIDRefSingleSimple(o, f);              continue LOOP;            }            break;          }          case OBJECT_ELEMENT_IDREF_MANY:          {            if (contentKind == ExtendedMetaData.SIMPLE_CONTENT)            {              content = getElementIDRefManySimple(o, f);              continue LOOP;            }            break;          }          case OBJECT_CONTAIN_MANY_UNSETTABLE:          case DATATYPE_MANY:          {            if (isEmpty(o, f))            {              saveManyEmpty(f);              continue LOOP;            }            break;          }          case OBJECT_CONTAIN_SINGLE_UNSETTABLE:          case OBJECT_CONTAIN_SINGLE:          case OBJECT_CONTAIN_MANY:          case ELEMENT_FEATURE_MAP:          {            break;          }          case ATTRIBUTE_FEATURE_MAP:          {            saveAttributeFeatureMap(o, f);            continue LOOP;          }          default:          {            continue LOOP;          }        }        // We only get here if we should do this.        //        if (elementFeatures == null)        {          elementFeatures = new int[features.length];        }        elementFeatures[elementCount++] = i;      }    }    processAttributeExtensions(o);    if (elementFeatures == null)    {      if (content == null)      {        content = getContent(o, features);      }      if (content == null)      {        endSaveFeatures(o, EMPTY_ELEMENT, null);        return false;      }      else      {        endSaveFeatures(o, CONTENT_ELEMENT, content);        return true;      }    }    // Process XML elements    for (int i = 0; i < elementCount; i++ )    {      int kind = featureKinds[elementFeatures[i]];      EStructuralFeature f = features[elementFeatures[i]];      switch (kind)      {        case DATATYPE_SINGLE_NILLABLE:        {          saveNil(f);          break;        }        case ELEMENT_FEATURE_MAP:        {          saveElementFeatureMap(o, f);          break;        }        case DATATYPE_MANY:        {          saveDataTypeMany(o, f);          break;        }        case DATATYPE_ELEMENT_SINGLE:        {          saveDataTypeElementSingle(o, f);          break;        }        case OBJECT_CONTAIN_SINGLE_UNSETTABLE:        {          if (isNil(o, f))          {            saveNil(f);            break;          }          // it's intentional to keep going        }        case OBJECT_CONTAIN_SINGLE:        {          saveContainedSingle(o, f);          break;        }        case OBJECT_CONTAIN_MANY_UNSETTABLE:        case OBJECT_CONTAIN_MANY:        {          saveContainedMany(o, f);          break;        }        case OBJECT_HREF_SINGLE_UNSETTABLE:        {          if (isNil(o, f))          {            saveNil(f);            break;          }          // it's intentional to keep going        }        case OBJECT_HREF_SINGLE:        {          saveHRefSingle(o, f);          break;        }        case OBJECT_HREF_MANY_UNSETTABLE:        case OBJECT_HREF_MANY:        {          saveHRefMany(o, f);          break;        }        case OBJECT_ELEMENT_SINGLE_UNSETTABLE:        {          if (isNil(o, f))          {            saveNil(f);            break;          }          // it's intentional to keep going        }        case OBJECT_ELEMENT_SINGLE:        {          saveElementReferenceSingle(o, f);          break;        }        case OBJECT_ELEMENT_MANY:        {          saveElementReferenceMany(o, f);          break;        }        case OBJECT_ELEMENT_IDREF_SINGLE_UNSETTABLE:        {          if (isNil(o, f))          {            saveNil(f);            break;          }          // it's intentional to keep going        }        case OBJECT_ELEMENT_IDREF_SINGLE:        {          saveElementIDRefSingle(o, f);          break;        }        case OBJECT_ELEMENT_IDREF_MANY:        {          saveElementIDRefMany(o, f);          break;        }      }    }    endSaveFeatures(o, 0, null);    return true;  }