|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.cke.importexport.xml.DefaultGeneralParser
jcreek.cke.importexport.xml.XMLvalidater
The intention of this class is to help validate a XML file by specifying a Schema file. The XML file is first coarse tested if it is a valid XML file, and if that the case then the correct Schema path (the local Schema) is set. Then the validation against the specified Schema is performed. In case of faults during the validation, the error-messages are logged and may be retrieved.
Field Summary |
Fields inherited from class jcreek.cke.importexport.xml.DefaultGeneralParser |
DEFFERED_DOM, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, SCHEMA_FULL_SUPPORT, SCHEMA_SUPPORT, VALIDATION |
Constructor Summary | |
XMLvalidater(org.w3c.dom.Document document,
java.lang.String schemaPath)
Initializes the parser for validation by specifying a DOM document and the schema path. |
|
XMLvalidater(java.io.Reader source,
java.lang.String schemaPath)
Initializes the parser for validation by specifying a java.io.Reader with the DOM document and the schema path. |
|
XMLvalidater(java.lang.String filepath,
java.lang.String schemaPath)
Initializes the parser for validation by specifying a file path to the DOM document and the schema path. |
Method Summary | |
protected void |
correctSchemaPath(org.w3c.dom.Node node)
A method that tries to locate where in the DOM document the Schema is set. |
java.lang.String |
getDocRootNodeName(org.w3c.dom.Document document)
A method that retrieves the node name of the root node of the DOM document node. |
org.w3c.dom.Document |
getDocument()
A method that returns the DOM document. |
java.lang.String |
getErrorMsg()
Returns the Exception message |
java.lang.String |
getSchemaPath()
Returns the schema file name and path of the message |
protected void |
initParser(java.io.Reader source)
Initializes the parser. |
boolean |
isValid()
Checks to see if the message is a valid message according to the specified schema in the constructor |
Methods inherited from class jcreek.cke.importexport.xml.DefaultGeneralParser |
anyFaults, getAllFaultMsg, getErrorsMsg, getFatalErrorsMsg, getNumberOfErrors, getNumberOfFatalErrors, getNumberOfWarnings, getWarningsMsg, initParser, parse, parse, parse, parse, setFeature |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLvalidater(java.lang.String filepath, java.lang.String schemaPath)
filepath
- the file path to the DOM document to validateschemaPath
- the path to the local schema to validate againstjcreek.cke.helpers.xml.XMLvalidater#isValid()
public XMLvalidater(java.io.Reader source, java.lang.String schemaPath)
source
- a Reader with the DOM document to validateschemaPath
- the path to the local schema to validate againstjcreek.cke.helpers.xml.XMLvalidater#isValid()
public XMLvalidater(org.w3c.dom.Document document, java.lang.String schemaPath)
document
- the DOM document to validateschemaPath
- the path to the local schema to validate againstjcreek.cke.helpers.xml.XMLvalidater#isValid()
Method Detail |
public org.w3c.dom.Document getDocument()
public boolean isValid()
public java.lang.String getSchemaPath()
public java.lang.String getDocRootNodeName(org.w3c.dom.Document document)
document
- the DOM document to handle
public java.lang.String getErrorMsg()
protected void initParser(java.io.Reader source)
source
- the source of the document to parseprotected void correctSchemaPath(org.w3c.dom.Node node)
This method is recursive, but ends when the correct schema path is set. The schema used is the one specified in the constructors, and this method is also called by the constructors.
node
- the root node of the DOM document
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |