Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.webapps.tag
Class FindBeanCollectionTag  view FindBeanCollectionTag download FindBeanCollectionTag.java

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.RuntimeCollective.webapps.tag.FindBeanCollectionTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public final class FindBeanCollectionTag
extends javax.servlet.jsp.tagext.TagSupport

Finds a collection of EntityBean's given the bean type and a named query.

The tag uses reflection to call the static finder method for the query on the bean type. The naming convention for the finder method is:

public static Collection findQueryName();

Attributes:

For example, the tag:

<rs:findBeans name="giraffes" type="com.RuntimeCollective.webapps.bean.Giraffe" query="femaleGiraffes" />

Would cause a collection called "giraffes" to be defined in page scope which contained the results of executing Giraffe.findFemaleGiraffes()

If an exception is thrown while trying execute the query, the error is logged and an empty collection is returned to the calling page.

Version:
$Id: FindBeanCollectionTag.java,v 1.3 2003/09/30 15:13:18 joe Exp $

Field Summary
private  java.lang.String name
           
private  java.lang.String query
           
private  java.lang.String scope
           
private  java.lang.String type
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FindBeanCollectionTag()
           
 
Method Summary
 int doStartTag()
          Execute the query and define the collection.
private  java.lang.reflect.Method getFinder()
           
 java.lang.String getName()
          get the name.
 java.lang.String getQuery()
          get the query.
 java.lang.String getScope()
          get the scope.
 java.lang.String getType()
          get the type.
private  void initialise()
           
private  java.lang.String mangleMethodName()
           
 void release()
          Release any acquired resources.
 void setName(java.lang.String name)
          set the name.
 void setQuery(java.lang.String query)
          set the query.
 void setScope(java.lang.String scope)
          set the scope.
 void setType(java.lang.String type)
          set the type.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name

scope

private java.lang.String scope

type

private java.lang.String type

query

private java.lang.String query
Constructor Detail

FindBeanCollectionTag

public FindBeanCollectionTag()
Method Detail

getName

public java.lang.String getName()
get the name.


setName

public void setName(java.lang.String name)
set the name.


getScope

public java.lang.String getScope()
get the scope.


setScope

public void setScope(java.lang.String scope)
set the scope.


getType

public java.lang.String getType()
get the type.


setType

public void setType(java.lang.String type)
set the type.


getQuery

public java.lang.String getQuery()
get the query.


setQuery

public void setQuery(java.lang.String query)
set the query.


doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Execute the query and define the collection.


release

public void release()
Release any acquired resources.


getFinder

private java.lang.reflect.Method getFinder()
                                    throws java.lang.ClassNotFoundException,
                                           java.lang.NoSuchMethodException,
                                           java.lang.SecurityException

mangleMethodName

private java.lang.String mangleMethodName()

initialise

private void initialise()