wt.workflow.definer
Class WfVariableMap

java.lang.Object
  extended bywt.workflow.definer.WfVariableMap
All Implemented Interfaces:
Externalizable, Serializable

public class WfVariableMap
extends Object
implements Externalizable

Class that represents the mapping between process and step variables. Only the names of the variables are actually stored. The class guarantees (class invariant) that each destination occurs only once. In other words, a variable can't receive data from two different sources.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  boolean dirty
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private  boolean oldVersion
           
private  Vector pairs
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static long SMALL_BLOB_VERSION_UID
           
private  String value
           
 
Constructor Summary
WfVariableMap()
          Default constructor

Supported API: false
WfVariableMap(String value)
          Cosntructor that takes as input an internal representation of a variable mapping.
 
Method Summary
 boolean addPair(WfVariableInfo src, WfVariableInfo dest)
          Adds a pair to the mapping.
private  void checkOldVersion(String value)
           
 WfVariableMap copy()
          Procudes a copy of the variable map.
private  void decodeValue()
           
 String[] getDestinations()
          Returns an array of Strings with all destination names defined in the mapping.
 String[] getDestinations(String src)
          Gets the destination name given a source name.
 String getSource(String dest)
          Gets the source names given the destination name.
 String[] getSources()
          Returns an array of Strings with all source names defined in the mapping.
protected  String getValue()
          Gets the value of the attribute: value; Holds internal representation of the mapping, namely, a comma separated string of pairs of variable names.
 VariableNamePair[] getVariablePairs()
          Returns an array with the variable name pairs of the variable map.
 boolean isMapped(String destination)
          Returns true if the destination is mapped by some source; otherwise it returns false.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(WfVariableMap thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 boolean removePair(String src, String dest)
          Removes a pair from the mapping.
 void reset()
          Empties map.
private  void setPairs()
           
private  void setStringValue()
           
protected  void setValue(String a_Value)
          Sets the value of the attribute: value; Holds internal representation of the mapping, namely, a comma separated string of pairs of variable names.
 String toString()
          Returns internal string representation of the object.
private  void valueValidate(String a_Value)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

value

private String value

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

SMALL_BLOB_VERSION_UID

public static final long SMALL_BLOB_VERSION_UID
See Also:
Constant Field Values

pairs

private Vector pairs

dirty

private boolean dirty

oldVersion

private boolean oldVersion
Constructor Detail

WfVariableMap

public WfVariableMap()
Default constructor

Supported API: false


WfVariableMap

public WfVariableMap(String value)
              throws DatastoreException
Cosntructor that takes as input an internal representation of a variable mapping.

Supported API: false

Parameters:
value -
Throws:
DatastoreException
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WfVariableMap thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getValue

protected String getValue()
Gets the value of the attribute: value; Holds internal representation of the mapping, namely, a comma separated string of pairs of variable names.

Supported API: false

Returns:
String

setValue

protected void setValue(String a_Value)
                 throws WTPropertyVetoException
Sets the value of the attribute: value; Holds internal representation of the mapping, namely, a comma separated string of pairs of variable names.

Supported API: false

Parameters:
a_Value -
Throws:
WTPropertyVetoException

valueValidate

private void valueValidate(String a_Value)
                    throws WTPropertyVetoException
Parameters:
a_Value -
Throws:
WTPropertyVetoException

addPair

public boolean addPair(WfVariableInfo src,
                       WfVariableInfo dest)
                throws WTException
Adds a pair to the mapping. May fail if adding a pair violates class invariant. Returns true is succeeds; false otherwise. Throws InvalidTypeException if variables are not type-compatible.

Supported API: false

Parameters:
src -
dest -
Returns:
boolean
Throws:
WTException

removePair

public boolean removePair(String src,
                          String dest)
Removes a pair from the mapping. May fail if pair doesn't exist in the map (which usually is of no consequence). Returns true is succeeds; false otherwise.

Supported API: false

Parameters:
src -
dest -
Returns:
boolean

getSource

public String getSource(String dest)
Gets the source names given the destination name. Returns null if there is no pair with the destination name.

Supported API: false

Parameters:
dest -
Returns:
String

getDestinations

public String[] getDestinations(String src)
Gets the destination name given a source name. Returns null if there is no pair with the source name.

Supported API: false

Parameters:
src -
Returns:
String[]

getSources

public String[] getSources()
Returns an array of Strings with all source names defined in the mapping.

Supported API: false

Returns:
String[]

getDestinations

public String[] getDestinations()
Returns an array of Strings with all destination names defined in the mapping.

Supported API: false

Returns:
String[]

toString

public String toString()
Returns internal string representation of the object.

Supported API: false

Returns:
String

copy

public WfVariableMap copy()
                   throws WTException
Procudes a copy of the variable map.

Supported API: false

Returns:
WfVariableMap
Throws:
WTException

getVariablePairs

public VariableNamePair[] getVariablePairs()
                                    throws WTException
Returns an array with the variable name pairs of the variable map.

Supported API: false

Returns:
VariableNamePair[]
Throws:
WTException

isMapped

public boolean isMapped(String destination)
Returns true if the destination is mapped by some source; otherwise it returns false.

Supported API: false

Parameters:
destination -
Returns:
boolean

reset

public void reset()
Empties map.

Supported API: false


setPairs

private void setPairs()

setStringValue

private void setStringValue()

checkOldVersion

private void checkOldVersion(String value)

decodeValue

private void decodeValue()