Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EAttribute


        }
       
        //
        // Implementation holds the ID value. Get EFeature ID attribute.
        //
        EAttribute eAttribute = getStructure().eIDAttribute();
        //
        // Get current EFeature ID (will recurse into this method if ID holder)
        //
        eID = (String)eImpl().eGet(eAttribute);
        //
View Full Code Here


        }
        else {
            //
            // Implementation holds the ID value. Get EFeature ID attribute.
            //
            EAttribute eAttribute = getStructure().eIDAttribute();
            //
            // Since the implementation holds the ID value, the
            // the eAttribute must be changeable.
            //
            if(!eAttribute.isChangeable()) {
                throw new IllegalStateException("EAttribute must be " +
                                "changeable when the eImpl() is the " +
                                "ID holder.");
            }
            //
View Full Code Here

            eProperties = EFeatureUtils.newList(eList.size());
            //
            // Loop over all attributes
            //
            for (EFeatureAttributeInfo it : eList) {
                EAttribute eAttribute = it.eAttribute();
                Class<?> type = eAttribute.getEAttributeType().getInstanceClass();
                eProperties.add(newProperty(this, it.eName(), type));
            }           
        }
        return eProperties;
    }
View Full Code Here

        if (eNext == null) {
            throw new IOException("No content available - did you remeber to call next?");
        }

        EAttribute eAttribute = eAttributes.get(getAttributeName(index));

        return (eAttribute != null ? eNext.eGet(eAttribute) : null);
    }
View Full Code Here

        //
        Map<String, EAttribute> eAttrMap = EFeatureUtils.eGetAttributeMap(eClass);
        //
        // 3) Validate ID attribute
        //
        EAttribute eAttribute = eClass.getEIDAttribute();
        if (eAttribute != null) {
            //
            // Get attribute name
            //
            String eName = eAttribute.getName();
            //
            // Get EAttribute ID instance
            //
            EFeatureAttributeInfo eInfo = eGetAttributeInfo(eName, true);
            //
            // Validate attribute
            //
            if(!(s = eInfo.validate(true, eAttribute)).isSuccess()) {
                //
                // Given EClass specified ID attribute was not a valid
                //
                return s;
            }
        } else if (!eAttrMap.containsKey(eIDAttributeName)) {
            return failure(this, eName(), "Feature mismatch: ID EAttribute '" + eIDAttributeName + "' not found");
        }
        //
        // EClass specified ID attribute is already validated
        //
        eAttrMap.remove(eAttribute);
        //
        // 4) Validate attributes
        //
        for (EFeatureAttributeInfo it : eAttributeInfoMap.values()) {
            eAttribute = eAttrMap.get(it.eName);
            if (eAttribute == null) {
                return failure(this, eName(), "Feature mismatch: EAttribute " + it.eName
                        + " not found in EClass");
            }
            boolean isID = eAttribute.getName().equals(eIDAttributeName);
            if (!(s = it.validate(isID, eAttribute)).isSuccess()) {
                return s;
            }
        }
        //
        // 5) Validate geometries
        //
        for (EFeatureGeometryInfo it : eGeometryInfoMap.values()) {
            eAttribute = eAttrMap.get(it.eName);
            if (eAttribute == null) {
                return failure(this, eName(), "Feature mismatch: EGeometry " + it.eName
                        + " not found in EClass");
            }
            boolean isID = eAttribute.getName().equals(eIDAttributeName);
            if (!(s = it.validate(isID, eAttribute)).isSuccess()) {
                return s;
            }
        }
        //
View Full Code Here

        eInfo.eClassName = eClass.getName();
        eInfo.eClass = new WeakReference<EClass>(eClass);       
        //
        // Set ID attribute
        //               
        EAttribute eIDAttribute = eGetIDAttribute(eClass,eInfo.eHints);
        eInfo.eIDAttributeName = eIDAttribute.getName();
        eInfo.eMappingMap.put(EFeaturePackage.eINSTANCE.getEFeature_ID(),eIDAttribute);
        //
        // Set SRID attribute
        //               
        EAttribute eSRIDAttribute = eGetSRIDAttribute(eClass, eInfo.eHints);
        eInfo.eSRIDAttributeName = eSRIDAttribute.getName();
        eInfo.eMappingMap.put(EFeaturePackage.eINSTANCE.getEFeature_SRID(),eSRIDAttribute);
        //
        // Set default geometry attribute
        //               
        EAttribute eDefaultAttribute = eGetDefaultAttribute(eClass, eInfo.eHints);
        eInfo.eDefaultAttributeName = eDefaultAttribute.getName();
        eInfo.eMappingMap.put(EFeaturePackage.eINSTANCE.getEFeature_Default(),eDefaultAttribute);
        //
        // Create EFeature attribute structures
        //                       
        EList<EAttribute> eAttributes = eClass.getEAllAttributes();
View Full Code Here

        //
        return eInfo;
    }   
   
    protected static EAttribute eGetIDAttribute(EClass eClass, EFeatureHints eHints) {
        EAttribute eIDAttribute = eGetAttribute(eClass, eHints, EFeatureHints.EFEATURE_ID_ATTRIBUTES);
        if(eIDAttribute == null) {
            eIDAttribute = eClass.getEIDAttribute();           
        }
        return eIDAttribute;
    }
View Full Code Here

        }
        return eIDAttribute;
    }
   
    protected static EAttribute eGetSRIDAttribute(EClass eClass, EFeatureHints eHints) {
        EAttribute eIDAttribute = eGetAttribute(eClass, eHints, EFeatureHints.EFEATURE_SRID_ATTRIBUTES);
        if(eIDAttribute == null) {
            eIDAttribute = EFeaturePackage.eINSTANCE.getEFeature_SRID();           
        }
        return eIDAttribute;
    }
View Full Code Here

        }
        return eIDAttribute;
    }
   
    protected static EAttribute eGetDefaultAttribute(EClass eClass, EFeatureHints eHints) {
        EAttribute eIDAttribute = eGetAttribute(eClass, eHints, EFeatureHints.EFEATURE_DEFAULT_ATTRIBUTES);
        if(eIDAttribute == null) {
            eIDAttribute = EFeaturePackage.eINSTANCE.getEFeature_Default();           
        }
        return eIDAttribute;
    }
View Full Code Here

        }
        return eIDAttribute;
    }
   
    protected static EAttribute eGetAttribute(EClass eClass, EFeatureHints eHints, Key eHint) {
        EAttribute eAttribute = null;
        if(eHints!=null) {
            eAttribute = eHints.eGetAttribute(eClass, eHint);
        }
        return eAttribute;
    }
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.