站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss JBPM 3.0.4 API 英文版文档

SchemaValidationHelper (jbpm-3.0.4) - JBoss JBPM 3.0.4 API 英文版文档


org.jbpm.jpdl.xml
Class SchemaValidationHelper

java.lang.Object
  extended byorg.jbpm.jpdl.xml.SchemaValidationHelper

public class SchemaValidationHelper
extends java.lang.Object

Validate an XML document using JAXP techniques and an XML Schema. This helper class wraps the processing of a schema to aid in schema validation throughout the product.

Author:
Jim Rigsbee

Constructor Summary
SchemaValidationHelper(java.io.Reader reader, java.lang.String schemaName, java.lang.String subject)
          Constructs the schema validation helper and prepares it for reading the XML document.
 
Method Summary
 org.dom4j.Document getDocument()
          Accessor for the DOM model of the document.
 java.util.List getProblems()
           
 boolean isValid()
          Performs the schema validation on the document contents in the reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaValidationHelper

public SchemaValidationHelper(java.io.Reader reader,
                              java.lang.String schemaName,
                              java.lang.String subject)
Constructs the schema validation helper and prepares it for reading the XML document.

Parameters:
reader - input reader containing the contents of the XML document
schemaName - physical file name of the XML schema to be used for validation
subject - descriptive name of file we are parsing to put in error messages
Method Detail

isValid

public boolean isValid()
Performs the schema validation on the document contents in the reader. Full schema checking is performed using the 2001 XML schema for schemas from W3C. A document will be validated only if it is given a namespace in its root element.

Returns:
true - if the document is valid, false - if not valid, use getProblems() to retrieve a list of Problem objects detailing the schema validation errors.

getProblems

public java.util.List getProblems()
Returns:
a List of Problem objects detailing any errors found during schema validation

getDocument

public org.dom4j.Document getDocument()
Accessor for the DOM model of the document.

Returns:
Document representing the DOM model of the validated XML document


Version : jbpm-3.0.4