Package org.geotools.data.efeature

Examples of org.geotools.data.efeature.EFeaturePackage


        setName(eNAME);
        setNsPrefix(eNS_PREFIX);
        setNsURI(eNS_URI);

        // Obtain other dependent packages
        EFeaturePackage theEFeaturePackage = (EFeaturePackage)EPackage.Registry.INSTANCE.getEPackage(EFeaturePackage.eNS_URI);

        // Create type parameters
        ETypeParameter eFeatureDataEClass_A = addETypeParameter(eFeatureDataEClass, "A"); //$NON-NLS-1$
        ETypeParameter eFeatureDataEClass_G = addETypeParameter(eFeatureDataEClass, "G"); //$NON-NLS-1$
        ETypeParameter eFeatureCompatibleDataEClass_A = addETypeParameter(eFeatureCompatibleDataEClass, "A"); //$NON-NLS-1$
        ETypeParameter eFeatureCompatibleDataEClass_G = addETypeParameter(eFeatureCompatibleDataEClass, "G"); //$NON-NLS-1$

        // Set bounds for type parameters
        EGenericType g1 = createEGenericType(theEFeaturePackage.getGeometry());
        eFeatureDataEClass_G.getEBounds().add(g1);
        g1 = createEGenericType(theEFeaturePackage.getGeometry());
        eFeatureCompatibleDataEClass_G.getEBounds().add(g1);

        // Add supertypes to classes
        eFeatureDataEClass.getESuperTypes().add(theEFeaturePackage.getEFeature());

        // Initialize classes and features; add operations and parameters
        initEClass(eFeatureDataEClass, EFeatureData.class, "EFeatureData", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
        g1 = createEGenericType(eFeatureDataEClass_A);
        initEAttribute(getEFeatureData_Attribute(), g1, "attribute", null, 1, 1, EFeatureData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
View Full Code Here


     */
    private final static Map<EAttribute, Map<EClass, EAttribute>> create(EFeatureInfo...eFeatureInfos) {       
        //
        // Prepare construction of EFeature mappings
        //
        EFeaturePackage ePackage = EFeaturePackage.eINSTANCE;
        EClass eFeatureClass = ePackage.getEFeature();
        //
        // Initialize create mapping onto EFeature?
        //
        if(eFeatureMap==null) {
            eFeatureMap = new HashMap<EAttribute, Map<EClass,EAttribute>>();
            for(EAttribute it : eFeatureClass.getEAllAttributes()) {
                Map<EClass,EAttribute> eClassMap = new HashMap<EClass,EAttribute>();
                eClassMap.put(eFeatureClass, it);
                eFeatureMap.put(it,eClassMap);
            }           
        }
        //
        // Copy from EFeature onto mapping
        //
        final Map<EAttribute, Map<EClass,EAttribute>> 
            eAttributeMap = new HashMap<EAttribute, Map<EClass,EAttribute>>(eFeatureMap);               
        //
        // Then add mappings from implementations onto EFeature
        //       
        for(EFeatureInfo it : eFeatureInfos) {
            //
            // Prepare information about structure
            //
            EClass eClass = it.eClass();           
            //
            // Add mapping from EFeature ID to implementation (is required)
            //
            eAttributeMap.get(ePackage.getEFeature_ID()).put(eClass,it.eIDAttribute());
            //
            // Add mapping from EFeature SRID to implementation (optional)
            //
            EAttribute eAttribute = it.eSRIDAttribute();
            if(eAttribute!=null) {
                eAttributeMap.get(ePackage.getEFeature_SRID()).put(eClass,eAttribute);
            }
            //
            // Add mapping from EFeature default geometry to implementation (optional)
            //
            eAttribute = it.eDefaultGeometry();
            if(eAttribute!=null) {
                eAttributeMap.get(ePackage.getEFeature_Default()).put(eClass,it.eDefaultGeometry());
            }
        }
        //
        // Construct structural value getter
        //
View Full Code Here

TOP

Related Classes of org.geotools.data.efeature.EFeaturePackage

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.