DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.input
Class RecordValidationFilter

java.lang.Object
  extended by org.dlese.dpc.webapps.servlets.filters.FilterCore
      extended by org.dlese.dpc.webapps.servlets.filters.XMLPostProcessingFilter
          extended by org.dlese.dpc.schemedit.input.RecordValidationFilter
All Implemented Interfaces:
Filter

public final class RecordValidationFilter
extends XMLPostProcessingFilter

Filter that validates XML and updates dcsDataRecord with the results of validation. Based on XMLValidationFilter

Author:
Jonathan Ostwald

Constructor Summary
RecordValidationFilter()
           
 
Method Summary
 void destroy()
          Destroy is called at application shut-down time.
protected  String getValidationMessage(String xml, ServletRequest req)
          Performs XML post-processing and gzipping of the response.
 void init(FilterConfig config)
          Init is called once at application start-up.
protected  void prtln(String s)
          Output a line of text to standard out, with datestamp, if debug is set to true.
protected  void setDebug(boolean db)
          Sets the debug attribute of the RecordValidationFilter object
protected  String xmlToHtml(String xml)
          Get html-displayable version of provided xml
 
Methods inherited from class org.dlese.dpc.webapps.servlets.filters.XMLPostProcessingFilter
doFilter, prtlnErr, setDebugz
 
Methods inherited from class org.dlese.dpc.webapps.servlets.filters.FilterCore
getDateStamp, handleErrorCodes, isGzipSupported, prtlnCore, writeGzipResponse, writeRegularResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordValidationFilter

public RecordValidationFilter()
Method Detail

getValidationMessage

protected String getValidationMessage(String xml,
                                      ServletRequest req)
Performs XML post-processing and gzipping of the response.

Overrides:
getValidationMessage in class XMLPostProcessingFilter
Parameters:
request - The request
response - The response
chain - The chain of Filters
Returns:
The validationMessage value or null if xml is valid
Throws:
ServletException - Iff error
IOException - Iff IO error

xmlToHtml

protected String xmlToHtml(String xml)
Description copied from class: XMLPostProcessingFilter
Get html-displayable version of provided xml

Overrides:
xmlToHtml in class XMLPostProcessingFilter
Parameters:
xml - xml to be displayed as html
Returns:
html as string

init

public void init(FilterConfig config)
          throws ServletException
Init is called once at application start-up.

Specified by:
init in interface Filter
Overrides:
init in class XMLPostProcessingFilter
Parameters:
config - The FilterConfig object that holds the ServletContext and init information.
Throws:
ServletException - If an error occurs

destroy

public void destroy()
Destroy is called at application shut-down time.

Specified by:
destroy in interface Filter
Overrides:
destroy in class XMLPostProcessingFilter

prtln

protected void prtln(String s)
Output a line of text to standard out, with datestamp, if debug is set to true.

Overrides:
prtln in class XMLPostProcessingFilter
Parameters:
s - The String that will be output.

setDebug

protected void setDebug(boolean db)
Sets the debug attribute of the RecordValidationFilter object

Parameters:
db - The new debug value

DLESE Tools
v1.6.0