/[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 1291 - (show annotations)
Mon Nov 22 01:18:13 2010 UTC (14 years, 3 months ago) by alfonx
Original Path: trunk/src/skrueger/geotools/io/ServerSettings.java
File MIME type: text/plain
File size: 1257 byte(s)
Preparing GP export to GS
1 package skrueger.geotools.io;
2
3 import java.net.MalformedURLException;
4 import java.util.HashMap;
5
6 public abstract class ServerSettings<T1, T2> extends HashMap<T1, T2> {
7
8 abstract public String toPropertiesString();
9
10 static Integer intOrNull(String string) {
11 if (string == null)
12 return null;
13 if (string.equals("null"))
14 return null;
15 return Integer.parseInt(string);
16 }
17
18 /**
19 * Character used to separate the parameters when serializing settings to a
20 * String
21 */
22 protected static final String DELIMITER = "|";
23
24 private String title;
25
26 static String stringOrNull(String string) {
27 if (string == null)
28 return null;
29 if (string.equals("null"))
30 return null;
31 return string;
32 }
33
34 public void setTitle(String title) {
35 if (title != null) {
36 if (title.contains(DELIMITER))
37 throw new IllegalArgumentException("Title may not contain "
38 + DELIMITER);
39 if (title.contains(WfsServerList.DELIMITER))
40 throw new IllegalArgumentException("Title may not contain "
41 + WfsServerList.DELIMITER);
42 }
43 this.title = title;
44 }
45
46 public String getTitle() {
47 if (title == null)
48 return toString();
49 return title;
50 }
51
52 abstract public ServerSettings parsePropertiesString(String propString)
53 throws MalformedURLException ;
54
55 }

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