Revision 28113 branches/v2_0_0_prep/libraries/libGPE-GML/src/org/gvsig/gpe/gml/GmlProperties.java

View differences:

GmlProperties.java
27 27
 
28 28
package org.gvsig.gpe.gml;
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 GML
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 GmlProperties implements IGPEProperties{
42
	private Properties properties = null;
43
	private static GmlProperties instance = null;
44
	
45
	public GmlProperties(){
46
		properties = new Properties();
47
		properties.put(DECIMAL, DECIMAL_VALUE);
48
		properties.put(COORDINATES_SEPARATOR, COORDINATES_SEPARATOR_VALUE);
49
		properties.put(TUPLES_SEPARATOR, TUPLES_SEPARATOR_VALUE);
50
		properties.put(DEFAULT_FEATURECOLLECTION, DEFAULT_FEATURECOLLECTION_VALUE);
51
		properties.put(DEFAULT_FEATURE, DEFAULT_FEATURE_VALUE);
52
		properties.put(SRS_BASED_ON_XML, SRS_BASED_ON_XML_VALUE);
53
	}
54
	
55
	public static IGPEProperties getInstance(){
56
		if (instance == null){
57
			instance = new GmlProperties();
58
		}
59
		return instance;
60
	}
61
	
62
	
35
public class GmlProperties {
63 36
	/**
64 37
	 * This attribute is used to represent the decimal separator. 
65 38
	 * It separates the integral and  the fractional parts of a 
66 39
	 * decimal numeral.
67 40
	 */
68 41
	public static final String DECIMAL = "decimal";
69
	private static final String DECIMAL_VALUE = ".";
70 42
	
71 43
	/**
72 44
	 * It separates the different dimensions of each coordinate
73 45
	 * of a geometry (e.g. Uses ",": X1,Y1,Z1) 
74 46
	 */
75 47
	public static final String COORDINATES_SEPARATOR = "coordinatesSeparator";
76
	private static final String COORDINATES_SEPARATOR_VALUE = ",";
77 48
	
78 49
	/**
79 50
	 * It separates the different tuples of dimensions 
80 51
	 * (e.g. Uses blank space " ": X1,Y1,Z1 X2,Y2,Z2) 
81 52
	 */
82 53
	public static final String TUPLES_SEPARATOR = "tuplesSeparator";
83
	private static final String TUPLES_SEPARATOR_VALUE = " ";
84 54
	
85 55
	/**
86 56
	 * Default name for a collection of features. This name will be used
87 57
	 * only if there is not a name for a feature collection.
88 58
	 */
89 59
	public static final String DEFAULT_FEATURECOLLECTION= "featureCollection";
90
	private static final String DEFAULT_FEATURECOLLECTION_VALUE=  "FeatureCollection";
91 60
	
92 61
	/**
93 62
	 * Default name for a feature. It is only used if the
94 63
	 * feature to write doesn't has a name
95 64
	 */
96 65
	public static final String DEFAULT_FEATURE= "feature";
97
	private static final String DEFAULT_FEATURE_VALUE=  "Feature";
98 66
	
99 67
	/**
100 68
	 * IF the SRS are based on XML or if are based on EPSG code.
101 69
	 */
102 70
	public static final String SRS_BASED_ON_XML  = "srsBasedOnXml";
103
	private static final Boolean SRS_BASED_ON_XML_VALUE = new Boolean(true);
104
		
105
	/*
106
	 * (non-Javadoc)
107
	 * @see org.gvsig.gpe.IGPEProperties#getProperties()
108
	 */
109
	public Properties getProperties() {
110
		return properties;
111
	}
112

  
113 71
}
114 72

  

Also available in: Unified diff