/[schmitzm]/branches/2.4.x/src/skrueger/geotools/io/AbstractGTServerSettings.java
ViewVC logotype

Contents of /branches/2.4.x/src/skrueger/geotools/io/AbstractGTServerSettings.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1383 - (show annotations)
Wed Jan 26 13:46:20 2011 UTC (14 years, 1 month ago) by alfonx
File MIME type: text/plain
File size: 1237 byte(s)
trunk becomes 2.4.x ... starting to create multiple modules

1 package skrueger.geotools.io;
2
3 import java.util.HashMap;
4
5 public abstract class AbstractGTServerSettings<T1, T2> extends HashMap<T1, T2>
6 implements ServerSettings {
7
8 public AbstractGTServerSettings(String propString) {
9 parsePropertiesString(propString);
10 }
11
12 public AbstractGTServerSettings() {
13 }
14
15 static Integer intOrNull(String string) {
16 if (string == null)
17 return null;
18 if (string.equals("null"))
19 return null;
20 return Integer.parseInt(string);
21 }
22
23 /**
24 * Character used to separate the parameters when serializing settings to a
25 * String
26 */
27 protected static final String DELIMITER = "|";
28
29 private String title;
30
31 static String stringOrNull(String string) {
32 if (string == null)
33 return null;
34 if (string.equals("null"))
35 return null;
36 return string;
37 }
38
39 public void setTitle(String title) {
40 if (title != null) {
41 if (title.contains(DELIMITER))
42 throw new IllegalArgumentException("Title may not contain "
43 + DELIMITER);
44 if (title.contains(WfsServerList.DELIMITER))
45 throw new IllegalArgumentException("Title may not contain "
46 + WfsServerList.DELIMITER);
47 }
48 this.title = title;
49 }
50
51 public String getTitle() {
52 if (title == null)
53 return toString();
54 return title;
55 }
56
57 }

Properties

Name Value
svn:eol-style native
svn:keywords Id URL
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26