com.silverpeas.workflow.engine.model
Class ItemImpl

java.lang.Object
  extended by com.silverpeas.workflow.engine.AbstractReferrableObject
      extended by com.silverpeas.workflow.engine.model.ItemImpl
All Implemented Interfaces:
AbstractDescriptor, Item, ReferrableObjectIntf, Serializable

public class ItemImpl
extends AbstractReferrableObject
implements AbstractDescriptor, Item, Serializable

Class implementing the representation of the <item> element of a Process Model.

See Also:
Serialized Form

Constructor Summary
ItemImpl()
          Constructor
 
Method Summary
 void addDescription(ContextualDesignation description)
          Add a description Method needed primarily by Castor
 void addLabel(ContextualDesignation label)
          Add a label Method needed primarily by Castor
 void addParameter(Parameter parameter)
          Add a Parameter to the collection
 ContextualDesignation createDesignation()
          Create an object implementing ContextualDesignation Method needed primarily by Castor
 Parameter createParameter()
          Create an object implementing Parameter
 String getDescription(String role, String language)
          Get description in specific language for the given role
 ContextualDesignations getDescriptions()
          Get all the descriptions
 String getFormula()
          Get formula to use if item must be computed
 int getId()
           
 String getKey()
          Get the unique key, used by equals method
 Hashtable<String,String> getKeyValuePairs()
           
 String getLabel(String role, String language)
          Get label in specific language for the given role
 ContextualDesignations getLabels()
          Get all the labels
 String getMapTo()
          Get the full user field name, to which this item is map
 String getName()
          Get the name of this item
 Parameter getParameter(String strName)
          Get the parameter specified by name
 AbstractDescriptor getParent()
           
 String getType()
          Get the type of this item
 boolean hasId()
           
 boolean isComputed()
          Get value of computed attribute
 boolean isReadonly()
          Get value of readOnly attribute
 Iterator<ContextualDesignation> iterateDescription()
          Iterate through the descriptions
 Iterator<ContextualDesignation> iterateLabel()
          Iterate through the Labels
 Iterator<Parameter> iterateParameter()
          Return an Iterator over the parameters collection
 void removeParameter(String strName)
          Remove the parameter specified by its name
 void setComputed(boolean computed)
          Set value of computed attribute
 void setFormula(String formula)
          Set formula to use if item must be computed
 void setId(int id)
           
 void setMapTo(String mapTo)
          Set the full user field name, to which this item is map
 void setName(String name)
          Set the name of this item
 void setParent(AbstractDescriptor parent)
           
 void setReadonly(boolean readonly)
          Set value of readOnly attribute
 void setType(String type)
          Set the type of this item
 
Methods inherited from class com.silverpeas.workflow.engine.AbstractReferrableObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemImpl

public ItemImpl()
Constructor

Method Detail

isComputed

public boolean isComputed()
Get value of computed attribute

Specified by:
isComputed in interface Item
Returns:
true if item must be computed

getFormula

public String getFormula()
Get formula to use if item must be computed

Specified by:
getFormula in interface Item
Returns:
formula of type 'action.Validation.actor'

getMapTo

public String getMapTo()
Get the full user field name, to which this item is map

Specified by:
getMapTo in interface Item
Returns:
full user field name

getName

public String getName()
Get the name of this item

Specified by:
getName in interface Item
Returns:
item's name

isReadonly

public boolean isReadonly()
Get value of readOnly attribute

Specified by:
isReadonly in interface Item
Returns:
true if item must be readonly

getType

public String getType()
Get the type of this item

Specified by:
getType in interface Item
Returns:
item's type (text for text field)

setComputed

public void setComputed(boolean computed)
Description copied from interface: Item
Set value of computed attribute

Specified by:
setComputed in interface Item
Parameters:
computed - true if item must be computed

setFormula

public void setFormula(String formula)
Description copied from interface: Item
Set formula to use if item must be computed

Specified by:
setFormula in interface Item
Parameters:
formula - formula of type 'action.Validation.actor'

setMapTo

public void setMapTo(String mapTo)
Description copied from interface: Item
Set the full user field name, to which this item is map

Specified by:
setMapTo in interface Item
Parameters:
mapTo - full user field name

setName

public void setName(String name)
Description copied from interface: Item
Set the name of this item

