org.jbpm.wire.descriptor
Class MapDescriptor

java.lang.Object
  extended by org.jbpm.util.DefaultObservable
      extended by org.jbpm.wire.descriptor.AbstractDescriptor
          extended by org.jbpm.wire.descriptor.CollectionDescriptor
              extended by org.jbpm.wire.descriptor.MapDescriptor
All Implemented Interfaces:
java.io.Serializable, Observable, Descriptor
Direct Known Subclasses:
PropertiesDescriptor

public class MapDescriptor
extends CollectionDescriptor

This Descriptor creates a Map.

If no specific implementation for the Map is specified, a HashMap will be used.

Entries can be added during the map initialization. The list of entries (key, value) to add must be specified with two operations:

  1. setKeyDescriptors(List) sets the list of the keys to generate.
  2. CollectionDescriptor.setValueDescriptors(List) sets the list of value associated with these keys.
The two lists must be in the same order (the n-th element of the key list will be associated with the n-th element of the value list).

Author:
Tom Baeyens, Guillaume Porcher (documentation)
See Also:
Descriptor, Serialized Form

Field Summary
 
Fields inherited from class org.jbpm.wire.descriptor.CollectionDescriptor
className, isSynchronized, valueDescriptors
 
Fields inherited from class org.jbpm.wire.descriptor.AbstractDescriptor
dbid, dbversion, init, INIT_EAGER, INIT_IMMEDIATE, INIT_LAZY, INIT_REQUIRED, name, version
 
Fields inherited from class org.jbpm.util.DefaultObservable
listeners
 
Fields inherited from interface org.jbpm.wire.Descriptor
EVENT_CONSTRUCTED, EVENT_CONSTRUCTING, EVENT_INITIALIZING, EVENT_REMOVE, EVENT_SET
 
Constructor Summary
MapDescriptor()
           
 
Method Summary
 java.util.List<Descriptor> getKeyDescriptors()
           
 void initialize(java.lang.Object object, WireContext wireContext)
          called by the WireContext to initialize the specified object.
 void setKeyDescriptors(java.util.List<Descriptor> keyDescriptors)
           
 
Methods inherited from class org.jbpm.wire.descriptor.CollectionDescriptor
construct, getClassName, getValueDescriptors, isSynchronized, setClassName, setSynchronized, setValueDescriptors
 
Methods inherited from class org.jbpm.wire.descriptor.AbstractDescriptor
getDbid, getName, getType, isDelayable, isEagerInit, setInit, setName
 
Methods inherited from class org.jbpm.util.DefaultObservable
addListener, addListener, addListener, fire, fire, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbpm.wire.Descriptor
getName, getType, isDelayable, isEagerInit
 
Methods inherited from interface org.jbpm.util.Observable
addListener, addListener, addListener, fire, fire, removeListener
 

Constructor Detail

MapDescriptor

public MapDescriptor()
Method Detail

initialize

public void initialize(java.lang.Object object,
                       WireContext wireContext)
Description copied from interface: Descriptor
called by the WireContext to initialize the specified object. For more information about initialization, see WireContext section lifecycle.

Specified by:
initialize in interface Descriptor
Overrides:
initialize in class CollectionDescriptor
Parameters:
object - object to initialize.
wireContext - the context in which the object will be initialized.

getKeyDescriptors

public java.util.List<Descriptor> getKeyDescriptors()

setKeyDescriptors

public void setKeyDescriptors(java.util.List<Descriptor> keyDescriptors)