Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / FeatureStoreTransform.java @ 40596

History | View | Annotate | Download (3.65 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24

    
25
package org.gvsig.fmap.dal.feature;
26

    
27
import java.util.List;
28

    
29
import org.gvsig.fmap.dal.exception.DataException;
30
import org.gvsig.tools.dynobject.DynObject;
31
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
32
import org.gvsig.tools.lang.Cloneable;
33
import org.gvsig.tools.persistence.Persistent;
34

    
35
/**
36
 * A FeatureStoreTransform provides a mechanism for mapping a source FeatureType
37
 * to a target FeatureType, allowing to build different views (as in database
38
 * view) over different feature types even from different stores.
39
 *
40
 * @author jmvivo
41
 *
42
 */
43
public interface FeatureStoreTransform extends Persistent, Cloneable {
44

    
45
        /**
46
         * Returns the default {@link FeatureType}.
47
         *
48
         * @return default {@link FeatureType}
49
         *
50
         * @throws DataException
51
         */
52
        public FeatureType getDefaultFeatureType() throws DataException;
53

    
54
        /**
55
         * Returns this FeatureStoreTransform's FeatureType(s)
56
         * @return
57
         * @throws DataException
58
         */
59
        public List getFeatureTypes() throws DataException;
60

    
61
        /**
62
         * Returns the original store {@link FeatureType} that replaces
63
         * targetFeatureType of this FeatureStoreTransform's
64
         *
65
         * @return source {@link FeatureType}
66
         * @throws DataException
67
         */
68
        public FeatureType getSourceFeatureTypeFrom(FeatureType targetFeatureType);
69

    
70
        /**
71
         * Applies this transform between two features, copying the source data to
72
         * the target feature.
73
         *
74
         * @param source
75
         *            feature whose data will be used as source
76
         *
77
         * @param target
78
         *            feature in which the source data will be copied
79
         *
80
         * @throws DataException
81
         */
82
        public void applyTransform(Feature source, EditableFeature target)
83
                        throws DataException;
84

    
85
        /**
86
         * Sets the FeatureStore to which this transform is applied.
87
         *
88
         * @param featureStore
89
         *            FeatureStore to which this transform is applied.
90
         */
91
        public void setFeatureStore(FeatureStore featureStore);
92

    
93
        /**
94
         * Returns the FeatureStore to which this transform belongs.
95
         *
96
         * @return FeatureStore to which this transform belongs.
97
         */
98
        public FeatureStore getFeatureStore();
99

    
100
        /**
101
         * Retruns true if this make changes of any attributes values or false if
102
         * only {@link FeatureType} definitions is changed.
103
         *
104
         * @see {@link FeatureStoreTransforms#isTransformsOriginalValues()}
105
         * 
106
         * @return
107
         */
108
        public boolean isTransformsOriginalValues();
109
        
110
        public String getName();
111
        
112
        public String getDescription();
113

    
114
        /**
115
         * Sets the original metadata for this transform
116
         * 
117
         * @param metadata
118
         */
119
        public void setSourceMetadata(DynObject metadata);
120
        
121
    public void setDynValue(String name, Object value)
122
            throws DynFieldNotFoundException;
123
    
124
    public boolean hasDynValue(String name);
125
    
126
    public Object getDynValue(String name) throws DynFieldNotFoundException;
127
        
128
}