Specified by:
setName in interface Item
Parameters:
name - item 's name

setReadonly

public void setReadonly(boolean readonly)
Description copied from interface: Item
Set value of readOnly attribute

Specified by:
setReadonly in interface Item
Parameters:
readonly - true if item must be readonly

setType

public void setType(String type)
Description copied from interface: Item
Set the type of this item

Specified by:
setType in interface Item
Parameters:
type - item 's type (text for text field)

getDescription

public String getDescription(String role,
                             String language)
Get description in specific language for the given role

Specified by:
getDescription in interface Item
Parameters:
lang - description's language
role - role for which the description is
Returns:
wanted description as a String object. If description is not found, search description with given role and default language, if not found again, return the default description in given language, if not found again, return the default description in default language, if not found again, return empty string.

getDescriptions

public ContextualDesignations getDescriptions()
Description copied from interface: Item
Get all the descriptions

Specified by:
getDescriptions in interface Item
Returns:
an object containing the collection of the descriptions

addDescription

public void addDescription(ContextualDesignation description)
Description copied from interface: Item
Add a description Method needed primarily by Castor

Specified by:
addDescription in interface Item

iterateDescription

public Iterator<ContextualDesignation> iterateDescription()
Description copied from interface: Item
Iterate through the descriptions

Specified by:
iterateDescription in interface Item
Returns:
an iterator

createDesignation

public ContextualDesignation createDesignation()
Description copied from interface: Item
Create an object implementing ContextualDesignation Method needed primarily by Castor

Specified by:
createDesignation in interface Item
Returns:

getLabel

public String getLabel(String role,
                       String language)
Get label in specific language for the given role

Specified by:
getLabel in interface Item
Parameters:
lang - label's language
role - role for which the label is
Returns:
wanted label as a String object. If label is not found, search label with given role and default language, if not found again, return the default label in given language, if not found again, return the default label in default language, if not found again, return empty string.

addLabel

public void addLabel(ContextualDesignation label)
Description copied from interface: Item
Add a label Method needed primarily by Castor

Specified by:
addLabel in interface Item

iterateLabel

public Iterator<ContextualDesignation> iterateLabel()
Description copied from interface: Item
Iterate through the Labels

Specified by:
iterateLabel in interface Item
Returns:
an iterator

getLabels

public ContextualDesignations getLabels()
Description copied from interface: Item
Get all the labels

Specified by:
getLabels in interface Item
Returns:
an object containing the collection of the labels

getParameter

public Parameter getParameter(String strName)
Description copied from interface: Item
Get the parameter specified by name

Specified by:
getParameter in interface Item
Parameters:
strName - the parameter name
Returns:
the parameters

createParameter

public Parameter createParameter()
Description copied from interface: Item
Create an object implementing Parameter

Specified by:
createParameter in interface Item
Returns:

addParameter

public void addParameter(Parameter parameter)
Description copied from interface: Item
Add a Parameter to the collection

Specified by:
addParameter in interface Item

iterateParameter

public Iterator<Parameter> iterateParameter()
Description copied from interface: Item
Return an Iterator over the parameters collection

Specified by:
iterateParameter in interface Item
Returns:

removeParameter

public void removeParameter(String strName)
                     throws WorkflowException
Description copied from interface: Item
Remove the parameter specified by its name

Specified by:
removeParameter in interface Item
Parameters:
strName - the name of the parameter
Throws:
WorkflowException - when the parameter cannot be found

getKey

public String getKey()
Get the unique key, used by equals method

Specified by:
getKey in interface ReferrableObjectIntf
Specified by:
getKey in class AbstractReferrableObject
Returns:
unique key
See Also:
equals, hashCode

getKeyValuePairs

public Hashtable<String,String> getKeyValuePairs()
Specified by:
getKeyValuePairs in interface Item
Returns:

setId

public void setId(int id)
Specified by:
setId in interface AbstractDescriptor

getId

public int getId()
Specified by:
getId in interface AbstractDescriptor

setParent

public void setParent(AbstractDescriptor parent)
Specified by:
setParent in interface AbstractDescriptor

getParent

public AbstractDescriptor getParent()
Specified by:
getParent in interface AbstractDescriptor

hasId

public boolean hasId()
Specified by:
hasId in interface AbstractDescriptor


Copyright © 2016 Silverpeas. All Rights Reserved.