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: * @(#)ConfigBean.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.engine.xslt.util;
030:
031: import com.sun.jbi.engine.xslt.TEResources;
032:
033: import java.util.Hashtable;
034: import java.util.Vector;
035: import java.util.logging.Logger;
036:
037: /**
038: * This Bean object holds all the attributes of an endpoint.
039: *
040: * @author Sun Microsystems, Inc.
041: */
042: public class ConfigBean implements TEResources {
043: /**
044: * Table for storing the xml tags and values present in the config file.
045: * This table stores throws filebinding sepcific configuration
046: * information correspondint to each endpoint.
047: */
048: private Hashtable mConfigTable = null;
049:
050: /**
051: *
052: */
053: private StringTranslator mTranslator = null;
054:
055: /**
056: * Constructor. Creates a new Table.
057: */
058: public ConfigBean() {
059: mTranslator = new StringTranslator("com.sun.jbi.engine.xslt",
060: this .getClass().getClassLoader());
061: mConfigTable = new Hashtable();
062: }
063:
064: /**
065: * DOCUMENT ME!
066: *
067: * @return NOT YET DOCUMENTED
068: */
069: public Hashtable getTable() {
070: return mConfigTable;
071: }
072:
073: /**
074: * Sets the value for the key in the table.
075: *
076: * @param key for which value has to be retrieved.
077: * @param value corresponding to the key
078: */
079: public void setValue(String key, String value) {
080: if (key == null) {
081: return;
082: }
083:
084: if (value == null) {
085: value = "";
086: }
087:
088: Object obj = mConfigTable.get(key);
089:
090: if (obj == null) {
091: Vector vec = new Vector();
092: vec.addElement(value);
093: mConfigTable.put(key, vec);
094: } else {
095: ((Vector) obj).addElement(value);
096: }
097: }
098:
099: /**
100: * Returns the value associated with the key from the table.
101: *
102: * @param key the tag name for wcich value is required.
103: *
104: * @return value corresponding to the tag as in config file.
105: */
106: public Vector getValue(String key) {
107: if (key == null) {
108: return null;
109: }
110:
111: return (Vector) mConfigTable.get(key);
112: }
113: }
|