root / trunk / libraries / libGPE-XML / src / org / gvsig / gpe / xml / XmlProperties.java @ 22010
History | View | Annotate | Download (4.01 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
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 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2008 Iver T.I. {{Task}}
|
26 |
*/
|
27 |
|
28 |
package org.gvsig.gpe.xml; |
29 |
|
30 |
import java.util.Properties; |
31 |
|
32 |
import org.gvsig.gpe.GPEDefaults; |
33 |
import org.gvsig.gpe.IGPEProperties; |
34 |
|
35 |
/**
|
36 |
* This class contains the properties for the XML
|
37 |
* parsers and writers. This class has been registered using
|
38 |
* the SPI (Service Provider Interface) and the values of their
|
39 |
* properties can be configured using {@link GPEDefaults}.
|
40 |
*/
|
41 |
public class XmlProperties implements IGPEProperties{ |
42 |
public static Properties properties = null; |
43 |
|
44 |
public XmlProperties(){
|
45 |
properties = new Properties(); |
46 |
properties.put(DEFAULT_NAMESPACE_PREFIX, DEFAULT_NAMESPACE_PREFIX_VALUE); |
47 |
properties.put(DEFAULT_NAMESPACE_URI, DEFAULT_NAMESPACE_URI_VALUE); |
48 |
properties.put(XSD_SCHEMA_FILE, XSD_SCHEMA_FILE_VALUE); |
49 |
properties.put(XML_VERSION, XML_VERSION_VALUE); |
50 |
properties.put(XML_ENCODING, XML_ENCODING_VALUE); |
51 |
properties.put(DEFAULT_BLANC_SPACE, DEFAULT_BLANC_SPACE_VALUE); |
52 |
properties.put(XML_SCHEMA_VALIDATED, XML_SCHEMA_VALIDATED_VALUE); |
53 |
} |
54 |
|
55 |
/**
|
56 |
* XML Schema prefix that have to be used to generate the file for the
|
57 |
* formats based on XML.
|
58 |
* @see
|
59 |
* <a href="http://www.w3.org/XML/Schema">XML Schema</a>
|
60 |
*/
|
61 |
public static final String DEFAULT_NAMESPACE_PREFIX = "namespacePrefix"; |
62 |
private static final String DEFAULT_NAMESPACE_PREFIX_VALUE = "cit"; |
63 |
|
64 |
/**
|
65 |
* Default namespace of the files based on XML.
|
66 |
* @see
|
67 |
* <a href="http://www.w3.org/XML/Schema">XML Schema</a>
|
68 |
*/
|
69 |
public static final String DEFAULT_NAMESPACE_URI= "namespaceURI"; |
70 |
private static final String DEFAULT_NAMESPACE_URI_VALUE= "http://www.gvsig.org/cit"; |
71 |
|
72 |
/**
|
73 |
* Place where the XML Schema is located.
|
74 |
* @see
|
75 |
* <a href="http://www.w3.org/XML/Schema">XML Schema</a>
|
76 |
*/
|
77 |
public static final String XSD_SCHEMA_FILE = "schemaName"; |
78 |
private static final String XSD_SCHEMA_FILE_VALUE = "cit.xsd"; |
79 |
|
80 |
/**
|
81 |
* XML number of version.
|
82 |
* @see
|
83 |
* <a href=" http://www.w3.org/XML/">XML</a>
|
84 |
*/
|
85 |
public static final String XML_VERSION = "xmlVersion"; |
86 |
private static final String XML_VERSION_VALUE = "1.0"; |
87 |
|
88 |
/**
|
89 |
* Encoding of the generated XML files.
|
90 |
* @see
|
91 |
* <a href=" http://www.w3.org/XML/">XML</a>
|
92 |
*/
|
93 |
public static final String XML_ENCODING = "xmlEncoding"; |
94 |
private static final String XML_ENCODING_VALUE = "UTF-8"; |
95 |
|
96 |
/**
|
97 |
* Character to replace the blank spaces in the names that
|
98 |
* has to be added like a XML node. On the writing process
|
99 |
* all the blank spaces are replaced by this character and on
|
100 |
* the reading process this character is replaced by a blank
|
101 |
* space.
|
102 |
*/
|
103 |
public static final String DEFAULT_BLANC_SPACE = "defaultBlancSpace"; |
104 |
private static final String DEFAULT_BLANC_SPACE_VALUE = "_"; |
105 |
|
106 |
/**
|
107 |
* If the parser can download XML Schemas.
|
108 |
*/
|
109 |
public static final String XML_SCHEMA_VALIDATED = "xmlSchemaValidated"; |
110 |
private static final Boolean XML_SCHEMA_VALIDATED_VALUE = new Boolean(true); |
111 |
|
112 |
/*
|
113 |
* (non-Javadoc)
|
114 |
* @see org.gvsig.gpe.IGPEProperties#getProperties()
|
115 |
*/
|
116 |
public Properties getProperties() { |
117 |
return properties;
|
118 |
} |
119 |
|
120 |
} |
121 |
|