com.ora.jsp.tlv
Class OraTLV

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagLibraryValidator
      extended bycom.ora.jsp.tlv.OraTLV

public class OraTLV
extends javax.servlet.jsp.tagext.TagLibraryValidator

This is an example of a TagLibraryValidator class. It only validates the use of the <ora:param> action element, but can be extended to validate the use of other actions as well.

Version:
1.0
Author:
Hans Bergsten, Gefion software

Field Summary
private  org.jdom.input.SAXBuilder builder
           
private  org.jdom.Namespace jspNamespace
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagLibraryValidator
 
Constructor Summary
OraTLV()
           
 
Method Summary
private  org.jdom.Element findParent(org.jdom.Element e, java.lang.String ns, java.lang.String name)
          Returns the closest parent element of the specified element that matches the specified namespace and name.
 javax.servlet.jsp.tagext.ValidationMessage[] validate(java.lang.String prefix, java.lang.String uri, javax.servlet.jsp.tagext.PageData pd)
          Returns a ValidationMessage array with information about validation errors, or null if no errors are found.
private  void validateElement(org.jdom.Element e, java.lang.String ns, java.util.ArrayList msgs)
          Dispatches to the appropriate validation method for the specified element, and calls itself recursively for all children of the element.
private  void validateParam(org.jdom.Element e, java.lang.String ns, java.util.ArrayList msgs)
          Validates that a param element is only used within the body of a forward element.
 
Methods inherited from class javax.servlet.jsp.tagext.TagLibraryValidator
getInitParameters, release, setInitParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

private org.jdom.input.SAXBuilder builder

jspNamespace

private org.jdom.Namespace jspNamespace
Constructor Detail

OraTLV

public OraTLV()
Method Detail

validate

public javax.servlet.jsp.tagext.ValidationMessage[] validate(java.lang.String prefix,
                                                             java.lang.String uri,
                                                             javax.servlet.jsp.tagext.PageData pd)
Returns a ValidationMessage array with information about validation errors, or null if no errors are found.


validateElement

private void validateElement(org.jdom.Element e,
                             java.lang.String ns,
                             java.util.ArrayList msgs)
Dispatches to the appropriate validation method for the specified element, and calls itself recursively for all children of the element.


validateParam

private void validateParam(org.jdom.Element e,
                           java.lang.String ns,
                           java.util.ArrayList msgs)
Validates that a param element is only used within the body of a forward element. If not, a ValidationMessage is added to the message array.


findParent

private org.jdom.Element findParent(org.jdom.Element e,
                                    java.lang.String ns,
                                    java.lang.String name)
Returns the closest parent element of the specified element that matches the specified namespace and name.