com.japisoft.xmlpad.validator
Class DefaultValidator

java.lang.Object
  extended bycom.japisoft.xmlpad.validator.DefaultValidator
All Implemented Interfaces:
org.xml.sax.ErrorHandler, Validator

public class DefaultValidator
extends java.lang.Object
implements Validator, org.xml.sax.ErrorHandler

This is a validation action for checking the XMLContent of the XMLContainer. Note that the default implementation doesn't build a DOM document. For building a DOM document from the DomBuilderMode property must be activated.

Version:
1.1
Author:
(c) 2004 JAPISoft / http://www.japisoft.com

Field Summary
 
Fields inherited from interface com.japisoft.xmlpad.validator.Validator
ERROR, OK
 
Constructor Summary
DefaultValidator()
           
DefaultValidator(boolean domBuilderMode)
          If true, a DOM document will be built and retreive using the getDocument method.
DefaultValidator(boolean domBuilderMode, boolean ToValidating)
          If true, a DOM document will be built and retreive using the getDocument method.
 
Method Summary
 void dispose()
           
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
 org.w3c.dom.Document getDocument()
           
 boolean hasError()
          An error has been found while parsing
 boolean notifyAction(XMLContainer container)
           
 void setDomBuilderMode(boolean domBuilderMode)
          Include a DOM builder for retreiving a full DOM document from the parsing action.
 boolean validate(XMLContainer container)
          Validate the XML content bound to this container.
 void warning(org.xml.sax.SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultValidator

public DefaultValidator()

DefaultValidator

public DefaultValidator(boolean domBuilderMode)
If true, a DOM document will be built and retreive using the getDocument method.

Parameters:
domBuilderMode -

DefaultValidator

public DefaultValidator(boolean domBuilderMode,
                        boolean ToValidating)
If true, a DOM document will be built and retreive using the getDocument method.

Parameters:
domBuilderMode - Build a final DOM document
Method Detail

validate

public boolean validate(XMLContainer container)
Description copied from interface: Validator
Validate the XML content bound to this container. It must return

Specified by:
validate in interface Validator

setDomBuilderMode

public void setDomBuilderMode(boolean domBuilderMode)
Include a DOM builder for retreiving a full DOM document from the parsing action. By default this property is false

Parameters:
domBuilderMode - If true a DOM document will be built using the parsing action

notifyAction

public boolean notifyAction(XMLContainer container)

getDocument

public org.w3c.dom.Document getDocument()
Returns:
a DOM document after the parsing process. Note that the domBuilderMode must be enabled for having a document

dispose

public void dispose()

hasError

public boolean hasError()
An error has been found while parsing


warning

public void warning(org.xml.sax.SAXParseException exception)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException


Copyright © 2006 JAPISoft. All Rights Reserved.