/[schmitzm]/branches/2.3.x/src/skrueger/geotools/io/ServerSettings.java
ViewVC logotype

Annotation of /branches/2.3.x/src/skrueger/geotools/io/ServerSettings.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1240 - (hide annotations)
Fri Nov 5 13:02:30 2010 UTC (14 years, 3 months ago) by alfonx
File MIME type: text/plain
File size: 1110 byte(s)
Branch 2.3.x angelegt

1 alfonx 1164 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