Statistics
| Revision:

gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.spi / src / main / java / org / gvsig / vectorediting / lib / spi / DefaultEditingServiceParameter.java @ 377

History | View | Annotate | Download (5.37 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2014 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 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
 * 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.vectorediting.lib.spi;
26

    
27
import java.util.Arrays;
28
import java.util.HashSet;
29
import java.util.Map;
30
import java.util.Set;
31

    
32
import org.gvsig.fmap.geom.Geometry;
33
import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
34

    
35
public class DefaultEditingServiceParameter implements EditingServiceParameter {
36

    
37
    private String name;
38

    
39
    private String description;
40

    
41
    private Set<TYPE> types;
42

    
43
    private int geometryType;
44

    
45
    private Map<String, String> options;
46

    
47
    private Object defaultValue;
48

    
49
    public DefaultEditingServiceParameter(String theName,
50
        String theDescription, TYPE... theTypes) {
51

    
52
        this.name = theName;
53
        this.description = theDescription;
54
        this.geometryType = Geometry.TYPES.NULL;
55
        this.types = new HashSet<EditingServiceParameter.TYPE>();
56
        this.types.addAll(Arrays.asList(theTypes));
57

    
58
    }
59

    
60
    public DefaultEditingServiceParameter(String theName,
61
        Object theDefaultValue, String theDescription, TYPE... theTypes) {
62

    
63
        this.name = theName;
64
        this.description = theDescription;
65
        this.geometryType = Geometry.TYPES.NULL;
66
        this.types = new HashSet<EditingServiceParameter.TYPE>();
67
        this.types.addAll(Arrays.asList(theTypes));
68
        this.defaultValue = theDefaultValue;
69
    }
70

    
71
    public DefaultEditingServiceParameter(String theName,
72
        String theDescription, int theGeometryType, TYPE... theTypes) {
73

    
74
        this.name = theName;
75
        this.description = theDescription;
76
        this.geometryType = theGeometryType;
77
        this.types = new HashSet<EditingServiceParameter.TYPE>();
78
        this.types.addAll(Arrays.asList(theTypes));
79

    
80
    }
81

    
82
    public DefaultEditingServiceParameter(String theName,
83
        String theDescription, Object theDefaultValue, int theGeometryType,
84
        TYPE... theTypes) {
85

    
86
        this.name = theName;
87
        this.description = theDescription;
88
        this.geometryType = theGeometryType;
89
        this.types = new HashSet<EditingServiceParameter.TYPE>();
90
        this.types.addAll(Arrays.asList(theTypes));
91
        this.defaultValue = theDefaultValue;
92

    
93
    }
94

    
95
    public DefaultEditingServiceParameter(String theName,
96
        String theDescription, Map<String, String> theOptions, TYPE... theTypes) {
97

    
98
        this.name = theName;
99
        this.description = theDescription;
100

    
101
        this.types = new HashSet<EditingServiceParameter.TYPE>();
102
        this.types.addAll(Arrays.asList(theTypes));
103

    
104
        this.options = theOptions;
105
    }
106

    
107
    public DefaultEditingServiceParameter(String theName,
108
        String theDescription, Map<String, String> theOptions, Object theDefaultValue, TYPE... theTypes) {
109

    
110
        this.name = theName;
111
        this.description = theDescription;
112

    
113
        this.types = new HashSet<EditingServiceParameter.TYPE>();
114
        this.types.addAll(Arrays.asList(theTypes));
115

    
116
        this.options = theOptions;
117
        this.defaultValue = theDefaultValue;
118
    }
119

    
120
    public DefaultEditingServiceParameter(String theName,
121
        String theDescription, int theGeometryType,
122
        Map<String, String> theOptions, TYPE... theTypes) {
123

    
124
        this.name = theName;
125
        this.description = theDescription;
126
        this.geometryType = theGeometryType;
127

    
128
        this.types = new HashSet<EditingServiceParameter.TYPE>();
129
        this.types.addAll(Arrays.asList(theTypes));
130

    
131
        this.options = theOptions;
132

    
133
    }
134

    
135
    public DefaultEditingServiceParameter(String theName,
136
        String theDescription, int theGeometryType,
137
        Map<String, String> theOptions, Object theDefaultValue, TYPE... theTypes) {
138

    
139
        this.name = theName;
140
        this.description = theDescription;
141
        this.geometryType = theGeometryType;
142

    
143
        this.types = new HashSet<EditingServiceParameter.TYPE>();
144
        this.types.addAll(Arrays.asList(theTypes));
145

    
146
        this.options = theOptions;
147
        this.defaultValue = theDefaultValue;
148
    }
149

    
150
    public Set<TYPE> getTypes() {
151
        return types;
152
    }
153

    
154
    public String getName() {
155
        return name;
156
    }
157

    
158
    public String getDescription() {
159
        return description;
160
    }
161

    
162
    public void setDescription(String newDescription) {
163
        this.description = newDescription;
164
    }
165

    
166
    public int getGeometryType() {
167
        return this.geometryType;
168
    }
169

    
170
    public Map<String, String> getOptions() {
171
        return this.options;
172
    }
173

    
174
    public Object getDefaultValue() {
175
        return this.defaultValue;
176
    }
177

    
178
    public void setDefaultValue(Object value) {
179
        this.defaultValue = value;
180
    }
181

    
182
}