public class YSpecificationHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_TYPE_DEFINITION |
Constructor and Description |
---|
YSpecificationHandler()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAuthor(java.lang.String author)
Adds an author name to the current list of authors
|
java.lang.String |
checkID(java.lang.String id)
Checks an identifier for uniqueness, and appends a numeric suffix if necessary
|
void |
close()
Removes the current specification from all handlers
|
java.util.List<java.lang.String> |
getAuthors() |
YControlFlowHandler |
getControlFlowHandler()
The control-flow handler manages all aspects of the control-flow perspective
|
YDataHandler |
getDataHandler()
The data handler manages all aspects of the data perspective
|
java.lang.String |
getDescription() |
java.lang.String |
getFileName() |
FileSaveOptions |
getFileSaveOptions() |
YSpecificationID |
getID() |
YLayout |
getLayout() |
YMetaData |
getMetaData() |
YResourceHandler |
getResourceHandler()
The resource handler manages all aspects of the resource perspective
|
java.lang.String |
getSchema() |
YSpecification |
getSpecification() |
java.lang.String |
getSpecificationXML() |
java.lang.String |
getSpecificationXML(boolean includeLayout) |
java.lang.String |
getTitle() |
java.lang.String |
getUniqueID() |
java.lang.String |
getURI() |
java.util.Date |
getValidFrom() |
java.util.Date |
getValidUntil() |
YSpecVersion |
getVersion() |
boolean |
isLoaded() |
boolean |
isValidXMLIdentifier(java.lang.String id)
Checks whether an identifier is free of XML reserved characters
|
void |
load(java.lang.String fileName)
Loads a specification from file
|
void |
load(java.lang.String specXML,
java.lang.String layoutXML)
Loads an XML representation of a specification into this handler object
|
YSpecification |
newSpecification()
Creates a new base YAWL specification
|
void |
save()
Saves the current specification to file, using the previously set file save
options, or a default set if none saved
|
void |
save(FileSaveOptions saveOptions)
Saves the current specification to file, using the file save options passed
|
void |
save(YLayout layout)
Saves the current specification to file, using the previously set file save
options, or a default set if none saved, and the layout information passed
|
void |
save(YLayout layout,
FileSaveOptions saveOptions)
Saves the current specification to file, using the file save options and layout
information passed
|
void |
saveAs(java.lang.String fileName)
Saves the current specification to a new file name, using the previously set
file save options, or a default set if none saved
|
void |
saveAs(java.lang.String fileName,
FileSaveOptions saveOptions)
Saves the current specification to a new file name, using the file save options
passed
|
void |
saveAs(java.lang.String fileName,
YLayout layout)
Saves the current specification to a new file name, using the layout information
passed
|
void |
saveAs(java.lang.String fileName,
YLayout layout,
FileSaveOptions saveOptions)
Saves the current specification to a new file name, using the layout information
and file save options passed
|
void |
setAuthors(java.util.List<java.lang.String> authors)
Sets a list of author names
|
void |
setDescription(java.lang.String desc)
Sets a description of the specification
|
void |
setFileName(java.lang.String fileName) |
void |
setFileSaveOptions(FileSaveOptions options)
Sets the global options for future file saves.
|
void |
setLayout(YLayout layout)
Sets the layout information for the current specification
|
void |
setSchema(java.lang.String schema)
Sets the data schema for this specification
|
void |
setTitle(java.lang.String title)
Sets the specification's title (a non-unique descriptive term)
|
void |
setUniqueID()
Generates a unique identifier (UUID) for this specification
|
void |
setURI(java.lang.String uri)
Sets the URI (unique name identifier) of the specification
|
void |
setValidFrom(java.util.Date validFrom)
Sets the date from which this specification is considered to be 'in production'
|
void |
setValidUntil(java.util.Date validUntil)
Sets the date until which this specification is considered to be 'in production'
|
void |
setVersion(YSpecVersion version)
Sets the specification's version
|
public static final java.lang.String DEFAULT_TYPE_DEFINITION
public YSpecificationHandler()
public YSpecification newSpecification()
public YSpecification getSpecification()
public java.lang.String getSpecificationXML() throws java.io.IOException
java.io.IOException
- if there's a problem converting the specification to XMLpublic java.lang.String getSpecificationXML(boolean includeLayout) throws java.io.IOException
java.io.IOException
public java.lang.String getSchema()
public void setSchema(java.lang.String schema) throws YSyntaxException, YDataHandlerException
schema
- the data schemaYSyntaxException
- if the schema is invalidYDataHandlerException
public YDataHandler getDataHandler()
public YControlFlowHandler getControlFlowHandler()
public YResourceHandler getResourceHandler()
public boolean isLoaded()
public java.lang.String checkID(java.lang.String id) throws IllegalIdentifierException
id
- the identifier to checkIllegalIdentifierException
- if the identifier contains XML reserved charspublic boolean isValidXMLIdentifier(java.lang.String id)
id
- an identifier to checkpublic java.lang.String getURI()
public void setURI(java.lang.String uri) throws IllegalIdentifierException
uri
- the name to setIllegalIdentifierException
- if the identifier contains XML reserved charspublic java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the term to assign to the titlepublic java.lang.String getDescription()
public void setDescription(java.lang.String desc)
desc
- the descriptionpublic java.util.List<java.lang.String> getAuthors()
public void setAuthors(java.util.List<java.lang.String> authors)
authors
- the list of namespublic void addAuthor(java.lang.String author)
author
- the author name to addpublic YSpecVersion getVersion()
public void setVersion(YSpecVersion version)
version
- the versionpublic void setUniqueID()
public java.lang.String getUniqueID()
public java.util.Date getValidFrom()
public void setValidFrom(java.util.Date validFrom)
validFrom
- the datepublic java.util.Date getValidUntil()
public void setValidUntil(java.util.Date validUntil)
validUntil
- the datepublic YMetaData getMetaData()
public FileSaveOptions getFileSaveOptions()
FileSaveOptions
public void setFileSaveOptions(FileSaveOptions options)
options
- the file options to set.FileSaveOptions
public void load(java.lang.String specXML, java.lang.String layoutXML) throws java.io.IOException, YSyntaxException, YLayoutParseException
specXML
- the specification XMLlayoutXML
- XML of the graphical layout information for the specification
(optional: may be null)YSyntaxException
- if the specification XML fails validationYLayoutParseException
- if the layout XML fails validationjava.io.IOException
public void load(java.lang.String fileName) throws java.io.IOException, YSyntaxException, YLayoutParseException
fileName
- the absolute name of the filejava.io.IOException
- if there are problems loading or reading the fileYSyntaxException
- if the specification XML fails validationYLayoutParseException
- if the layout XML fails validationpublic void save() throws java.io.IOException
java.io.IOException
- if there's a problem writing the specification to disk filepublic void save(FileSaveOptions saveOptions) throws java.io.IOException
saveOptions
- the file save options to use for this savejava.io.IOException
- if there's a problem writing the specification to disk filepublic void save(YLayout layout) throws java.io.IOException
layout
- a YLayout object describing the layout information to use for
this savejava.io.IOException
- if there's a problem writing the specification to disk filepublic void save(YLayout layout, FileSaveOptions saveOptions) throws java.io.IOException
saveOptions
- the file save options to use for this savelayout
- a YLayout object describing the layout information to use for
this savejava.io.IOException
- if there's a problem writing the specification to disk filepublic void saveAs(java.lang.String fileName) throws java.io.IOException
fileName
- the absolute name of the new file to save tojava.io.IOException
- if there's a problem writing the specification to disk filepublic void saveAs(java.lang.String fileName, FileSaveOptions saveOptions) throws java.io.IOException
fileName
- the absolute name of the new file to save tosaveOptions
- the file save options to use for this savejava.io.IOException
- if there's a problem writing the specification to disk filepublic void saveAs(java.lang.String fileName, YLayout layout) throws java.io.IOException
fileName
- the absolute name of the new file to save tolayout
- the file save options to use for this savejava.io.IOException
- if there's a problem writing the specification to disk filepublic void saveAs(java.lang.String fileName, YLayout layout, FileSaveOptions saveOptions) throws java.io.IOException
fileName
- the absolute name of the new file to save tolayout
- the file save options to use for this savejava.io.IOException
- if there's a problem writing the specification to disk filepublic void close()
public java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
public YLayout getLayout()
public void setLayout(YLayout layout)
layout
- the layout to setpublic YSpecificationID getID()