org.umber.bellows.schema
Class SchemaValidator

java.lang.Object
  extended byorg.umber.bellows.schema.SchemaValidator

public class SchemaValidator
extends java.lang.Object

General purpose XML validator. Compares the xml document against the provided schema and if it finds a schema violation, it throws an exception with a full description of the problem.

Author:
jsheets

Constructor Summary
SchemaValidator()
           
 
Method Summary
 void validate(BellowsSchema schema, Datum xml)
          Checks the XML tree against the provided schema and throws an exception if it does not follow the schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaValidator

public SchemaValidator()
Method Detail

validate

public void validate(BellowsSchema schema,
                     Datum xml)
              throws BellowsSchemaException
Checks the XML tree against the provided schema and throws an exception if it does not follow the schema. A null schema will always validate successfully; a null XML document will always trip an exception.

Parameters:
schema - generic Bellows schema
xml - Bellows XML tree
Throws:
BellowsSchemaException - if XML does not follow the schema