Revision 28113 branches/v2_0_0_prep/libraries/libGPE-XML/src/org/gvsig/gpe/xml/XmlProperties.java

View differences:

XmlProperties.java
27 27
 
28 28
package org.gvsig.gpe.xml;
29 29

  
30
import java.util.Properties;
31 30

  
32
import org.gvsig.gpe.GPEDefaults;
33
import org.gvsig.gpe.IGPEProperties;
34

  
35 31
/**
36 32
 * 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}.
33
 * parsers and writers. 
40 34
 */
41
public class XmlProperties implements IGPEProperties{
42
	private Properties properties = null;
43
	private static XmlProperties instance = null;
44
	
45
	private XmlProperties(){
46
		properties = new Properties();
47
		properties.put(DEFAULT_NAMESPACE_PREFIX, DEFAULT_NAMESPACE_PREFIX_VALUE);
48
		properties.put(DEFAULT_NAMESPACE_URI, DEFAULT_NAMESPACE_URI_VALUE);
49
		properties.put(XSD_SCHEMA_FILE, XSD_SCHEMA_FILE_VALUE);
50
		properties.put(XML_VERSION, XML_VERSION_VALUE);
51
		properties.put(XML_ENCODING, XML_ENCODING_VALUE);
52
		properties.put(DEFAULT_BLANC_SPACE, DEFAULT_BLANC_SPACE_VALUE);
53
		properties.put(XML_SCHEMA_VALIDATED, XML_SCHEMA_VALIDATED_VALUE);
54
	}
55
	
56
	public static IGPEProperties getInstance(){
57
		if (instance == null){
58
			instance = new XmlProperties();
59
		}
60
		return instance;
61
	}
62
	
35
public class XmlProperties{
63 36
	/**
64 37
	 * XML Schema prefix that have to be used to generate the file for the
65 38
	 * formats based on XML.
......
67 40
	 * <a href="http://www.w3.org/XML/Schema">XML Schema</a> 
68 41
	 */
69 42
	public static final String DEFAULT_NAMESPACE_PREFIX = "namespacePrefix";
70
	private static final String DEFAULT_NAMESPACE_PREFIX_VALUE = "cit";
71
	
43
		
72 44
	/**
73 45
	 * Default namespace of the files based on XML.
74 46
	 * @see 
75 47
	 * <a href="http://www.w3.org/XML/Schema">XML Schema</a> 
76 48
	 */
77 49
	public static final String DEFAULT_NAMESPACE_URI= "namespaceURI";
78
	private static final String DEFAULT_NAMESPACE_URI_VALUE=  "http://www.gvsig.org/cit";
79
	
50
		
80 51
	/**
81 52
	 * Place where the XML Schema is located.
82 53
	 * @see 
83 54
	 * <a href="http://www.w3.org/XML/Schema">XML Schema</a> 
84 55
	 */
85 56
	public static final String XSD_SCHEMA_FILE = "schemaName";
86
	private static final String XSD_SCHEMA_FILE_VALUE = "cit.xsd";
87 57
		
88 58
	/**
89 59
	 * XML number of version.
......
91 61
	 * <a href=" http://www.w3.org/XML/">XML</a> 
92 62
	 */
93 63
	public static final String XML_VERSION = "xmlVersion";
94
	private static final String XML_VERSION_VALUE =  "1.0";
95 64
	
96 65
	/**
97 66
	 * Encoding of the generated XML files.
......
99 68
	 * <a href=" http://www.w3.org/XML/">XML</a> 
100 69
	 */
101 70
	public static final String XML_ENCODING = "xmlEncoding";
102
	private static final String XML_ENCODING_VALUE = "UTF-8";
103 71
	
104 72
	/**
105 73
	 * Character to replace the blank spaces in the names that
......
109 77
	 * space.
110 78
	 */
111 79
	public static final String DEFAULT_BLANC_SPACE = "defaultBlancSpace";
112
	private static final String DEFAULT_BLANC_SPACE_VALUE = "_";
113 80
	
114 81
	/**
115 82
	 * If the parser can download XML Schemas. 
116 83
	 */
117 84
	public static final String XML_SCHEMA_VALIDATED  = "xmlSchemaValidated";
118
	private static final Boolean XML_SCHEMA_VALIDATED_VALUE = new Boolean(true);
119
	
120
	/*
121
	 * (non-Javadoc)
122
	 * @see org.gvsig.gpe.IGPEProperties#getProperties()
123
	 */
124
	public Properties getProperties() {
125
		return properties;
126
	}
127

  
128 85
}
129 86

  

Also available in: Unified diff