001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)Configuration.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.ui.runtime;
030:
031: import java.io.Serializable;
032: import java.util.HashMap;
033: import java.util.Iterator;
034: import java.util.Map;
035: import java.util.Set;
036: import java.util.Map.Entry;
037:
038: /**
039: * @author graj
040: *
041: */
042: public class ComponentConfiguration implements Serializable {
043: String name;
044:
045: Map<String, DisplayInformation> displayDetailsMap = new HashMap<String, DisplayInformation>();
046:
047: Map<String, DisplayInformation> labelDisplayDetailsMap = new HashMap<String, DisplayInformation>();
048:
049: /**
050: *
051: */
052: public ComponentConfiguration() {
053: // TODO Auto-generated constructor stub
054: }
055:
056: /**
057: * @return the name
058: */
059: public String getName() {
060: return name;
061: }
062:
063: /**
064: * @param name
065: * the name to set
066: */
067: public void setName(String componentName) {
068: this .name = componentName;
069: }
070:
071: /**
072: * @return the displayDetailsMap
073: */
074: public Map<String, DisplayInformation> getDisplayDetailsMap() {
075: return displayDetailsMap;
076: }
077:
078: public Map<String, DisplayInformation> getLabelDisplayDetailsMap() {
079: return labelDisplayDetailsMap;
080: }
081:
082: /**
083: * @param displayDetailsMap
084: * the displayDetailsMap to set
085: */
086: public void setDisplayDetailsMap(
087: Map<String, DisplayInformation> displayDetailsMap) {
088: this .displayDetailsMap = displayDetailsMap;
089: Set<Entry<String, DisplayInformation>> set = displayDetailsMap
090: .entrySet();
091: Entry<String, DisplayInformation> entry = null;
092: for (Iterator<Entry<String, DisplayInformation>> iterator = set
093: .iterator(); iterator.hasNext() == true;) {
094: entry = iterator.next();
095: if (entry != null) {
096: String ket = entry.getKey();
097: DisplayInformation info = entry.getValue();
098: if (info != null) {
099: this .labelDisplayDetailsMap.put(info
100: .getDisplayName(), info);
101: }
102: }
103: }
104: }
105:
106: /**
107: * @param displayDetailsMap
108: * the displayDetailsMap to set
109: */
110: public void setLabelDisplayDetailsMap(
111: Map<String, DisplayInformation> labelDisplayDetailsMap) {
112: this .labelDisplayDetailsMap = labelDisplayDetailsMap;
113: Set<Entry<String, DisplayInformation>> set = labelDisplayDetailsMap
114: .entrySet();
115: Entry<String, DisplayInformation> entry = null;
116: for (Iterator<Entry<String, DisplayInformation>> iterator = set
117: .iterator(); iterator.hasNext() == true;) {
118: entry = iterator.next();
119: if (entry != null) {
120: String ket = entry.getKey();
121: DisplayInformation info = entry.getValue();
122: if (info != null) {
123: this .displayDetailsMap.put(info.getAttributeName(),
124: info);
125: }
126: }
127: }
128: }
129:
130: /**
131: *
132: * @param attributeName
133: * @param value
134: * @return
135: */
136: public DisplayInformation addDisplayDetail(String attributeName,
137: DisplayInformation value) {
138: DisplayInformation returnValue = null;
139: if ((attributeName != null) && (value != null)) {
140: returnValue = this .displayDetailsMap.put(attributeName,
141: value);
142: this .labelDisplayDetailsMap.put(value.getDisplayName(),
143: value);
144: }
145: return returnValue;
146: }
147:
148: public void dump() {
149: System.out.println("name: " + name);
150: Entry<String, DisplayInformation> entry = null;
151: String key = null;
152: DisplayInformation value = null;
153: Set<Entry<String, DisplayInformation>> set = this .displayDetailsMap
154: .entrySet();
155: Iterator<Entry<String, DisplayInformation>> iterator = set
156: .iterator();
157: while (iterator.hasNext() == true) {
158: entry = iterator.next();
159: if (entry != null) {
160: key = entry.getKey();
161: value = entry.getValue();
162: value.dump();
163: }
164: }
165: }
166:
167: /**
168: * @param args
169: */
170: public static void main(String[] args) {
171: // TODO Auto-generated method stub
172:
173: }
174:
175: }
|