Statistics
| Revision:

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

History | View | Annotate | Download (3.54 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 11265 2007-04-19 11:56:03Z csanchez $
48
 * $Log$
49
 * Revision 1.5  2007-04-19 11:50:20  csanchez
50
 * Actualizacion protoripo libGPE
51
 *
52
 * Revision 1.4  2007/04/18 11:03:36  jorpiell
53
 * Add the default schema property
54
 *
55
 * Revision 1.3  2007/04/14 16:06:13  jorpiell
56
 * The writer handler has been updated
57
 *
58
 * Revision 1.2  2007/04/12 17:06:42  jorpiell
59
 * First GML writing tests
60
 *
61
 * Revision 1.1  2007/04/12 11:39:20  jorpiell
62
 * Add the GPEDefaults class
63
 *
64
 *
65
 */
66
/**
67
 * This class is used to add the properties that are used
68
 * by the GPE parsers.
69
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
70
 */
71
public class GPEDefaults {
72
        private static Properties properties = new Properties();
73
        //Decimal sepatarator
74
        public static final String DECIMAL = "decimal";
75
        //Coordinates separator. Ex: xSEPARATORy 
76
        public static final String COORDINATES_SEPARATOR = "coordinatesSeparator";
77
        //Set of tuples separator Ex: x1,y1SEPARATORx2,y2
78
        public static final String TUPLES_SEPARATOR = "tuplesSeparator";
79
        //Namespace prefix to create the XML files
80
        public static final String NAMESPACE_PREFIX = "namespacePrefix";
81
        //Namespace URI to create the XML files
82
        public static final String NAMESPACE_URI= "namespaceURI";
83
        //Default schema name
84
        public static final String XSD_SCHEMA_FILE = "schemaName";
85
        //XML version = 1.0
86
        public static final String XML_VERSION = "xmlVersion";
87
        //XML encoding (UTF-8) by default
88
        public static final String XML_ENCODING = "xmlEncoding";
89
        //Default output file
90
        public static final String DEFAULT_FILE_NAME = "defaultFileName";
91
        
92
        
93
        
94
        static{
95
                properties.put(DECIMAL, ".");
96
                properties.put(COORDINATES_SEPARATOR, ",");
97
                properties.put(TUPLES_SEPARATOR, " ");
98
                properties.put(NAMESPACE_PREFIX, "cit");
99
                properties.put(NAMESPACE_URI, "http://www.gvsig.com/cit");
100
                properties.put(XML_VERSION, "1.0");
101
                properties.put(XML_ENCODING, "UTF-8");
102
                properties.put(DEFAULT_FILE_NAME, "output");
103
                properties.put(XSD_SCHEMA_FILE, "cit.xsd");
104
        }
105
        
106
        /**
107
         * Gets a property
108
         * @param key
109
         * Property name
110
         * @return
111
         */
112
        public static String getProperty(String key){
113
                Object obj = properties.getProperty(key);
114
                if (obj == null){
115
                        return null;
116
                }
117
                return (String)obj;
118
        }
119
        
120
        /**
121
         * Sets a property
122
         * @param key
123
         * @param value
124
         */
125
        public static void setProperty(String key, Object value){
126
                properties.put(key, value);
127
        }
128
        
129
        
130
}