Package com.adaptris.util.text.xml
Class Validator
- java.lang.Object
-
- com.adaptris.util.text.xml.Validator
-
public class Validator extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Document
parse(java.io.InputStream xml)
method which parses an xml document from an input stream, validates it and returns the subsequent Document object.org.w3c.dom.Document
parse(java.io.Reader xml)
method which parses an xml document from a Reader, validates it and returns the subsequent Document object.org.w3c.dom.Document
parse(org.xml.sax.InputSource xml)
method which parses an xml document from an input source, validates it and returns the subsequent Document object.
-
-
-
Constructor Detail
-
Validator
public Validator(java.lang.String schema) throws java.lang.Exception
Constructor that creates a new Validator object- Parameters:
schema
- a valid url to the schema to process- Throws:
java.lang.Exception
- if a parse error is encountered
-
Validator
public Validator(java.lang.String schema, org.xml.sax.EntityResolver resolver) throws java.lang.Exception
Constructor that creates a new Validator object- Parameters:
schema
- a valid url to the schema to processresolver
- an EntityResolver to use to retrieve included / imported documents- Throws:
java.lang.Exception
- if a parse error is encountered
-
-
Method Detail
-
parse
public org.w3c.dom.Document parse(java.io.InputStream xml) throws java.lang.Exception
method which parses an xml document from an input stream, validates it and returns the subsequent Document object.- Parameters:
xml
- the xml document as input stream- Returns:
- the resultant Document (if parsing successful)
- Throws:
java.lang.Exception
- if the document fails to be validated
-
parse
public org.w3c.dom.Document parse(java.io.Reader xml) throws java.lang.Exception
method which parses an xml document from a Reader, validates it and returns the subsequent Document object.- Parameters:
xml
- the xml document as reader- Returns:
- the resultant Document (if parsing successful)
- Throws:
java.lang.Exception
- if the document fails to be validated
-
parse
public org.w3c.dom.Document parse(org.xml.sax.InputSource xml) throws java.lang.Exception
method which parses an xml document from an input source, validates it and returns the subsequent Document object.- Parameters:
xml
- the xml document as input source- Returns:
- the resultant Document (if parsing successful)
- Throws:
java.lang.Exception
- if the document fails to be validated
-
-