org.yawlfoundation.yawl.resourcing
Class AbstractSelector

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.AbstractSelector
Direct Known Subclasses:
AbstractAllocator, AbstractConstraint, AbstractFilter

public abstract class AbstractSelector
extends Object

The base class inherited by all of the 'selector' classes :- filters, constraints and allocators. As well as giving an inherited class a meaningful class name, extending classes need to provide values for: _name --> the class name _displayName --> a 'pretty' name to show to designers/users when required _description --> a user-oriented description of what the extending class does _params --> a set of parameters needed when applying the extending class's 'perform...' method (the param value should be set to null when initialised). Create Date: 03/08/2007. Last Date: 09/11/2007.

Version:
2.0
Author:
Michael Adams (BPM Group, QUT Australia)

Field Summary
protected  String _canonicalName
           
protected  String _description
           
protected  String _displayName
           
protected  String _name
           
protected  HashMap<String,String> _params
           
 
Constructor Summary
AbstractSelector()
           
AbstractSelector(String name)
           
AbstractSelector(String name, HashMap<String,String> params)
           
AbstractSelector(String name, String desc)
           
AbstractSelector(String name, String desc, HashMap<String,String> params)
           
 
Method Summary
 void addKey(String key)
          Adds a key - ie.
 void addParam(String key, String value)
          Adds a single parameter passed to the selector's parameters
 void addParams(Map<String,String> paramMap)
          Adds (does not replace) the parameters in the map passed to the selectors parameters
 String getCanonicalName()
           
 String getClassName()
           
 String getDescription()
           
 String getDisplayName()
           
protected  String getInformation(String outerTag)
          Gets a 'dump' of this selector object as an XML'd String
 Set<String> getKeys()
           
 String getName()
           
protected  Set<String> getParamKeys()
           
 HashMap getParams()
           
 String getParamValue(String key)
          Retrieves the value of the specified parameter
 void reconstitute(org.jdom.Element e)
          Fills the members of this object with values found in an XML description
 void setCanonicalName(String name)
          Stores the full class name of this 'selector'
 void setDescription(String desc)
          Sets the description of this 'selector'
 void setDisplayName(String name)
          Sets the user-friendly display name of this 'selector'
 void setKeyValue(String key, String value)
          Sets the value of a key (at specification design time)
 void setName(String name)
          Stores the class name of this 'selector'
 void setParams(Map<String,String> paramsMap)
          Sets (replaces) the parameters with the map passed
 String toString()
           
protected  String toXML()
           
protected static HashMap<String,String> unmarshalParams(org.jdom.Element eParams)
          Unpacks the xml describing the parameters to a HashMap object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

protected String _name

_canonicalName

protected String _canonicalName

_displayName

protected String _displayName

_description

protected String _description

_params

protected HashMap<String,String> _params
Constructor Detail

AbstractSelector

public AbstractSelector()

AbstractSelector

public AbstractSelector(String name)

AbstractSelector

public AbstractSelector(String name,
                        String desc)

AbstractSelector

public AbstractSelector(String name,
                        HashMap<String,String> params)

AbstractSelector

public AbstractSelector(String name,
                        String desc,
                        HashMap<String,String> params)
Method Detail

getParamKeys

protected Set<String> getParamKeys()
Returns:
a Set of parameter names needing values to be used in the performance of the selection

getName

public String getName()
Returns:
the name of this selector

getDisplayName

public String getDisplayName()
Returns:
the display name of this selector

getDescription

public String getDescription()
Returns:
how this selector is described

getKeys

public Set<String> getKeys()
Returns:
a Set of keys (ie. attribute names) for the expected params

getParams

public HashMap getParams()
Returns:
a HashMap of parameters of the form [name, value]

getClassName

public String getClassName()
Returns:
the name of this selector class

getCanonicalName

public String getCanonicalName()
Returns:
the full name of this selector class

getParamValue

public String getParamValue(String key)
Retrieves the value of the specified parameter

Parameters:
key - the name of the parameter
Returns:
the specified parameter's value

setName

public void setName(String name)
Stores the class name of this 'selector'

Parameters:
name - the name to set

setCanonicalName

public void setCanonicalName(String name)
Stores the full class name of this 'selector'

Parameters:
name - the name to set

setDisplayName

public void setDisplayName(String name)
Sets the user-friendly display name of this 'selector'

Parameters:
name - the name to set

setDescription

public void setDescription(String desc)
Sets the description of this 'selector'

Parameters:
desc - the description value to set

setParams

public void setParams(Map<String,String> paramsMap)
Sets (replaces) the parameters with the map passed

Parameters:
paramsMap - the new parameter map of the form [name, value] (both Strings)

addParams

public void addParams(Map<String,String> paramMap)
Adds (does not replace) the parameters in the map passed to the selectors parameters

Parameters:
paramMap - the new parameter map of the form [name, value] (both Strings)

addParam

public void addParam(String key,
                     String value)
Adds a single parameter passed to the selector's parameters

Parameters:
key - the name of the parameter
value - the value of the parameter

addKey

public void addKey(String key)
Adds a key - ie. an attribute which needs to be assigned a value at design time

Parameters:
key - the attribute name

setKeyValue

public void setKeyValue(String key,
                        String value)
Sets the value of a key (at specification design time)

Parameters:
key - the attribute name
value - the value to set

toString

public String toString()
Overrides:
toString in class Object

toXML

protected String toXML()
Returns:
an xml representation of this object's parameters (if any). Used to build the specification xml

unmarshalParams

protected static HashMap<String,String> unmarshalParams(org.jdom.Element eParams)
Unpacks the xml describing the parameters to a HashMap object

Parameters:
eParams -
Returns:
a [key, value] map of the parameters described by the Element

getInformation

protected String getInformation(String outerTag)
Gets a 'dump' of this selector object as an XML'd String

Parameters:
outerTag - a value for the surrounding tag (one of the extended classes)
Returns:
an XML String describing this object
See Also:
reconstitute(Element)

reconstitute

public void reconstitute(org.jdom.Element e)
Fills the members of this object with values found in an XML description

Parameters:
e - a JDOM Element containing the values
See Also:
getInformation(String)


Copyright © 2004-2012 The YAWL Foundation.