org.yawlfoundation.yawl.unmarshal
Class YawlXMLSpecificationValidator

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.yawlfoundation.yawl.unmarshal.YawlXMLSpecificationValidator
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class YawlXMLSpecificationValidator
extends DefaultHandler

Validates a specification XML against its appropriate schema.

Author:
Lachlan Aldred, Michael Adams (updated for 2.1)

Method Summary
 String checkSchema(InputSource input, YSchemaVersion version)
           
 String checkSchema(String specStr, YSchemaVersion version)
          Checks the schema agsinst the XML schema for that version.
 void error(SAXParseException ex)
           
 void fatalError(SAXParseException ex)
           
static YawlXMLSpecificationValidator getInstance()
           
 void warning(SAXParseException ex)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static YawlXMLSpecificationValidator getInstance()

warning

public void warning(SAXParseException ex)
Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler

error

public void error(SAXParseException ex)
Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
Throws:
SAXException

checkSchema

public String checkSchema(InputSource input,
                          YSchemaVersion version)

checkSchema

public String checkSchema(String specStr,
                          YSchemaVersion version)
Checks the schema agsinst the XML schema for that version.

Parameters:
specStr - the specification xml.
version - the spec version
Returns:
a string of error messages generated by XERCES with each error separated by a carriage return.


Copyright © 2004-2012 The YAWL Foundation.