Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.lib / org.gvsig.exportto.lib.api / src / main / java / org / gvsig / export / spi / AbstractExportParameters.java @ 44270

History | View | Annotate | Download (2.48 KB)

1
package org.gvsig.export.spi;
2

    
3
import org.gvsig.export.ExportAttributes;
4
import org.gvsig.export.ExportLocator;
5
import org.gvsig.fmap.dal.exception.DataException;
6
import org.gvsig.fmap.dal.feature.FeatureStore;
7
import org.gvsig.fmap.dal.feature.FeatureType;
8
import org.gvsig.export.ExportParameters;
9
import org.gvsig.expressionevaluator.Expression;
10

    
11
/**
12
 *
13
 * @author jjdelcerro
14
 */
15
public abstract class AbstractExportParameters implements ExportParameters {
16

    
17
    private FeatureStore sourceFeatureStore;
18
    private Expression filterExpression;
19
    private int featuresToUse;
20
    private Object context;
21
    private ExportAttributes exportAttributes = null;
22

    
23
    @Override
24
    public boolean needsSelectTargetProjection() {
25
        return false;
26
    }
27

    
28
    @Override
29
    public FeatureType getSourceFeatureType() {
30
        if (!(this.exportAttributes == null)) {
31
            return this.exportAttributes.getSourceFeatureType();
32
        } else {
33
            return null;
34
        }
35
    }
36

    
37
    @Override
38
    public void setSourceFeatureType(FeatureType sourceFeatureType) {
39
        this.exportAttributes.setSourceFeatureType(sourceFeatureType);
40
    }
41

    
42
    @Override
43
    public void setSourceFeatureStore(FeatureStore sourceFeatureStore) {
44
        this.sourceFeatureStore = sourceFeatureStore;
45
        try {
46
            this.exportAttributes = ExportLocator.getServiceManager().createExportAttributes(sourceFeatureStore.getDefaultFeatureType());
47
            
48
        } catch (DataException ex) {
49
            throw new RuntimeException("Can't create export attributes", ex);
50
        }
51
    }
52

    
53
    @Override
54
    public FeatureStore getSourceFeatureStore() {
55
        return this.sourceFeatureStore;
56
    }
57

    
58
    @Override
59
    public Expression getFilterExpresion() {
60
        return this.filterExpression;
61
    }
62

    
63
    @Override
64
    public void setFilterExpresion(Expression expression) {
65
        this.filterExpression = expression;
66
    }
67

    
68
    @Override
69
    public int getFeaturesToUse() {
70
        return featuresToUse;
71
    }
72

    
73
    @Override
74
    public void setFeaturesToUse(int featuresToUse) {
75
        this.featuresToUse = featuresToUse;
76
    }
77

    
78
    @Override
79
    public Object getContext() {
80
        return context;
81
    }
82

    
83
    @Override
84
    public void setContext(Object context) {
85
        this.context = context;
86
    }
87

    
88
    @Override
89
    public ExportAttributes getExportAttributes() {
90
        return exportAttributes;
91
    }
92

    
93
    @Override
94
    public void setExportAttributes(ExportAttributes export) {
95
        exportAttributes = export;
96
    }
97

    
98
}