01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.wms;
17:
18: import java.util.Set;
19:
20: /**
21: * A simple bean that represents a layer name paired with a style name for use
22: * in requests.
23: *
24: * @author Richard Gould, Refractions Research Inc.
25: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wms/src/main/java/org/geotools/data/wms/SimpleLayer.java $
26: */
27: public class SimpleLayer {
28: /** Name of layer */
29: private String name;
30:
31: /**
32: * Name of style (limited to Set provided by validStyles).
33: *
34: * <p>
35: * null is used to indicate the "default" style.
36: * </p>
37: */
38: private String style;
39:
40: /** Set of type <code>String</code> naming valid styles for this layer */
41: private Set validStyles;
42:
43: /**
44: * SimpleLayer creation.
45: *
46: * @param name Name of layer
47: * @param style Name of style, null indicates default.
48: */
49: public SimpleLayer(String name, String style) {
50: super ();
51: this .name = name;
52: this .style = style;
53: }
54:
55: /**
56: * SimpleLayer creation.
57: *
58: * @param name
59: * @param validStyles
60: */
61: public SimpleLayer(String name, Set validStyles) {
62: super ();
63: this .name = name;
64: this .validStyles = validStyles;
65: }
66:
67: public String getName() {
68: return name;
69: }
70:
71: public void setName(String name) {
72: this .name = name;
73: }
74:
75: public String getStyle() {
76: return style;
77: }
78:
79: public void setStyle(String style) {
80: this .style = style;
81: }
82:
83: /**
84: * Returns a Set of type <code>String</code> containing the names of all
85: * the styles that are valid for this layer.
86: *
87: */
88: public Set getValidStyles() {
89: return validStyles;
90: }
91: }
|