Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EStructuralFeature$Internal$DynamicValueHolder


                    // Ensure that anything can be handled, even if it's not recognized.
                    //
                    String namespaceURI = helper.getURI(prefix);
                    if (extendedMetaData.getPackage(namespaceURI) == null)
                    {
                      EStructuralFeature rootFeature = extendedMetaData.demandFeature(namespaceURI, name, true);
                      rootFeature.getEContainingClass().getEPackage().setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
                    }
                  }

                  EObject rootObject = createObjectByType(prefix, name, false);
                  eDataGraph.setERootObject(rootObject);
View Full Code Here


   * <!-- end-user-doc -->
   * @generated NOT
   */
  public Object getValue()
  {
    EStructuralFeature feature = getFeature();
    if (feature.isMany())
    {
      if (value == null)
      {
        EObject eObject = (EObject)((Map.Entry)eContainer()).getKey();
        value = getListValue((EList)eObject.eGet(feature));
View Full Code Here

    return featureMap.size();
  }

  public Property getProperty(int index)
  {
    EStructuralFeature feature = featureMap.getEStructuralFeature(index);
    boolean isText =
      feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT ||
      feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA ||   
      feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__COMMENT;
    return isText ? null : (Property)feature;
View Full Code Here

    ((EClassifier)type).setInstanceClassName(javaClassName);
  }
 
  public static Property createProperty(Type containingType, String name, Type propertyType)
  {
    EStructuralFeature eStructuralFeature = propertyType.isDataType() ? (EStructuralFeature)SDOFactory.eINSTANCE.createAttribute() : (EStructuralFeature)SDOFactory.eINSTANCE.createReference();
    eStructuralFeature.setName(name);
    eStructuralFeature.setEType((EClassifier)propertyType);
    if (containingType.getName() == null)
    {
      ExtendedMetaData.INSTANCE.setFeatureKind(eStructuralFeature, ExtendedMetaData.ELEMENT_FEATURE);
    }
    ((EClass)containingType).getEStructuralFeatures().add(eStructuralFeature);
   
    if (containingType.isSequenced()) {
      eStructuralFeature.setDerived(true);
      eStructuralFeature.setTransient(true);
      eStructuralFeature.setVolatile(true);
    }
   
    return (Property)eStructuralFeature;
  }
View Full Code Here

    //TODO maybe optimize this to just return type.getProperties if type.isOpen (isOpen would need to be cached)
    EObject eDataObject = (EObject) dataObject;
    List result = new UniqueEList(eDataObject.eClass().getEAllStructuralFeatures());
    for (int i = 0, count = result.size(); i < count; ++i)
    {
      EStructuralFeature eStructuralFeature = (EStructuralFeature)result.get(i);
      if (!eStructuralFeature.isDerived() && FeatureMapUtil.isFeatureMap(eStructuralFeature))
      {
        List features = (List)eDataObject.eGet(eStructuralFeature);
        for (int j = 0, size = features.size(); j < size; ++j)
        {
          FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j);
          EStructuralFeature entryFeature = entry.getEStructuralFeature();
          result.add(entryFeature);
        }
      }
    }
    return result;
View Full Code Here

      ((DataObject)contents.get(i)).delete();
    }
    EClass eClass = eDataObject.eClass();
    for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
    {
      EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
      if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived() && !((Property)eStructuralFeature).isReadOnly())
      {
        eDataObject.eUnset(eStructuralFeature);
      }
    }
  }
View Full Code Here

    throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to BigDecimal");
  }

  public static Object getSetValue(Property property, BigDecimal value)
  {
    EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
    EClassifier eType = eStructuralFeature.getEType();
    if (value == null)
    {
      return eType.getDefaultValue();
    }
View Full Code Here

    throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to BigInteger");
  }

  public static Object getSetValue(Property property, BigInteger value)
  {
    EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
    EClassifier eType = eStructuralFeature.getEType();
    if (value == null)
    {
      return eType.getDefaultValue();
    }
View Full Code Here

    throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to boolean");
  }

  public static Object getSetValue(Property property, boolean value)
  {
    EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
    String name = eStructuralFeature.getEType().getInstanceClassName();
    if (name == "java.lang.Boolean" || name == "boolean")
    {
      return value ? Boolean.TRUE : Boolean.FALSE;
    }
View Full Code Here

    throw new IllegalArgumentException("The value of type '" + value.getClass().getName() + "' cannot be converted to byte");
  }

  public static Object getSetValue(Property property, byte value)
  {
    EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
    String name = eStructuralFeature.getEType().getInstanceClassName();
    if (name == "java.lang.Byte" || name == "byte")
    {
      return new Byte(value);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.EStructuralFeature$Internal$DynamicValueHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.