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 @ 40435

History | View | Annotate | Download (3.67 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 IVER T.I. S.A.   {{Task}}
26
*/
27

    
28
package org.gvsig.fmap.dal.feature;
29

    
30
import java.util.List;
31

    
32
import org.gvsig.fmap.dal.exception.DataException;
33
import org.gvsig.tools.dynobject.DynObject;
34
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
35
import org.gvsig.tools.lang.Cloneable;
36
import org.gvsig.tools.persistence.Persistent;
37

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

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

    
57
        /**
58
         * Returns this FeatureStoreTransform's FeatureType(s)
59
         * @return
60
         * @throws DataException
61
         */
62
        public List getFeatureTypes() throws DataException;
63

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

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

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

    
96
        /**
97
         * Returns the FeatureStore to which this transform belongs.
98
         *
99
         * @return FeatureStore to which this transform belongs.
100
         */
101
        public FeatureStore getFeatureStore();
102

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

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