org.yawlfoundation.yawl.engine
Class YSpecificationID

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.YSpecificationID
All Implemented Interfaces:
Comparable<YSpecificationID>

public class YSpecificationID
extends Object
implements Comparable<YSpecificationID>

The unique identifier of a specification. NOTE: For schema versions prior to 2.0, the spec's uri was used as its identifier, but since a user-defined uri cannot guarantee uniqueness, the identifier field was introduced for v2.0 (which will theoretically always be unique). Specification versioning was also introduced in v2.0. Therefore, to handle specifications of different schema versions: - all pre-2.0 schema based specifications are given a default version of '0.1' - all pre-2.0 schema based specifications will have a null 'identifier' field and the 'uri' field will be used to 'uniquely' identify the specification - all 2.0 and later schema based specifications will use the 'identifier' field to uniquely identify a specification-version family (all versions of a specification have the same identifier). The getKey method is used to determine which of 'identifier' or 'uri' is used as the unique identifier.

Author:
Mike Fowler Date: 05-Sep-2006, Michael Adams 08-09 heavily modified for versions 2.0 - 2.1

Constructor Summary
YSpecificationID()
           
YSpecificationID(String uri)
           
YSpecificationID(String identifier, String version, String uri)
           
YSpecificationID(String identifier, YSpecVersion version, String uri)
           
YSpecificationID(WorkItemRecord wir)
           
 
Method Summary
 int compareTo(YSpecificationID o)
           
 boolean equals(Object obj)
           
 String getIdentifier()
           
 String getKey()
           
 String getUri()
           
 YSpecVersion getVersion()
           
 String getVersionAsString()
           
 int hashCode()
           
 boolean hasMatchingIdentifier(YSpecificationID other)
           
 boolean isPreviousVersionOf(YSpecificationID other)
           
 boolean isValid()
           
 void setIdentifier(String identifier)
           
 void setUri(String n)
           
 void setVersion(String ver)
           
 void setVersion(YSpecVersion ver)
           
 String toKeyString()
           
 Map<String,String> toMap()
           
 String toString()
           
 String toXML()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

YSpecificationID

public YSpecificationID()

YSpecificationID

public YSpecificationID(String identifier,
                        YSpecVersion version,
                        String uri)

YSpecificationID

public YSpecificationID(String identifier,
                        String version,
                        String uri)

YSpecificationID

public YSpecificationID(WorkItemRecord wir)

YSpecificationID

public YSpecificationID(String uri)
Method Detail

getIdentifier

public String getIdentifier()

getVersionAsString

public String getVersionAsString()

getVersion

public YSpecVersion getVersion()

getUri

public String getUri()

getKey

public String getKey()

setIdentifier

public void setIdentifier(String identifier)

setVersion

public void setVersion(String ver)

setVersion

public void setVersion(YSpecVersion ver)

setUri

public void setUri(String n)

isValid

public boolean isValid()

isPreviousVersionOf

public boolean isPreviousVersionOf(YSpecificationID other)

hasMatchingIdentifier

public boolean hasMatchingIdentifier(YSpecificationID other)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toKeyString

public String toKeyString()

compareTo

public int compareTo(YSpecificationID o)
Specified by:
compareTo in interface Comparable<YSpecificationID>

toMap

public Map<String,String> toMap()

toXML

public String toXML()


Copyright © 2004-2012 The YAWL Foundation.