org.yawlfoundation.yawl.unmarshal
Class YMarshal

java.lang.Object
  extended by org.yawlfoundation.yawl.unmarshal.YMarshal

public class YMarshal
extends Object

Marshals & Unmarshals specifications

Author:
Lachlan Aldred, Michael Adams (refactored for v2.0)

Constructor Summary
YMarshal()
           
 
Method Summary
static String marshal(List<YSpecification> specificationList, YSchemaVersion version)
          Builds an XML Document from a list of specifications
static String marshal(YSpecification specification)
          Builds an XML Document from a specification
static List<YSpecification> unmarshalSpecifications(String specStr)
          Builds a list of specification objects from a XML string.
static List<YSpecification> unmarshalSpecifications(String specStr, boolean schemaValidate)
          Builds a list of specification objects from a XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YMarshal

public YMarshal()
Method Detail

unmarshalSpecifications

public static List<YSpecification> unmarshalSpecifications(String specStr)
                                                    throws YSyntaxException
Builds a list of specification objects from a XML string. This method is equivalent to calling unmarshalSpecifications(String, boolean) with the 'schemaValidate' flag set to true.

Parameters:
specStr - the XML string describing the specification set
Returns:
a list of YSpecification objects taken from the XML string.
Throws:
YSyntaxException - if a parsed specification doesn't validate against schema

unmarshalSpecifications

public static List<YSpecification> unmarshalSpecifications(String specStr,
                                                           boolean schemaValidate)
                                                    throws YSyntaxException
Builds a list of specification objects from a XML string.

Parameters:
specStr - the XML string describing the specification set
schemaValidate - when true, will cause the specifications to be validated against schema while being parsed
Returns:
a list of YSpecification objects taken from the XML string.
Throws:
YSyntaxException - if a parsed specification doesn't validate against schema

marshal

public static String marshal(List<YSpecification> specificationList,
                             YSchemaVersion version)
Builds an XML Document from a list of specifications

Parameters:
specificationList - the list of specifications to build into an XML document 'specification set'
version - the appropriate schema version to use
Returns:
the XML Document, rendered as a String

marshal

public static String marshal(YSpecification specification)
Builds an XML Document from a specification

Parameters:
specification - the specification to build into an XML document 'specification set'
Returns:
the XML Document, rendered as a String


Copyright © 2004-2012 The YAWL Foundation.