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 / FeatureRule.java @ 40435

History | View | Annotate | Download (1.35 KB)

1
package org.gvsig.fmap.dal.feature;
2

    
3
import org.gvsig.fmap.dal.exception.DataException;
4

    
5
/**
6
 * Represents a Feature validation rule. These rules are used to 
7
 * check Feature state integrity in editing mode.
8
 *
9
 */
10
public interface FeatureRule {
11
        
12
        /**
13
         * Returns the rule name
14
         * 
15
         * @return
16
         *                 the rule name
17
         */
18
        public String getName();
19
        
20
        /**
21
         * Returns the rule description
22
         * 
23
         * @return
24
         *                 the rule description
25
         */
26
        public String getDescription();
27
        
28
        /**
29
         * This is the method that applies this rule to the {@link Feature}, given also its associated {@link FeatureStore}.
30
         * @param feature
31
         *                         Feature to which apply the rule
32
         * @param featureStore
33
         *                         FeatureStore to which the Feature belongs
34
         * @throws DataException
35
         *                         if an error occurs during validation
36
         */
37
        public void validate(Feature feature, FeatureStore featureStore)
38
                        throws DataException;
39
        
40
        /**
41
         * Indicates whether this rule should be checked at update.
42
         * 
43
         * @return
44
         *                 true if this rule should be checked at update, otherwise false.
45
         */
46
        public boolean checkAtUpdate();
47
        
48
        /**
49
         * Returns true if this rule should be applied just when editing is being finished.
50
         *
51
         * @return        
52
         *                 true if this rule should be applied when editing is being finished, otherwise false.
53
         */
54
        public boolean checkAtFinishEditing();
55
}