org.jboss.soa.esb.listeners.config
Class XmlValidatorImpl

java.lang.Object
  extended by org.jboss.soa.esb.listeners.config.XmlValidatorImpl
All Implemented Interfaces:
XmlValidator

public class XmlValidatorImpl
extends java.lang.Object
implements XmlValidator

A Helper classes used to validate xml files against supplied schemas.

Author:
$Revision: 179681 $ $Id$

Constructor Summary
XmlValidatorImpl()
           
XmlValidatorImpl(org.xml.sax.InputSource xmlSource)
           
 
Method Summary
 java.util.Collection<java.lang.String> getValidationResults()
          If the validation fails, more details can be obtained about the reasons why.
 org.w3c.dom.Document getXMLDocument()
          After validation the parsed document can be obtained for further processing.
 void setXMLDocument(org.xml.sax.InputSource xmlSource)
           
 boolean validate(org.xml.sax.InputSource xmlSource)
          Validation method used to validate an xml file against a default xsd (jbossesb-1.0.1.xsd).
 boolean validate(org.xml.sax.InputSource xmlSource, javax.xml.transform.stream.StreamSource validationSource)
          Validation method used to validate an xml input source against an xsd input source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlValidatorImpl

public XmlValidatorImpl()

XmlValidatorImpl

public XmlValidatorImpl(org.xml.sax.InputSource xmlSource)
Method Detail

validate

public boolean validate(org.xml.sax.InputSource xmlSource)
                 throws XmlValidatorException
Validation method used to validate an xml file against a default xsd (jbossesb-1.0.1.xsd).

Specified by:
validate in interface XmlValidator
Parameters:
xmlSource - The xml input source to be validated.
Returns:
Boolean true/false indicating successful validation.
Throws:
XmlValidatorException - Failure during validation.

validate

public boolean validate(org.xml.sax.InputSource xmlSource,
                        javax.xml.transform.stream.StreamSource validationSource)
                 throws XmlValidatorException
Validation method used to validate an xml input source against an xsd input source.

Specified by:
validate in interface XmlValidator
Parameters:
xmlSource - The xml input source to be validated.
validationSource - The schema input source to validate against.
Returns:
Boolean true/false indicating successful validation.
Throws:
XmlValidationException - Failure during validation.
XmlValidatorException

getValidationResults

public java.util.Collection<java.lang.String> getValidationResults()
Description copied from interface: XmlValidator
If the validation fails, more details can be obtained about the reasons why.

Specified by:
getValidationResults in interface XmlValidator
Returns:
Collection Strings

setXMLDocument

public void setXMLDocument(org.xml.sax.InputSource xmlSource)

getXMLDocument

public org.w3c.dom.Document getXMLDocument()
Description copied from interface: XmlValidator
After validation the parsed document can be obtained for further processing.

Specified by:
getXMLDocument in interface XmlValidator
Returns:
Document, the parsed XML Document.