com.counterclaim.openefm.lxml.validator
Class SimpleLxmlValidator

java.lang.Object
  extended bycom.counterclaim.openefm.core.AbstractOpenEFMComponent
      extended bycom.counterclaim.openefm.lxml.validator.SimpleLxmlValidator
All Implemented Interfaces:
LxmlValidator, OpenEFMComponent

public class SimpleLxmlValidator
extends AbstractOpenEFMComponent
implements LxmlValidator

 

Field Summary
protected  java.lang.String dtdFile
          Path to the DTD we want to validate against, relative to OpenEFM.home
protected static javax.xml.parsers.SAXParserFactory factory
          The SAXParserFactory that is created the first time we need it.
private static org.apache.log4j.Logger log
           
protected  javax.xml.parsers.SAXParser parser
          The SAXParser we will use to parse the input stream.
 
Fields inherited from class com.counterclaim.openefm.core.AbstractOpenEFMComponent
 
Constructor Summary
SimpleLxmlValidator()
           
 
Method Summary
private  boolean containsXml(LxmlFiling filing)
          Check if the filing's content is XML.
 java.lang.String getDtdFile()
           
 javax.xml.parsers.SAXParser getSAXParser()
          Return the SAXParser we will use to parse the input stream.
 void setDtdFile(java.lang.String dtdFile)
           
 ValidationFault[] validateFiling(LxmlFiling filing)
          Parse the content of a filing and validate it against the DTD.
 
Methods inherited from class com.counterclaim.openefm.core.AbstractOpenEFMComponent
getController, setController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.counterclaim.openefm.core.OpenEFMComponent
setController
 

Field Detail

log

private static org.apache.log4j.Logger log

parser

protected javax.xml.parsers.SAXParser parser
The SAXParser we will use to parse the input stream.


factory

protected static javax.xml.parsers.SAXParserFactory factory
The SAXParserFactory that is created the first time we need it.


dtdFile

protected java.lang.String dtdFile
Path to the DTD we want to validate against, relative to OpenEFM.home

Constructor Detail

SimpleLxmlValidator

public SimpleLxmlValidator()
Method Detail

getDtdFile

public java.lang.String getDtdFile()

setDtdFile

public void setDtdFile(java.lang.String dtdFile)

validateFiling

public ValidationFault[] validateFiling(LxmlFiling filing)
Parse the content of a filing and validate it against the DTD. No attempt at checking the content of the message is made.

Specified by:
validateFiling in interface LxmlValidator
Parameters:
filing - which we want to validate
Returns:
an array of ValidationFaults or null if OK

containsXml

private boolean containsXml(LxmlFiling filing)
Check if the filing's content is XML. Used to prevent passing non-XML to the parser.

Parameters:
filing -

getSAXParser

public javax.xml.parsers.SAXParser getSAXParser()
Return the SAXParser we will use to parse the input stream. If there is a problem creating the parser, return null.



Copyright © 2002 counterclaim.com. All Rights Reserved.