org.yawlfoundation.yawl.elements.data
Class YVariable

java.lang.Object
  extended by org.yawlfoundation.yawl.elements.data.YVariable
All Implemented Interfaces:
Cloneable, Comparable<YVariable>, YVerifiable
Direct Known Subclasses:
YParameter

public class YVariable
extends Object
implements Cloneable, YVerifiable, Comparable<YVariable>

Author:
Lachlan Aldred Date: 24/09/2003 Time: 16:10:14

Field Summary
protected  String _dataTypeName
           
protected  String _defaultValue
           
protected  String _elementName
           
protected  String _initialValue
           
protected  boolean _isEmptyTyped
           
protected  boolean _isUntyped
           
protected  String _name
           
protected  String _namespaceURI
           
protected  int _ordering
           
protected  YDecomposition _parentDecomposition
           
 
Constructor Summary
YVariable()
           
YVariable(YDecomposition dec)
          Beta 3 constructer for variables
YVariable(YDecomposition dec, String dataType, String name, String initialValue, String namespaceURI)
          Deprecated. see new constructor and setter methods
 
Method Summary
 void addAttribute(String key, String value)
           
 Object clone()
           
 int compareTo(YVariable other)
           
 YAttributeMap getAttributes()
          Return table of attributes associated with this variable.
 String getDataTypeName()
           
 String getDataTypeNameSpace()
          Returns the namespace of the data type.
 String getDataTypeNameUnprefixed()
           
 String getDataTypePrefix()
           
 String getDefaultValue()
           
 String getDocumentation()
           
 String getElementName()
           
 String getInitialValue()
           
 YLogPredicate getLogPredicate()
           
 String getName()
           
 int getOrdering()
           
 YDecomposition getParentDecomposition()
           
 String getPreferredName()
           
 boolean hasAttributes()
           
 boolean isEmptyTyped()
           
 boolean isMandatory()
           
 boolean isOptional()
           
 boolean isRequired()
           
 boolean isUntyped()
           
 boolean isUserDefinedType()
           
 void setAttributes(Hashtable<String,String> attributes)
           
 void setDataTypeAndName(String dataType, String name, String namespace)
          sets three related attributes.
 void setDefaultValue(String value)
           
 void setDocumentation(String documentation)
           
 void setElementName(String elementName)
          links the variable to a schema element declaration
 void setEmptyTyped(boolean empty)
           
 void setInitialValue(String initialValue)
          sets the initial value of the variable
 void setLogPredicate(YLogPredicate predicate)
           
 void setMandatory(boolean mandatory)
           
 void setName(String name)
          Sets the name on the variabel.
 void setOptional(boolean option)
           
 void setOrdering(int ordering)
           
 void setParentDecomposition(YDecomposition parentDecomposition)
           
 void setUntyped(boolean isUntyped)
          links the variable to a xs:any schema element type.
 String toString()
           
 String toXML()
           
protected  String toXMLGuts()
           
 boolean usesElementDeclaration()
          Returns whether or not the parameter uses an element declaration in the schema library of the specification.
 boolean usesTypeDeclaration()
          Returns whether or not the parameter uses a type declaration in the schema library of the specification.
 List<YVerificationMessage> verify()
          Internally verify the object against YAWL language semantics and report any errors and/or warnings.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_parentDecomposition

protected YDecomposition _parentDecomposition

_dataTypeName

protected String _dataTypeName

_name

protected String _name

_elementName

protected String _elementName

_initialValue

protected String _initialValue

_defaultValue

protected String _defaultValue

_namespaceURI

protected String _namespaceURI

_isUntyped

protected boolean _isUntyped

_isEmptyTyped

protected boolean _isEmptyTyped

_ordering

protected int _ordering
Constructor Detail

YVariable

public YVariable()

YVariable

public YVariable(YDecomposition dec,
                 String dataType,
                 String name,
                 String initialValue,
                 String namespaceURI)
Deprecated. see new constructor and setter methods

