Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.impl / src / main / java / org / gvsig / fmap / dal / feature / impl / featurereference / FeatureReferenceFactory.java @ 45647

History | View | Annotate | Download (1.65 KB)

1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
package org.gvsig.fmap.dal.feature.impl.featurereference;
7

    
8
import org.gvsig.fmap.dal.feature.Feature;
9
import org.gvsig.fmap.dal.feature.FeatureReference;
10
import org.gvsig.fmap.dal.feature.FeatureStore;
11
import org.gvsig.fmap.dal.feature.impl.DefaultFeature;
12
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
13

    
14
/**
15
 *
16
 * @author fdiaz
17
 */
18
public class FeatureReferenceFactory {
19

    
20
    private FeatureReferenceFactory() {
21
        
22
    }
23
    
24
    public static FeatureReference createFromFeature(Feature feature){
25
        DefaultFeatureReference ref = new DefaultFeatureReference(feature.getStore(), ((DefaultFeature)feature).getData());
26
        return ref;
27
    }
28
    
29
    public static FeatureReference createFromOID(FeatureStore store, Object oid){
30
        FeatureReference ref = new DefaultFeatureReference(store, oid);
31
//        FeatureReference ref = new FeatureReferenceOID(store, oid);
32
        return ref;
33
    }
34
    
35
    public static FeatureReference createFromCode(FeatureStore store, String code){
36
        DefaultFeatureReference ref = new DefaultFeatureReference(store, code);
37
        return ref;
38
    }
39
    
40
    public static FeatureReference createFromFeatureProvider(FeatureStore store, FeatureProvider data) {
41
        DefaultFeatureReference ref = new DefaultFeatureReference(store, data);
42
        return ref;
43
    }
44
    
45
    public static void registerPersistent() {
46
//        DefaultFeatureReference.registerPersistent();
47
        FeatureReferencePersistenceFactory.selfRegister();
48
    }
49

    
50
}
51