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 @ 44259
History | View | Annotate | Download (4.06 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
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 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * 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 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | package org.gvsig.fmap.dal.feature; |
||
25 | |||
26 | import java.util.List; |
||
27 | |||
28 | import org.gvsig.fmap.dal.exception.DataException; |
||
29 | import org.gvsig.tools.dynobject.DynObject; |
||
30 | import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
||
31 | import org.gvsig.tools.lang.Cloneable; |
||
32 | import org.gvsig.tools.persistence.Persistent; |
||
33 | |||
34 | /**
|
||
35 | * A FeatureStoreTransform provides a mechanism for mapping a source FeatureType
|
||
36 | * to a target FeatureType, allowing to build different views (as in database
|
||
37 | * view) over different feature types even from different stores.
|
||
38 | *
|
||
39 | */
|
||
40 | 43215 | jjdelcerro | public interface FeatureStoreTransform |
41 | extends Persistent, Cloneable { |
||
42 | 40435 | jjdelcerro | |
43 | 43215 | jjdelcerro | /**
|
44 | * Returns the default {@link FeatureType}.
|
||
45 | *
|
||
46 | * @return default {@link FeatureType}
|
||
47 | *
|
||
48 | * @throws DataException
|
||
49 | */
|
||
50 | public FeatureType getDefaultFeatureType() throws DataException; |
||
51 | 40435 | jjdelcerro | |
52 | 43215 | jjdelcerro | /**
|
53 | * Returns this FeatureStoreTransform's FeatureType(s)
|
||
54 | *
|
||
55 | * @return
|
||
56 | * @throws DataException
|
||
57 | */
|
||
58 | public List<FeatureType> getFeatureTypes() throws DataException; |
||
59 | 40435 | jjdelcerro | |
60 | 43215 | jjdelcerro | /**
|
61 | * Returns the original store {@link FeatureType} that replaces
|
||
62 | * targetFeatureType of this FeatureStoreTransform's
|
||
63 | *
|
||
64 | * @return source {@link FeatureType}
|
||
65 | */
|
||
66 | public FeatureType getSourceFeatureTypeFrom(FeatureType targetFeatureType);
|
||
67 | 40435 | jjdelcerro | |
68 | 43215 | jjdelcerro | /**
|
69 | * Applies this transform between two features, copying the source data to
|
||
70 | * the target feature.
|
||
71 | *
|
||
72 | * @param source feature whose data will be used as source
|
||
73 | *
|
||
74 | * @param target feature in which the source data will be copied
|
||
75 | *
|
||
76 | * @throws DataException
|
||
77 | */
|
||
78 | public void applyTransform(Feature source, EditableFeature target) |
||
79 | throws DataException;
|
||
80 | 40435 | jjdelcerro | |
81 | 43215 | jjdelcerro | /**
|
82 | * Sets the FeatureStore to which this transform is applied.
|
||
83 | *
|
||
84 | * @param featureStore FeatureStore to which this transform is applied.
|
||
85 | */
|
||
86 | public void setFeatureStore(FeatureStore featureStore); |
||
87 | 40435 | jjdelcerro | |
88 | 43215 | jjdelcerro | /**
|
89 | * Returns the FeatureStore to which this transform belongs.
|
||
90 | *
|
||
91 | * @return FeatureStore to which this transform belongs.
|
||
92 | */
|
||
93 | public FeatureStore getFeatureStore();
|
||
94 | 40435 | jjdelcerro | |
95 | 43215 | jjdelcerro | /**
|
96 | * Retruns true if this make changes of any attributes values or false if
|
||
97 | * only {@link FeatureType} definitions is changed.
|
||
98 | *
|
||
99 | * @return
|
||
100 | * @see {@link FeatureStoreTransforms#isTransformsOriginalValues()}
|
||
101 | *
|
||
102 | */
|
||
103 | public boolean isTransformsOriginalValues(); |
||
104 | 40435 | jjdelcerro | |
105 | 43215 | jjdelcerro | public String getName(); |
106 | |||
107 | public String getDescription(); |
||
108 | |||
109 | /**
|
||
110 | * Sets the original metadata for this transform
|
||
111 | *
|
||
112 | * @param metadata
|
||
113 | */
|
||
114 | public void setSourceMetadata(DynObject metadata); |
||
115 | |||
116 | public void setDynValue(String name, Object value) throws DynFieldNotFoundException; |
||
117 | |||
118 | 40435 | jjdelcerro | public boolean hasDynValue(String name); |
119 | 43215 | jjdelcerro | |
120 | 40435 | jjdelcerro | public Object getDynValue(String name) throws DynFieldNotFoundException; |
121 | 43215 | jjdelcerro | |
122 | /**
|
||
123 | * This method must perform the necessary actions to set up the transformation.
|
||
124 | *
|
||
125 | * It is called automatically when adding the transformation to the store
|
||
126 | * and when the store is retrieved from the persistence.
|
||
127 | *
|
||
128 | * @throws Exception
|
||
129 | */
|
||
130 | public void setUp() throws Exception ; |
||
131 | 40435 | jjdelcerro | } |