org.jbpm.wire.binding
Class MapBinding

java.lang.Object
  extended by org.jbpm.wire.binding.MapBinding
All Implemented Interfaces:
Binding

public class MapBinding
extends java.lang.Object
implements Binding

This Binding specifies a MapDescriptor.

A Map descriptor is defined by a <map> xml element.

This element can have an attribute "name", which specifies the name of the created object in the WireContext.

This element can have an attribute "class", which specifies the implementation of Map to use. If this attribute is not present, the HashMap implementation is used.

Map entries

Entries to add to the map can be specified with <entry> elements.

Each <entry> must contain a <key> element and a <value> element.

Each <key> and <value> elements should contain a Descriptor element.

Example

The following Xml declaration will create a TreeMap, and store it under the name 'm'. The map will contain two elements:
 <objects>
   <map name='m' class='java.util.TreeMap' >
     <entry>
       <key> <string value='foo'/> </key>
       <value> <object name='a' class='java.lang.Object' /> </value>
     </entry>
     <entry>
       <key> <string value='bar'/> </key>
       <value> <object name='b' class='java.lang.Object' /> </value>
     </entry>
   </map>
 </objects>

Author:
Tom Baeyens, Guillaume Porcher (documentation)
See Also:
WireParser

Constructor Summary
MapBinding()
           
 
Method Summary
 java.lang.Object parse(org.w3c.dom.Element element, Parse parse, Parser parser)
          translates the given element into a domain model java object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapBinding

public MapBinding()
Method Detail

parse

public java.lang.Object parse(org.w3c.dom.Element element,
                              Parse parse,
                              Parser parser)
Description copied from interface: Binding
translates the given element into a domain model java object. Use the parse to report problems.

Specified by:
parse in interface Binding
Returns:
the domain model java object.
See Also:
Parser