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