Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EClassifier


     * @generated
     */
    private static void initCustomEnv(Environment ecoreEnv, Map environment) {
      for (Iterator it = environment.keySet().iterator(); it.hasNext();) {
        String varName = (String) it.next();
        EClassifier varType = (EClassifier) environment.get(varName);
        ecoreEnv.addElement(varName, createVar(ecoreEnv, varName,
            varType), false);
      }
    }
View Full Code Here


  private static ImageDescriptor getProvidedImageDescriptor(
      ENamedElement element) {
    if (element instanceof EStructuralFeature) {
      EStructuralFeature feature = ((EStructuralFeature) element);
      EClass eContainingClass = feature.getEContainingClass();
      EClassifier eType = feature.getEType();
      if (eContainingClass != null && !eContainingClass.isAbstract()) {
        element = eContainingClass;
      } else if (eType instanceof EClass
          && !((EClass) eType).isAbstract()) {
        element = eType;
View Full Code Here

  /**
   * @generated
   */
  protected Object getValidNewValue(EAttribute feature, Object value) {
    EClassifier type = feature.getEType();
    if (type instanceof EDataType) {
      Class iClass = type.getInstanceClass();
      if (Boolean.TYPE.equals(iClass)) {
        if (value instanceof Boolean) {
          // ok
        } else if (value instanceof String) {
          value = Boolean.valueOf((String) value);
View Full Code Here

      ePackage.setName(packagePrefix);
      ePackage.setNsPrefix(packagePrefix);
      extendedMetaData.putPackage(uri, ePackage);
    }

    EClassifier eClassifier = ePackage.getEClassifier(name);
    if (eClassifier != null)
      throw new IllegalArgumentException(); // already defined
   
    if (name != null)
    {
      eClassifier = isDataType ? (EClassifier)SDOFactory.eINSTANCE.createDataType() : (EClassifier)SDOFactory.eINSTANCE.createClass();
      eClassifier.setName(name);
    }
    else
    {
      eClassifier = DataObjectUtil.createDocumentRoot();
    }
View Full Code Here

                    // Process all the global XSD elements
                    EClass documentRoot = extendedMetaData.getDocumentRoot(currentEPackage);
                    if (documentRoot != null) {
                        for (EStructuralFeature element : (List<EStructuralFeature>)extendedMetaData
                            .getElements(documentRoot)) {
                            EClassifier elementType = element.getEType();
                           
                            // Handle a complex type
                            if (elementType instanceof EClass) {
                                EClass eClass = (EClass)elementType;

                                GenClass genClass = genClasses.get(elementType);
                                QName qname = new QName(extendedMetaData.getNamespace(currentEPackage),
                                        extendedMetaData.getName(element));
                                String interfaceName = genClass.getGenPackage().getInterfacePackageName()
                                + '.' + genClass.getInterfaceName();
                                boolean anonymous = extendedMetaData.isAnonymous(eClass);
                               
                                // Build list of property class names
                                List<String> propertyClassNames=new ArrayList<String>();
                                for (EStructuralFeature feature : (List<EStructuralFeature>)eClass.getEStructuralFeatures()) {
                                    EClassifier propertyType = feature.getEType();
                                    if (propertyType instanceof EClass) {
                                        GenClass propertyGenClass = genClasses.get(propertyType);
                                        String propertyClassName = propertyGenClass.getGenPackage().getInterfacePackageName()
                                                               + '.' + propertyGenClass.getInterfaceName();
                                        propertyClassNames.add(propertyClassName);
                                    } else if (propertyType instanceof EClassifier) {
                                        String propertyClassName = propertyType.getInstanceClass().getName();
                                        propertyClassNames.add(propertyClassName);
                                    }
                                }

                                SDODataBindingTypeMappingEntry typeMappingEntry =
View Full Code Here

  }

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

    String name = eType.getInstanceClassName();
    if (name == "java.math.BigDecimal")
    {
      return value;
    }
View Full Code Here

  }

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

    String name = eType.getInstanceClassName();
    if (name == "java.math.BigInteger")
    {
      return value;
    }
View Full Code Here

  }

  public static Object getSetValue(Property property, byte[] value)
  {
    EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
    EClassifier eType = eStructuralFeature.getEType();
    if (value == null)
    {
      return eType.getDefaultValue();
    }

    String name = eType.getInstanceClassName();
    if (name == "byte[]")
    {
      return value;
    }
View Full Code Here

  }

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

    String name = eType.getInstanceClassName();
    if (name == "java.lang.Object")
    {
      String typeName = getDateTypeName((EDataType)eType);
      if ("Date".equals(typeName))
      {
View Full Code Here

  }

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

    String name = eType.getInstanceClassName();
    if (name == "java.lang.String")
    {
      return value;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.EClassifier

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.