/[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 1164 - (show annotations)
Mon Oct 25 07:25:26 2010 UTC (14 years, 4 months ago) by alfonx
Original Path: trunk/src/skrueger/geotools/io/ServerSettings.java
File MIME type: text/plain
File size: 1110 byte(s)


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

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