001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.services.deployment.metadata;
023:
024: import java.io.Serializable;
025:
026: /**
027: * Simple POJO class to model XML data
028: *
029: * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
030: *
031: * @version $Revision: 57210 $
032: */
033: public class PropertyInfo implements Serializable {
034: /** @since 4.0.2 */
035: private static final long serialVersionUID = -1246926015774516936L;
036:
037: private String name;
038: private String type;
039: private boolean optional;
040: private String description;
041: private Object defaultValue;
042:
043: public PropertyInfo() {
044: // empty
045: }
046:
047: public PropertyInfo(PropertyInfo that) {
048: this .name = that.name;
049: this .type = that.type;
050: this .optional = that.optional;
051: this .description = that.description;
052: this .defaultValue = that.defaultValue; // shouldn't we copy this?
053: }
054:
055: public PropertyInfo(String name, String type, boolean optional,
056: String description, Object defaultValue) {
057: this .name = name;
058: this .type = type;
059: this .optional = optional;
060: this .description = description;
061: this .defaultValue = defaultValue;
062: }
063:
064: public Object getDefaultValue() {
065: return defaultValue;
066: }
067:
068: public void setDefaultValue(Object defaultValue) {
069: this .defaultValue = defaultValue;
070: }
071:
072: public String getDescription() {
073: return description;
074: }
075:
076: public void setDescription(String description) {
077: this .description = description;
078: }
079:
080: public String getName() {
081: return name;
082: }
083:
084: public void setName(String name) {
085: this .name = name;
086: }
087:
088: public boolean isOptional() {
089: return optional;
090: }
091:
092: public void setOptional(boolean optional) {
093: this .optional = optional;
094: }
095:
096: public String getType() {
097: return type;
098: }
099:
100: public void setType(String type) {
101: this .type = type;
102: }
103:
104: public String toString() {
105: StringBuffer sbuf = new StringBuffer(256);
106:
107: sbuf.append('[').append("name=").append(name).append(", type=")
108: .append(type).append(", optional=").append(optional)
109: .append(", description=").append(description).append(
110: ", defaultValue=").append(defaultValue).append(
111: ']');
112:
113: return sbuf.toString();
114: }
115: }
|