Statistics
| Revision:

gvsig-gdal / trunk / org.gvsig.gdal2 / org.gvsig.gdal2.prov / org.gvsig.gdal2.prov.ogr / src / main / java / org / gvsig / gdal / prov / ogr / OGRDataExplorerParameters.java @ 368

History | View | Annotate | Download (2.87 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2016 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
package org.gvsig.gdal.prov.ogr;
25

    
26
import java.io.File;
27

    
28
import org.gvsig.fmap.dal.DataServerExplorerParameters;
29
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
30
import org.gvsig.tools.ToolsLocator;
31
import org.gvsig.tools.dynobject.DelegatedDynObject;
32

    
33
/**
34
 * 
35
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
36
 *
37
 */
38
public class OGRDataExplorerParameters extends AbstractDataParameters
39
    implements DataServerExplorerParameters {
40

    
41
    /**
42
     * 
43
     */
44
    public static final String PARAMETERS_DEFINITION_NAME = "OGRDataExplorerParameters";
45

    
46
    /**
47
     * 
48
     */
49
    public static final String FILE_PARAMETER_NAME = "file";
50

    
51
    /**
52
     * 
53
     */
54
    public static final String CONNECTION_STRING_PARAMETER_NAME = "connectionString";
55

    
56
    private DelegatedDynObject parameters;
57

    
58
    /**
59
     * 
60
     */
61
    public OGRDataExplorerParameters() {
62
        this.parameters = (DelegatedDynObject) ToolsLocator.getDynObjectManager().createDynObject(
63
            ToolsLocator.getPersistenceManager().getDefinition(PARAMETERS_DEFINITION_NAME));
64
    }
65

    
66
    @Override
67
    public String getExplorerName() {
68
        return OGRDataExplorer.NAME;
69
    }
70

    
71
    @Override
72
    protected DelegatedDynObject getDelegatedDynObject() {
73
        return this.parameters;
74
    }
75

    
76
    /**
77
     * 
78
     * @return File
79
     */
80
    public File getFile() {
81
        return (File) this.getDynValue(FILE_PARAMETER_NAME);
82
    }
83

    
84
    /**
85
     * 
86
     * @return String
87
     */
88
    public String getConnectionString() {
89
        return (String) this.getDynValue(CONNECTION_STRING_PARAMETER_NAME);
90
    }
91

    
92
    /**
93
     * 
94
     * @param file
95
     *            File
96
     */
97
    public void setFile(File file) {
98
        this.setDynValue(FILE_PARAMETER_NAME, file);
99
    }
100

    
101
    /**
102
     * 
103
     * @param connection
104
     *            Connection string
105
     */
106
    public void setConnectionString(String connection) {
107
        this.setDynValue(CONNECTION_STRING_PARAMETER_NAME, connection);
108
    }
109
}