KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > services > deployment > metadata > PropertyInfo


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.services.deployment.metadata;
23
24 import java.io.Serializable JavaDoc;
25
26 /**
27  * Simple POJO class to model XML data
28  *
29  * @author <a HREF="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
30  *
31  * @version $Revision: 37459 $
32  */

33 public class PropertyInfo
34    implements Serializable JavaDoc
35 {
36    /** @since 4.0.2 */
37    private static final long serialVersionUID = -1246926015774516936L;
38       
39    private String JavaDoc name;
40    private String JavaDoc type;
41    private boolean optional;
42    private String JavaDoc description;
43    private Object JavaDoc defaultValue;
44    
45    public PropertyInfo()
46    {
47       // empty
48
}
49    
50    public PropertyInfo(PropertyInfo that)
51    {
52       this.name = that.name;
53       this.type = that.type;
54       this.optional = that.optional;
55       this.description = that.description;
56       this.defaultValue = that.defaultValue; // shouldn't we copy this?
57
}
58    
59    public PropertyInfo(String JavaDoc name, String JavaDoc type, boolean optional, String JavaDoc description, Object JavaDoc defaultValue)
60    {
61       this.name = name;
62       this.type = type;
63       this.optional = optional;
64       this.description = description;
65       this.defaultValue = defaultValue;
66    }
67    
68    public Object JavaDoc getDefaultValue()
69    {
70       return defaultValue;
71    }
72    
73    public void setDefaultValue(Object JavaDoc defaultValue)
74    {
75       this.defaultValue = defaultValue;
76    }
77    
78    public String JavaDoc getDescription()
79    {
80       return description;
81    }
82    
83    public void setDescription(String JavaDoc description)
84    {
85       this.description = description;
86    }
87    
88    public String JavaDoc getName()
89    {
90       return name;
91    }
92    
93    public void setName(String JavaDoc name)
94    {
95       this.name = name;
96    }
97    
98    public boolean isOptional()
99    {
100       return optional;
101    }
102    
103    public void setOptional(boolean optional)
104    {
105       this.optional = optional;
106    }
107    
108    public String JavaDoc getType()
109    {
110       return type;
111    }
112    
113    public void setType(String JavaDoc type)
114    {
115       this.type = type;
116    }
117    
118    public String JavaDoc toString()
119    {
120       StringBuffer JavaDoc sbuf = new StringBuffer JavaDoc(256);
121       
122       sbuf.append('[')
123       .append("name=").append(name)
124       .append(", type=").append(type)
125       .append(", optional=").append(optional)
126       .append(", description=").append(description)
127       .append(", defaultValue=").append(defaultValue)
128       .append(']');
129       
130       return sbuf.toString();
131    }
132 }
133
Popular Tags