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 dummy <xmp:child> action element in a dummy tag library, but it serves as an extendable validator for a real tag library.

Version:
2.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, org.jdom.Namespace 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 validateChild(org.jdom.Element e, org.jdom.Namespace ns, java.util.ArrayList msgs)
          Validates that a "child" element is only used within the body of a "parent" element.
private  void validateElement(org.jdom.Element e, org.jdom.Namespace 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.
 
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,
                             org.jdom.Namespace 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.


validateChild

private void validateChild(org.jdom.Element e,
                           org.jdom.Namespace ns,
                           java.util.ArrayList msgs)
Validates that a "child" element is only used within the body of a "parent" element. If not, a ValidationMessage is added to the message array.


findParent

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