Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EAttribute


        //  2) Build lookup maps and collections
        // ------------------------------------------------
        //
        for(EFeatureGeometryInfo it : eStructure.eGeometryInfoMap.values()) {
            String eName = it.eName;
            EAttribute eAttribute = it.eAttribute();
            eStructure.eGeometryMap.put(eName,eAttribute);
            eStructure.eAllAttributeMap.put(eName,eAttribute);
            eStructure.eAllAttributeInfoMap.put(eName, it);
        }
        for(EFeatureAttributeInfo it : eStructure.eAttributeInfoMap.values()) {
            String eName = it.eName;
            EAttribute eAttribute = it.eAttribute();
            eStructure.eAttributeMap.put(eName,eAttribute);
            eStructure.eAllAttributeMap.put(eName,eAttribute);
            eStructure.eAllAttributeInfoMap.put(eName, it);
        }       
    }
View Full Code Here


    @Override
    public EAttribute add(EClass eClass) throws IllegalArgumentException {
        //
        // Check if have ID attribute?       
        //
        EAttribute eAtt = eClass.getEIDAttribute();
        if(eAtt==null) {
            for(EAttribute it : eClass.getEAllAttributes()) {
                String eType = it.getEAttributeType().getInstanceClassName();
                if("java.lang.String".equals(eType)) {
                    eAtt = it;
View Full Code Here

        return eAtt;
    }

    @Override
    public void add(EClass eClass, EAttribute eID) {
        EAttribute eAtt = eAttributeMap.get(eClass);
        if(eAtt!=null) {
            if(eAtt!=eID) {
                throw new IllegalArgumentException("EAttribute " +
                        eAtt.getName() + " already as ID added for " +
                        "EClass " + eClass.getName());
            }
        }
        else {
            String eType = eID.getEAttributeType().getInstanceClassName();
View Full Code Here

        //
        verify("eObject", eImpl, true, true, true);
        //
        // Get ID attribute
        //
        EAttribute eAttribute = eAttributeMap.get(eImpl.eClass());
        //
        // Verify
        //
        verify("eAttribute",eAttribute,true);
        //
View Full Code Here

        //
        verify("eURI",eURI,true);
        //
        // Get ID attribute
        //
        EAttribute eAttribute = eAttributeMap.get(eImpl.eClass());
        //
        // Get current value
        //
        String eSetID = (String)eImpl.eGet(eAttribute);
        //
View Full Code Here

//        //
//        verify("eURI",eURI,true);
        //
        // Get ID attribute
        //
        EAttribute eAttribute = eAttributeMap.get(eImpl.eClass());
        //
        // Get current ID
        //
        String eID = (String)eImpl.eGet(eAttribute);
        //
View Full Code Here

            // Get attribute, null indicates that it does not exist
            // in the structure of this EFeature instance. If so,
            // just discard it (in line with using structures as filters)
            //
            String eName = it.getName().getLocalPart();
            EAttribute eAttribute = eStructure.eGetAttribute(eName);
            //
            // EAttribute found in this structure.
            //
            if (eAttribute != null) {
                //
View Full Code Here

    List<EStructuralFeature> result = new ArrayList<EStructuralFeature>();
    Set<String> names = new HashSet<String>();
    for (Field field : fields) {
      if (field.getComponents().isEmpty()) {
        // We have a simple field without components
        EAttribute attribute = ECoreConversionUtils
            .fieldToEAttribute(field);
        if (!names.contains(attribute.getName())) {
          result.add(attribute);
          names.add(attribute.getName());
        }
      } else {
        // We have a complex field --> need to define a new
        // class
        EReference reference = ECoreConversionUtils.fieldToEReference(
View Full Code Here

    if (!field.getComponents().isEmpty()) {
      throw new IllegalArgumentException(
          "Can't convert field with components to "
              + "EAttribute, use fieldToEReference");
    }
    EAttribute attr = EcoreFactory.eINSTANCE.createEAttribute();
    attr.setName(toJavaName(field.getXmltag(), false));
    attr.setLowerBound(field.isRequired() ? 1 : 0);
    attr.setUpperBound(1);
    if (field.getTypeClass() != null) {
      attr.setEType(toEType(field.getTypeClass()));
    } else {
      log.warn("Field " + field.getXmltag()
          + " has no type! Setting it's type to String");
      attr.setEType(XMLTypePackage.Literals.STRING);
    }
    addMappingInformation(attr, field);
    annotateField(field, attr);
    return attr;
  }
View Full Code Here

    if (!component.getSubComponents().isEmpty()) {
      throw new IllegalArgumentException(
          "Sub-components are not supported yet for component "
              + component.getXmltag());
    }
    EAttribute result = EcoreFactory.eINSTANCE.createEAttribute();
    result.setName(toJavaName(component.getXmltag(), false));
    result.setLowerBound(component.isRequired() ? 1 : 0);
    result.setUpperBound(1);
    result.setEType(toEType(component.getTypeClass()));
    annotate(result, "truncable", String.valueOf(component.isTruncatable()));
    annotate(result, "required", String.valueOf(component.isRequired()));
    annotate(result, ANNOTATION_TYPE_KEY, SmooksMetadata.COMPONENT_TYPE);
    annotateValueNode(result, component);
    addMappingInformation(result, component);
View Full Code Here

TOP

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

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.