old method

Parameters:
dec -
dataType -
name -
initialValue -
namespaceURI -

YVariable

public YVariable(YDecomposition dec)
Beta 3 constructer for variables

Parameters:
dec - parent decomposition
Method Detail

setDataTypeAndName

public void setDataTypeAndName(String dataType,
                               String name,
                               String namespace)
sets three related attributes.

Parameters:
dataType - (mandatory) the datatype
name - (mandatory) name of the var
namespace - (null optional) the URI of the namespace for the type

setUntyped

public void setUntyped(boolean isUntyped)
links the variable to a xs:any schema element type.

Parameters:
isUntyped -

setName

public void setName(String name)
Sets the name on the variabel.

Parameters:
name -

setElementName

public void setElementName(String elementName)
links the variable to a schema element declaration

Parameters:
elementName -

getDataTypeName

public String getDataTypeName()
Returns:
the name reference for the data type to be used in this variable.

getDataTypeNameUnprefixed

public String getDataTypeNameUnprefixed()

getDataTypePrefix

public String getDataTypePrefix()

getDataTypeNameSpace

public String getDataTypeNameSpace()
Returns the namespace of the data type. Expect either null if the type is a custom type or "http://www.w3.org/2001/XMLSchema" if the variable uses a "built in" Schema primitive type.

Returns:
null or "http://www.w3.org/2001/XMLSchema"

isUserDefinedType

public boolean isUserDefinedType()

isMandatory

public boolean isMandatory()

setMandatory

public void setMandatory(boolean mandatory)

getName

public String getName()

getPreferredName

public String getPreferredName()

getParentDecomposition

public YDecomposition getParentDecomposition()

setParentDecomposition

public void setParentDecomposition(YDecomposition parentDecomposition)

getInitialValue

public String getInitialValue()

getDefaultValue

public String getDefaultValue()

setDefaultValue

public void setDefaultValue(String value)

getLogPredicate

public YLogPredicate getLogPredicate()

setLogPredicate

public void setLogPredicate(YLogPredicate predicate)

setOrdering

public void setOrdering(int ordering)

getOrdering

public int getOrdering()

compareTo

public int compareTo(YVariable other)
Specified by:
compareTo in interface Comparable<YVariable>

toXML

public String toXML()

toXMLGuts

protected String toXMLGuts()

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

verify

public List<YVerificationMessage> verify()
Description copied from interface: YVerifiable
Internally verify the object against YAWL language semantics and report any errors and/or warnings.

Specified by:
verify in interface YVerifiable
Returns:
a List of YVerificationMessage objects
See Also:
YVerificationMessage

setInitialValue

public void setInitialValue(String initialValue)
sets the initial value of the variable

Parameters:
initialValue -

getDocumentation

public String getDocumentation()

setDocumentation

public void setDocumentation(String documentation)

getElementName

public String getElementName()

isUntyped

public boolean isUntyped()

isEmptyTyped

public boolean isEmptyTyped()

setEmptyTyped

public void setEmptyTyped(boolean empty)

usesElementDeclaration

public boolean usesElementDeclaration()
Returns whether or not the parameter uses an element declaration in the schema library of the specification.

Returns:
true if it does use element declaration

usesTypeDeclaration

public boolean usesTypeDeclaration()
Returns whether or not the parameter uses a type declaration in the schema library of the specification.

Returns:
true if it does use a type declaration

isRequired

public boolean isRequired()

isOptional

public boolean isOptional()

setOptional

public void setOptional(boolean option)

getAttributes

public YAttributeMap getAttributes()
Return table of attributes associated with this variable.

Table is keyed by attribute 'name' and contains the string representation of the XML elements attribute.

Returns:
the Map of attributes for this parameter

addAttribute

public void addAttribute(String key,
                         String value)

setAttributes

public void setAttributes(Hashtable<String,String> attributes)

hasAttributes

public boolean hasAttributes()


Copyright © 2004-2012 The YAWL Foundation.