Statistics
| Revision:

root / trunk / libraries / libGPE / src / org / gvsig / gpe / GPEDefaults.java @ 11377

History | View | Annotate | Download (3.8 KB)

1
package org.gvsig.gpe;
2

    
3
import java.util.Properties;
4

    
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id: GPEDefaults.java 11377 2007-04-26 14:23:16Z jorpiell $
48
 * $Log$
49
 * Revision 1.6  2007-04-26 14:23:16  jorpiell
50
 * Add a getStringProperty method
51
 *
52
 * Revision 1.5  2007/04/19 11:50:20  csanchez
53
 * Actualizacion protoripo libGPE
54
 *
55
 * Revision 1.4  2007/04/18 11:03:36  jorpiell
56
 * Add the default schema property
57
 *
58
 * Revision 1.3  2007/04/14 16:06:13  jorpiell
59
 * The writer handler has been updated
60
 *
61
 * Revision 1.2  2007/04/12 17:06:42  jorpiell
62
 * First GML writing tests
63
 *
64
 * Revision 1.1  2007/04/12 11:39:20  jorpiell
65
 * Add the GPEDefaults class
66
 *
67
 *
68
 */
69
/**
70
 * This class is used to add the properties that are used
71
 * by the GPE parsers.
72
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
73
 */
74
public class GPEDefaults {
75
        private static Properties properties = new Properties();
76
        //Decimal sepatarator
77
        public static final String DECIMAL = "decimal";
78
        //Coordinates separator. Ex: xSEPARATORy 
79
        public static final String COORDINATES_SEPARATOR = "coordinatesSeparator";
80
        //Set of tuples separator Ex: x1,y1SEPARATORx2,y2
81
        public static final String TUPLES_SEPARATOR = "tuplesSeparator";
82
        //Namespace prefix to create the XML files
83
        public static final String NAMESPACE_PREFIX = "namespacePrefix";
84
        //Namespace URI to create the XML files
85
        public static final String NAMESPACE_URI= "namespaceURI";
86
        //Default schema name
87
        public static final String XSD_SCHEMA_FILE = "schemaName";
88
        //XML version = 1.0
89
        public static final String XML_VERSION = "xmlVersion";
90
        //XML encoding (UTF-8) by default
91
        public static final String XML_ENCODING = "xmlEncoding";
92
        //Default output file
93
        public static final String DEFAULT_FILE_NAME = "defaultFileName";
94
        
95
        
96
        
97
        static{
98
                properties.put(DECIMAL, ".");
99
                properties.put(COORDINATES_SEPARATOR, ",");
100
                properties.put(TUPLES_SEPARATOR, " ");
101
                properties.put(NAMESPACE_PREFIX, "cit");
102
                properties.put(NAMESPACE_URI, "http://www.gvsig.com/cit");
103
                properties.put(XML_VERSION, "1.0");
104
                properties.put(XML_ENCODING, "UTF-8");
105
                properties.put(DEFAULT_FILE_NAME, "output");
106
                properties.put(XSD_SCHEMA_FILE, "cit.xsd");
107
        }
108
        
109
        /**
110
         * Gets a String property
111
         * @param key
112
         * Property name
113
         * @return
114
         */
115
        public static String getStringProperty(String key){
116
                Object obj = properties.getProperty(key);
117
                if (obj == null){
118
                        return null;
119
                }
120
                return (String)obj;
121
        }
122
        
123
        /**
124
         * Gets a property
125
         * @param key
126
         * Property name
127
         * @return
128
         */
129
        public static Object getProperty(String key){
130
                return properties.getProperty(key);
131
        }
132
        
133
        /**
134
         * Sets a property
135
         * @param key
136
         * @param value
137
         */
138
        public static void setProperty(String key, Object value){
139
                properties.put(key, value);
140
        }
141
        
142
        
143
}