001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036: /*
037: * ConfigPropertyGroup.java
038: */
039: package com.sun.jbi.jsf.bean;
040:
041: import java.util.List;
042:
043: /**
044: * Defines when a set of related configuration properties are
045: * to be grouped under a section title, based on the optional
046: * Open ESB configuration extension elements (e.g.
047: * <code><config:PropertyGroup ...></code> in a JBI
048: * component's jbi.xml descriptor.
049: *
050: * @author Sun Microsystems Inc.
051: */
052: public class ConfigPropertyGroup {
053: // === constructor(s) ===
054:
055: /**
056: * Empty Constructor (use setters after instantiation)
057: */
058: public ConfigPropertyGroup() {
059: }
060:
061: // === getters ===
062:
063: /**
064: * Gets the configuration properties in this group.
065: *
066: * @return a List of <code>ConfigProperty</code> instances.
067: */
068: public List<ConfigProperty> getConfigProperties() {
069: return mConfigProperties;
070: }
071:
072: /**
073: * Gets the Display Name
074: *
075: * @return The section name to be displayed when grouping properties
076: * in user interface
077: */
078: public String getDisplayName() {
079: return mDisplayName;
080: }
081:
082: /**
083: * Gets the Display Description
084: *
085: * @return The DisplayDescription I18n value to be used for
086: * group/section inline help or tool tips
087: */
088: public String getDisplayDescription() {
089: return mDisplayDescription;
090: }
091:
092: /**
093: * Gets the Name attribute
094: *
095: * @return The non-I18n Name of this property group
096: */
097: public String getName() {
098: return mName;
099: }
100:
101: // === setters ===
102:
103: /**
104: * Sets the configuration properties in this group.
105: *
106: * @param aConfigProperties A list of <code>ConfigProperty</code>
107: * instances contained in this group
108: */
109: public void setConfigProperties(
110: List<ConfigProperty> aConfigProperties) {
111: mConfigProperties = aConfigProperties;
112: }
113:
114: /**
115: * Sets the Display Name attribute
116: *
117: * @param aDisplayName The I18n String to be displayed in the
118: * user interface for this group/section
119: */
120: public void setDisplayName(String aDisplayName) {
121: mDisplayName = aDisplayName;
122: }
123:
124: /**
125: * Sets the Display Description attribute
126: *
127: * @param aDisplayDescription an I18n String to describe this group
128: * e.g. for inline help or tooltip
129: */
130: public void setDisplayDescription(String aDisplayDescription) {
131: mDisplayDescription = aDisplayDescription;
132: }
133:
134: /**
135: * Sets the Name attribute
136: *
137: * @param aName a non-I18n String to name this group
138: */
139: public void setName(String aName) {
140: mName = aName;
141: }
142:
143: /**
144: * Converts to a String representation of the object.
145: *
146: * @return A non-I18n String for logging the state of this object
147: */
148: public String toString() {
149: StringBuffer result = new StringBuffer(CN);
150: result.append(", mConfigProperties=[");
151: if (null != mConfigProperties) {
152: boolean first = true;
153: for (int i = 0; i < mConfigProperties.size(); ++i) {
154: if (!first) {
155: result.append(", ");
156: } else {
157: first = false;
158: }
159: result.append(mConfigProperties.get(i));
160: }
161: }
162: result.append("], mDisplayDescription=");
163: result.append(mDisplayDescription);
164: result.append(", mDisplayName=");
165: result.append(mDisplayName);
166: result.append(", mName=");
167: result.append(mName);
168:
169: return result.toString();
170: }
171:
172: // === static fields ===
173:
174: private static final String CN = ConfigPropertyGroup.class
175: .getName();
176:
177: // === member variables ===
178:
179: private String mDisplayDescription;
180: private String mDisplayName;
181: private List<ConfigProperty> mConfigProperties = null;
182: private String mName;
183: }
|