01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.form.data;
06:
07: import org.vfny.geoserver.config.AttributeTypeInfoConfig;
08:
09: /**
10: * Present Attribute information to user input.
11: */
12: public class AttributeDisplay {
13: private String name;
14: private boolean nillable;
15: private String minOccurs;
16: private String maxOccurs;
17: private String type;
18: private String fragment;
19:
20: public AttributeDisplay(AttributeTypeInfoConfig config) {
21: name = config.getName();
22: nillable = config.isNillable();
23: minOccurs = String.valueOf(config.getMinOccurs());
24: maxOccurs = String.valueOf(config.getMaxOccurs());
25: type = config.getType();
26: fragment = config.getFragment();
27: }
28:
29: /*public AttributeDisplay( AttributeTypeInfoDTO dto ){
30: this( new AttributeTypeInfoConfig( dto ));
31: } */
32:
33: /**
34: * @return Returns the fragment.
35: */
36: public String getFragment() {
37: return fragment;
38: }
39:
40: /**
41: * @return Returns the maxOccurs.
42: */
43: public String getMaxOccurs() {
44: return maxOccurs;
45: }
46:
47: /**
48: * @return Returns the minOccurs.
49: */
50: public String getMinOccurs() {
51: return minOccurs;
52: }
53:
54: /**
55: * @return Returns the name.
56: */
57: public String getName() {
58: return name;
59: }
60:
61: /**
62: * @return Returns the nillible.
63: */
64: public boolean isNillable() {
65: return nillable;
66: }
67:
68: /**
69: * @return Returns the selectedType.
70: */
71: public String getType() {
72: return type;
73: }
74:
75: /* (non-Javadoc)
76: * @see java.lang.Object#toString()
77: */
78: public String toString() {
79: return name + ":" + type;
80: }
81: }
|