org.alphadisplaytag.util
Class BeanListDb

java.lang.Object
  extended byorg.alphadisplaytag.util.BeanListDb

public class BeanListDb
extends java.lang.Object

BeanListDb creates a Virtual Database for objects stored in a List.
Features:
1. Reflection is used to find all the accessor methods (getXXX) for the object stored in the list.
2. Using these found accessor methods, the virtual database can be keyed and accessed base on any of the found columns.
    A default column is automatically assigned if the key accessor method, key column, is not defined.

Version:
$Revision: 1.0 $ ($Author: pchauvet $)
Author:
Philip Jahmani Chauvet

Constructor Summary
BeanListDb()
          Default constructor.
BeanListDb(java.util.List list)
          From the bean object, get the accessor methods, set the list size, get the default key and create a list containing the object keys (accessor methods).
 
Method Summary
 java.lang.String getDefaultColumn()
          If no default column is provided the first string accessor method is retrieve.
 java.lang.String getKeyColumn()
          Get the key column.
 java.util.List getList()
          Get the list of bean object.
 java.util.List getListKeys()
          Get the accessor methods in a list
 java.util.List getListKeys(java.lang.String column)
          Create the accessor methods (key columns ) as a list.
 int getListSize()
          Get the list size.
 java.lang.String getObjectAccessors()
          Get the accessor methods as a string produced by reflections access formatted as [ column1, ..., columnx ].
 boolean isValidColumn(java.lang.String column)
          Is the column part of the bean object in the list.
 void setList(java.util.List list)
          Set the list and create the accessor methods.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanListDb

public BeanListDb()
Default constructor.


BeanListDb

public BeanListDb(java.util.List list)
           throws java.lang.Exception
From the bean object, get the accessor methods, set the list size, get the default key and create a list containing the object keys (accessor methods).

Method Detail

setList

public void setList(java.util.List list)
             throws java.lang.Exception
Set the list and create the accessor methods.

Throws:
java.lang.Exception

getObjectAccessors

public java.lang.String getObjectAccessors()
Get the accessor methods as a string produced by reflections access formatted as [ column1, ..., columnx ].


getListKeys

public java.util.List getListKeys()
Get the accessor methods in a list

Returns:
List Accessor methods

getListKeys

public java.util.List getListKeys(java.lang.String column)
                           throws java.lang.Exception
Create the accessor methods (key columns ) as a list. If the desired column is not in the object and exception is throw.

Parameters:
column - The accessor method (key column) in the object.
Returns:
List Accessor methods in a list.
Throws:
java.lang.Exception

getKeyColumn

public java.lang.String getKeyColumn()
Get the key column.

Returns:
String The key accessor method.

getListSize

public int getListSize()
Get the list size.

Returns:
int The list size.

getList

public java.util.List getList()
Get the list of bean object.

Returns:
List List of bean object.

getDefaultColumn

public java.lang.String getDefaultColumn()
If no default column is provided the first string accessor method is retrieve.

Returns:
String The default column.

isValidColumn

public boolean isValidColumn(java.lang.String column)
Is the column part of the bean object in the list.

Returns:
boolean True if the column is in the objecte, else false.

toString

public java.lang.String toString()


Alphabetical Navigation Bar Java Display Tag Home Page. 

My Home Page. Contact me at: chauvetp@hotmail.com.
I am alway looking for Java/J2EE work and would appreciate the business. Some of my design is inspired by the original display tag <display:*> code. Please go to http://displaytag.sourceforge.net/ for details on the <display:*> tag.

Copyright © 2004 Aiki Innovations Inc. Permission is granted to reuse and distribute for commercial or personal use if no extensive monetary gain is received. Java and the Java Standard Tag Library are programming languages owed by Sun Microsystems, Inc: http://java.sun.com/products/jsp/jstl/