[jboss-svn-commits] JBL Code SVN: r6809 - labs/jbossesb/workspace/eschifman/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Oct 15 10:55:51 EDT 2006


Author: estebanschifman
Date: 2006-10-15 10:55:49 -0400 (Sun, 15 Oct 2006)
New Revision: 6809

Modified:
   labs/jbossesb/workspace/eschifman/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java
Log:
new List<KeyValuePair> attributesAsList() method for older action processor constructors

Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java	2006-10-14 22:07:21 UTC (rev 6808)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java	2006-10-15 14:55:49 UTC (rev 6809)
@@ -114,6 +114,18 @@
 		: _attributes.keySet();
 	} // _______________________________
 	/**
+	 * obtain the list of all attribute as a List<KeyValuePair>
+	 * @return List<KeyValuePair> - containing all attributes
+	 */
+	public List<KeyValuePair> attributesAsList() 
+	{
+		List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
+		if (null!=_attributes) 
+			for (Map.Entry<String,String> oCurr : _attributes.entrySet())
+				oRet.add(new KeyValuePair(oCurr.getKey(),oCurr.getValue()));
+		return oRet;
+	} // _______________________________
+	/**
 	 * concatenated values of all child String values that have been added to 'this'
 	 * <br/>"" (zero length String) if no String child nodes
 	 * @return String - concatenation of all String segments (equivalent to xml text nodes)
@@ -263,6 +275,7 @@
 	/**
 	 * instantiate a new ConfigTree with the same topology and contents of 'this'
 	 * <br/>Contained ConfigTree child elements will also be cloned
+	 * <br/>Transient objects are NOT copied nor cloned
 	 * @return ConfigTree - Deep copy of 'this'
 	 */
 	public ConfigTree cloneObj() {return cloneSubtree(null); } 
@@ -289,7 +302,7 @@
 	} // __________________________________
 /**
  * obtain an instance of this class, from a 'normalized' xml format, with the default encoding
- * <p/> the 'normalized' xml format is the output of the toXml() instance method 
+ * <p/> the 'normalized' xml format is the output of the toXml() instance method
  * @param xml String - what to parse
  * @return ConfigTree - an object of this class
  * @throws SAXException - if xml format is invalid
@@ -418,6 +431,7 @@
 	} // __________________________________
 	
 	/**
+	 * Serialize this object - Transient objects are
 	 * @param encoding String - String 
 	 * @return String - a String with the 'standard' xml representation of 'this',
 	 * using encoding specified in arg0
@@ -456,8 +470,38 @@
 
 		return oStrm.toString();
 	} // __________________________________
+	
 	/**
+	 * Store an arbitrary object in a 'transient' object Map
+	 * @param key String
+	 * @param value Object - if &lt;null&gt; => old object will be removed and no new value stored
+	 * @return Object - The previous value stored under the key  -   &lt;null&gt; if none was
+	 */
+//	public Object setTransient(String key, Object value)
+//	{
+//		if (null==key)
+//			throw new IllegalArgumentException("Key must be not null");
+//		if (null==_transients)
+//			_transients = new HashMap<String,Object>();
+//		Object oRet = _transients.remove(key);
+//		if (null!=value)
+//			_transients.put(key,value);
+//		return oRet;
+//	} //________________________________
+	
+	/**
 	 * 
+	 * @return Object - value stored in the map of transient objects 
+	 */
+//	public Object getTransient(String key) 
+//	{
+//		if (null==key)
+//			throw new IllegalArgumentException("Key must be not null");
+//		return (null==_transients) ? null : _transients.get(key); 
+//	} //________________________________
+	
+	/**
+	 * 
 	 * @return boolean - indicating if 'this' element has ONLY text children (and consequently no ConfigTree children)
 	 */
 	public boolean isPureText() { return _pureText; }
@@ -487,5 +531,6 @@
 	private String 				_name;
 	private Map<String,String> 	_attributes;
 	private List<Child>			_childs;
-	private static Logger		_logger = Logger.getLogger(ConfigTree.class);
+
+	private static transient Logger			_logger = Logger.getLogger(ConfigTree.class);
 } //____________________________________________________________________________




More information about the jboss-svn-commits mailing list