Update of /cvsroot/displaytag/display09/src/org/displaytag/util
In directory sc8-pr-cvs1:/tmp/cvs-serv553/src/org/displaytag/util

Modified Files:
        LookupUtil.java CollectionUtil.java 
        DisplayPropertiesLoaderServlet.java RowSorter.java 
        LinkUtil.java BeanInfoUtil.java HtmlTagUtil.java 
        RequestHelper.java 
Log Message:
formatted code, some javadoc improvements and small fixes

Index: LookupUtil.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/LookupUtil.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** LookupUtil.java     15 Jul 2003 21:48:36 -0000      1.4
--- LookupUtil.java     9 Aug 2003 19:54:08 -0000       1.5
***************
*** 1,6 ****
  package org.displaytag.util;
  
- import java.util.Map;
  import java.lang.reflect.InvocationTargetException;
  
  import javax.servlet.jsp.PageContext;
--- 1,6 ----
  package org.displaytag.util;
  
  import java.lang.reflect.InvocationTargetException;
+ import java.util.Map;
  
  import javax.servlet.jsp.PageContext;
***************
*** 16,20 ****
   * @version $Revision$ ($Author$)
   */
! public class LookupUtil
  {
  
--- 16,20 ----
   * @version $Revision$ ($Author$)
   */
! public final class LookupUtil
  {
  

Index: CollectionUtil.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/CollectionUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CollectionUtil.java 17 Jul 2003 21:45:39 -0000      1.2
--- CollectionUtil.java 9 Aug 2003 19:54:08 -0000       1.3
***************
*** 14,18 ****
   * @version $Revision$ ($Author$)
   */
! public class CollectionUtil
  {
  
--- 14,18 ----
   * @version $Revision$ ($Author$)
   */
! public final class CollectionUtil
  {
  
***************
*** 20,24 ****
         * logger
         */
!       private static Log mLog= LogFactory.getLog(CollectionUtil.class);
  
        /**
--- 20,24 ----
         * logger
         */
!       private static Log mLog = LogFactory.getLog(CollectionUtil.class);
  
        /**
***************
*** 30,39 ****
  
        /**
!        * Create a list of objects taken from the given iterator and crop the 
resulting list according to the pStartNumber 
         * and pNumberOfItems parameters
         * @param pIterator Iterator
         * @param pStartNumber int starting index
         * @param pNumberOfItems int number of items to keep in the list
!        * @return List with values taken from the given object, cropped according the 
pStartNumber and pNumberOfItems 
         * parameters
         */
--- 30,39 ----
  
        /**
!        * Create a list of objects taken from the given iterator and crop the 
resulting list according to the pStartNumber
         * and pNumberOfItems parameters
         * @param pIterator Iterator
         * @param pStartNumber int starting index
         * @param pNumberOfItems int number of items to keep in the list
!        * @return List with values taken from the given object, cropped according the 
pStartNumber and pNumberOfItems
         * parameters
         */
***************
*** 41,52 ****
        {
  
!               ArrayList lCroppedList= new ArrayList(pNumberOfItems);
  
!               int lSkippedRecordCount= 0;
!               int lCopiedRecordCount= 0;
                while (pIterator.hasNext())
                {
  
!                       Object lObject= pIterator.next();
  
                        if (++lSkippedRecordCount <= pStartNumber)
--- 41,52 ----
        {
  
!               ArrayList lCroppedList = new ArrayList(pNumberOfItems);
  
!               int lSkippedRecordCount = 0;
!               int lCopiedRecordCount = 0;
                while (pIterator.hasNext())
                {
  
!                       Object lObject = pIterator.next();
  
                        if (++lSkippedRecordCount <= pStartNumber)
***************
*** 69,83 ****
  
        /**
!        * create an iterator on a given object (Collection, Enumeration, array, 
single Object) and crop the resulting 
         * list according to the pStartNumber and pNumberOfItems parameters
         * @param pFullList Collection, Enumeration or array to crop
         * @param pStartNumber int starting index
         * @param pNumberOfItems int number of items to keep in the list
!        * @return List with values taken from the given object, cropped according the 
pStartNumber and pNumberOfItems 
         * parameters
         */
        public static List getListFromObject(Object pFullList, int pStartNumber, int 
pNumberOfItems)
        {
!               Iterator lIterator= IteratorUtils.getIterator(pFullList);
                return getSubList(lIterator, pStartNumber, pNumberOfItems);
        }
--- 69,83 ----
  
        /**
!        * create an iterator on a given object (Collection, Enumeration, array, 
single Object) and crop the resulting
         * list according to the pStartNumber and pNumberOfItems parameters
         * @param pFullList Collection, Enumeration or array to crop
         * @param pStartNumber int starting index
         * @param pNumberOfItems int number of items to keep in the list
!        * @return List with values taken from the given object, cropped according the 
pStartNumber and pNumberOfItems
         * parameters
         */
        public static List getListFromObject(Object pFullList, int pStartNumber, int 
pNumberOfItems)
        {
!               Iterator lIterator = IteratorUtils.getIterator(pFullList);
                return getSubList(lIterator, pStartNumber, pNumberOfItems);
        }

Index: DisplayPropertiesLoaderServlet.java
===================================================================
RCS file: 
/cvsroot/displaytag/display09/src/org/displaytag/util/DisplayPropertiesLoaderServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DisplayPropertiesLoaderServlet.java 17 Jul 2003 21:51:57 -0000      1.2
--- DisplayPropertiesLoaderServlet.java 9 Aug 2003 19:54:08 -0000       1.3
***************
*** 12,16 ****
  /**
   * <p>Servlet which loads a user supplied properties file for the display 
taglibrary.</p>
!  * <p>To set a default properties for a whole web application configure this servlet 
in web.xml and set a 
   * "properties.filename" parameter with the path to the properties file, relative to 
the web application root
   * (example: "WEB-INF/display.properties").</p>
--- 12,16 ----
  /**
   * <p>Servlet which loads a user supplied properties file for the display 
taglibrary.</p>
!  * <p>To set a default properties for a whole web application configure this servlet 
in web.xml and set a
   * "properties.filename" parameter with the path to the properties file, relative to 
the web application root
   * (example: "WEB-INF/display.properties").</p>
***************
*** 31,36 ****
   *            &lt;load-on-startup>1&lt;/load-on-startup>
   *    &lt;/servlet>
!  * </pre
!  * 
   * @author fgiust
   * @version $Revision$ ($Author$)
--- 31,35 ----
   *            &lt;load-on-startup>1&lt;/load-on-startup>
   *    &lt;/servlet>
!  * </pre>
   * @author fgiust
   * @version $Revision$ ($Author$)
***************
*** 42,54 ****
         * logger
         */
!       private Log mLog= LogFactory.getLog(DisplayPropertiesLoaderServlet.class);
  
        /**
         * name of the parameter containing the properties file path
         */
!       private static final String PROPERTIES_PARAMETER= "properties.filename";
  
        /**
!        * Init: retrieve the confiuration parameter and set the user file name in 
         * org.displaytag.tags.TableProperties
         * @param pServletConfig ServletConfig
--- 41,53 ----
         * logger
         */
!       private Log mLog = LogFactory.getLog(DisplayPropertiesLoaderServlet.class);
  
        /**
         * name of the parameter containing the properties file path
         */
!       private static final String PROPERTIES_PARAMETER = "properties.filename";
  
        /**
!        * Init: retrieve the confiuration parameter and set the user file name in
         * org.displaytag.tags.TableProperties
         * @param pServletConfig ServletConfig
***************
*** 56,60 ****
         * @see javax.servlet.Servlet#init(ServletConfig)
         */
!       public void init(ServletConfig pServletConfig) throws ServletException
        {
  
--- 55,59 ----
         * @see javax.servlet.Servlet#init(ServletConfig)
         */
!       public final void init(ServletConfig pServletConfig) throws ServletException
        {
  
***************
*** 62,66 ****
  
                // read the parameter
!               String lFile= getInitParameter(PROPERTIES_PARAMETER);
  
                // debug parameter
--- 61,65 ----
  
                // read the parameter
!               String lFile = getInitParameter(PROPERTIES_PARAMETER);
  
                // debug parameter
***************
*** 70,76 ****
                {
                        // add the webapp path
!                       String lPrefix= getServletContext().getRealPath("/");
  
!                       String lFullPath= lPrefix + SystemUtils.FILE_SEPARATOR + lFile;
  
                        // set the user file
--- 69,75 ----
                {
                        // add the webapp path
!                       String lPrefix = getServletContext().getRealPath("/");
  
!                       String lFullPath = lPrefix + SystemUtils.FILE_SEPARATOR + 
lFile;
  
                        // set the user file

Index: RowSorter.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/RowSorter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RowSorter.java      20 Jul 2003 21:26:58 -0000      1.3
--- RowSorter.java      9 Aug 2003 19:54:08 -0000       1.4
***************
*** 3,6 ****
--- 3,8 ----
  import java.util.Comparator;
  
+ import org.apache.commons.lang.builder.EqualsBuilder;
+ import org.apache.commons.lang.builder.HashCodeBuilder;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
***************
*** 21,25 ****
         * logger
         */
!       private static Log mLog= LogFactory.getLog(RowSorter.class);
  
        /**
--- 23,27 ----
         * logger
         */
!       private static Log mLog = LogFactory.getLog(RowSorter.class);
  
        /**
***************
*** 46,50 ****
         * initialize a new RowSorter
         * @param pColumnIndex index of the sorted column
!        * @param pProperty name of the property. If pProperty is null column index is 
used to get a static cell value from 
         * the row object
         * @param pDecorator TableDecorator
--- 48,52 ----
         * initialize a new RowSorter
         * @param pColumnIndex index of the sorted column
!        * @param pProperty name of the property. If pProperty is null column index is 
used to get a static cell value from
         * the row object
         * @param pDecorator TableDecorator
***************
*** 53,65 ****
        public RowSorter(int pColumnIndex, String pProperty, TableDecorator 
pDecorator, boolean pAscending)
        {
!               mColumnIndex= pColumnIndex;
!               mProperty= pProperty;
!               mTableDecorator= pDecorator;
!               mAscending= pAscending;
        }
  
        /**
         * Compares two objects by first fetching a property from each object and then 
comparing that value.  If there are
!        * any errors produced while trying to compare these objects then a 
RunTimeException will be thrown as any error 
         * found here will most likely be a programming error that needs to be quickly 
addressed (like trying to compare
         * objects that are not comparable, or trying to read a property from a bean 
that is invalid, etc...)
--- 55,67 ----
        public RowSorter(int pColumnIndex, String pProperty, TableDecorator 
pDecorator, boolean pAscending)
        {
!               mColumnIndex = pColumnIndex;
!               mProperty = pProperty;
!               mTableDecorator = pDecorator;
!               mAscending = pAscending;
        }
  
        /**
         * Compares two objects by first fetching a property from each object and then 
comparing that value.  If there are
!        * any errors produced while trying to compare these objects then a 
RunTimeException will be thrown as any error
         * found here will most likely be a programming error that needs to be quickly 
addressed (like trying to compare
         * objects that are not comparable, or trying to read a property from a bean 
that is invalid, etc...)
***************
*** 70,78 ****
         * @see java.util.Comparator#compare(Object, Object)
         */
!       public int compare(Object pObject1, Object pObject2)
        {
  
!               Object lObj1= null;
!               Object lObj2= null;
  
                // if property is null compare using two static cell objects
--- 72,80 ----
         * @see java.util.Comparator#compare(Object, Object)
         */
!       public final int compare(Object pObject1, Object pObject2)
        {
  
!               Object lObj1 = null;
!               Object lObj2 = null;
  
                // if property is null compare using two static cell objects
***************
*** 81,89 ****
                        if (pObject1 instanceof Row)
                        {
!                               lObj1= ((Row) 
pObject1).getCellList().get(mColumnIndex);
                        }
                        if (pObject2 instanceof Row)
                        {
!                               lObj2= ((Row) 
pObject2).getCellList().get(mColumnIndex);
                        }
  
--- 83,91 ----
                        if (pObject1 instanceof Row)
                        {
!                               lObj1 = ((Row) 
pObject1).getCellList().get(mColumnIndex);
                        }
                        if (pObject2 instanceof Row)
                        {
!                               lObj2 = ((Row) 
pObject2).getCellList().get(mColumnIndex);
                        }
  
***************
*** 95,120 ****
                        if (pObject1 instanceof Row)
                        {
!                               lObj1= ((Row) pObject1).getObject();
                        }
                        if (pObject2 instanceof Row)
                        {
!                               lObj2= ((Row) pObject2).getObject();
                        }
  
                        try
                        {
!                               Object lResult1= null;
!                               Object lResult2= null;
  
                                // If they have supplied a decorator, then make sure 
and use it for the sorting as well
                                if (mTableDecorator != null && 
mTableDecorator.hasGetterFor(mProperty))
                                {
!                                       lResult1= 
LookupUtil.getBeanProperty(mTableDecorator, mProperty);
!                                       lResult2= 
LookupUtil.getBeanProperty(mTableDecorator, mProperty);
                                }
                                else
                                {
!                                       lResult1= LookupUtil.getBeanProperty(lObj1, 
mProperty);
!                                       lResult2= LookupUtil.getBeanProperty(lObj2, 
mProperty);
                                }
  
--- 97,122 ----
                        if (pObject1 instanceof Row)
                        {
!                               lObj1 = ((Row) pObject1).getObject();
                        }
                        if (pObject2 instanceof Row)
                        {
!                               lObj2 = ((Row) pObject2).getObject();
                        }
  
                        try
                        {
!                               Object lResult1 = null;
!                               Object lResult2 = null;
  
                                // If they have supplied a decorator, then make sure 
and use it for the sorting as well
                                if (mTableDecorator != null && 
mTableDecorator.hasGetterFor(mProperty))
                                {
!                                       lResult1 = 
LookupUtil.getBeanProperty(mTableDecorator, mProperty);
!                                       lResult2 = 
LookupUtil.getBeanProperty(mTableDecorator, mProperty);
                                }
                                else
                                {
!                                       lResult1 = LookupUtil.getBeanProperty(lObj1, 
mProperty);
!                                       lResult2 = LookupUtil.getBeanProperty(lObj2, 
mProperty);
                                }
  
***************
*** 143,147 ****
        private int checkNullsAndCompare(Object pObject1, Object pObject2)
        {
!               int lAscending= mAscending ? 1 : -1;
  
                if (pObject1 instanceof Comparable && pObject2 instanceof Comparable)
--- 145,149 ----
        private int checkNullsAndCompare(Object pObject1, Object pObject2)
        {
!               int lAscending = mAscending ? 1 : -1;
  
                if (pObject1 instanceof Comparable && pObject2 instanceof Comparable)
***************
*** 174,193 ****
         * @see java.util.Comparator#equals(Object)
         */
!       public boolean equals(Object pObject)
        {
                if (pObject instanceof RowSorter)
                {
!                       if (mProperty != null)
!                       {
!                               return mProperty.equals(((RowSorter) 
pObject).mProperty);
!                       }
!                       else
!                       {
!                               return mColumnIndex == ((RowSorter) 
pObject).mColumnIndex;
!                       }
                }
  
                return false;
  
        }
  }
--- 176,199 ----
         * @see java.util.Comparator#equals(Object)
         */
!       public final boolean equals(Object pObject)
        {
                if (pObject instanceof RowSorter)
                {
!                       return new EqualsBuilder()
!                               .append(mProperty, ((RowSorter) pObject).mProperty)
!                               .append(mColumnIndex, ((RowSorter) 
pObject).mColumnIndex)
!                               .isEquals();
                }
  
                return false;
+       }
  
+       /**
+        * @see java.lang.Object#hashCode()
+        */
+       public final int hashCode()
+       {
+               return new HashCodeBuilder(31, 
33).append(mProperty).append(mColumnIndex).toHashCode();
        }
+ 
  }

Index: LinkUtil.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/LinkUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LinkUtil.java       21 Jun 2003 12:34:50 -0000      1.1
--- LinkUtil.java       9 Aug 2003 19:54:08 -0000       1.2
***************
*** 1,6 ****
  package org.displaytag.util;
  
- 
- 
  /**
   * <p>Class with static utility methods to add html links in a String</p>
--- 1,4 ----
***************
*** 8,12 ****
   * @version $Revision$ ($Author$)
   */
! public class LinkUtil
  {
  
--- 6,10 ----
   * @version $Revision$ ($Author$)
   */
! public final class LinkUtil
  {
  
***************
*** 23,27 ****
        private static final String URL_HTTP = "http://";;
  
- 
        /**
         * <p>This takes the string that is passed in, and "auto-links" it, it turns
--- 21,24 ----
***************
*** 40,46 ****
        public static String autoLink(String pData)
        {
!               String lWorkString= new String(pData);
!               int lIndex= -1;
!               StringBuffer lBuffer= new StringBuffer();
  
                if (pData == null || pData.length() == 0)
--- 37,43 ----
        public static String autoLink(String pData)
        {
!               String lWorkString = new String(pData);
!               int lIndex = -1;
!               StringBuffer lBuffer = new StringBuffer();
  
                if (pData == null || pData.length() == 0)
***************
*** 51,65 ****
                // First check for email addresses.
  
!               while ((lIndex= lWorkString.indexOf("@")) != -1)
                {
!                       int lStart= 0;
!                       int lEnd= lWorkString.length() - 1;
  
                        // scan backwards...
!                       for (int lCount= lIndex; lCount >= 0; lCount--)
                        {
                                if (Character.isWhitespace(lWorkString.charAt(lCount)))
                                {
!                                       lStart= lCount + 1;
                                        break;
                                }
--- 48,62 ----
                // First check for email addresses.
  
!               while ((lIndex = lWorkString.indexOf("@")) != -1)
                {
!                       int lStart = 0;
!                       int lEnd = lWorkString.length() - 1;
  
                        // scan backwards...
!                       for (int lCount = lIndex; lCount >= 0; lCount--)
                        {
                                if (Character.isWhitespace(lWorkString.charAt(lCount)))
                                {
!                                       lStart = lCount + 1;
                                        break;
                                }
***************
*** 67,80 ****
  
                        // scan forwards...
!                       for (int lCount= lIndex; lCount <= lEnd; lCount++)
                        {
                                if (Character.isWhitespace(lWorkString.charAt(lCount)))
                                {
!                                       lEnd= lCount - 1;
                                        break;
                                }
                        }
  
!                       String lEmail= lWorkString.substring(lStart, (lEnd - lStart + 
1));
  
                        lBuffer
--- 64,77 ----
  
                        // scan forwards...
!                       for (int lCount = lIndex; lCount <= lEnd; lCount++)
                        {
                                if (Character.isWhitespace(lWorkString.charAt(lCount)))
                                {
!                                       lEnd = lCount - 1;
                                        break;
                                }
                        }
  
!                       String lEmail = lWorkString.substring(lStart, (lEnd - lStart + 
1));
  
                        lBuffer
***************
*** 87,129 ****
                        if (lEnd == lWorkString.length())
                        {
!                               lWorkString= "";
                        }
                        else
                        {
!                               lWorkString= lWorkString.substring(lEnd + 1);
                        }
                }
  
!               lWorkString= lBuffer.toString() + lWorkString;
!               lBuffer= new StringBuffer();
  
                // Now check for urls...
  
!               while ((lIndex= lWorkString.indexOf(URL_HTTP)) != -1)
                {
!                       int lEnd= lWorkString.length() - 1;
  
                        // scan forwards...
!                       for (int lCount= lIndex; lCount <= lEnd; lCount++)
                        {
                                if (Character.isWhitespace(lWorkString.charAt(lCount)))
                                {
!                                       lEnd= lCount - 1;
                                        break;
                                }
                        }
  
!                       String lUrl= lWorkString.substring(lIndex, (lEnd - lIndex + 
1));
  
                        lBuffer.append(lWorkString.substring(0, lIndex)).append("<a 
href=\"").append(lUrl).append("\">").append(
!                               lUrl).append("</a>");
  
                        if (lEnd == lWorkString.length())
                        {
!                               lWorkString= "";
                        }
                        else
                        {
!                               lWorkString= lWorkString.substring(lEnd + 1);
                        }
                }
--- 84,127 ----
                        if (lEnd == lWorkString.length())
                        {
!                               lWorkString = "";
                        }
                        else
                        {
!                               lWorkString = lWorkString.substring(lEnd + 1);
                        }
                }
  
!               lWorkString = lBuffer.toString() + lWorkString;
!               lBuffer = new StringBuffer();
  
                // Now check for urls...
  
!               while ((lIndex = lWorkString.indexOf(URL_HTTP)) != -1)
                {
!                       int lEnd = lWorkString.length() - 1;
  
                        // scan forwards...
!                       for (int lCount = lIndex; lCount <= lEnd; lCount++)
                        {
                                if (Character.isWhitespace(lWorkString.charAt(lCount)))
                                {
!                                       lEnd = lCount - 1;
                                        break;
                                }
                        }
  
!                       String lUrl = lWorkString.substring(lIndex, (lEnd - lIndex + 
1));
  
                        lBuffer.append(lWorkString.substring(0, lIndex)).append("<a 
href=\"").append(lUrl).append("\">").append(
!                               lUrl).append(
!                               "</a>");
  
                        if (lEnd == lWorkString.length())
                        {
!                               lWorkString = "";
                        }
                        else
                        {
!                               lWorkString = lWorkString.substring(lEnd + 1);
                        }
                }

Index: BeanInfoUtil.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/BeanInfoUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BeanInfoUtil.java   17 Jul 2003 21:44:52 -0000      1.2
--- BeanInfoUtil.java   9 Aug 2003 19:54:08 -0000       1.3
***************
*** 20,24 ****
   * <p>Tag who wish to use this BeanInfo need to define a new class with the same 
name of the main
   * tag class + "BeanInfo" suffix wich extends BeanInfoUtil</p>
-  * 
   * @author fgiust
   * @version $Revision$ ($Author$)
--- 20,23 ----
***************
*** 30,34 ****
         * logger
         */
!       private static Log mLog= LogFactory.getLog(BeanInfoUtil.class);
  
        /**
--- 29,33 ----
         * logger
         */
!       private static Log mLog = LogFactory.getLog(BeanInfoUtil.class);
  
        /**
***************
*** 37,57 ****
         * @see java.beans.BeanInfo#getPropertyDescriptors()
         */
!       public PropertyDescriptor[] getPropertyDescriptors()
        {
  
!               ArrayList lPdArray= new ArrayList();
  
                // get the full class name
!               String lClassName= getClass().getName();
  
                // remove "BeanInfo" to get the bean class
!               lClassName= lClassName.substring(0, lClassName.indexOf("BeanInfo"));
  
!               Class lTagClass= null;
  
                try
                {
                        // get the tag class
!                       lTagClass= Class.forName(lClassName);
                }
                catch (ClassNotFoundException ex1)
--- 36,56 ----
         * @see java.beans.BeanInfo#getPropertyDescriptors()
         */
!       public final PropertyDescriptor[] getPropertyDescriptors()
        {
  
!               ArrayList lPdArray = new ArrayList();
  
                // get the full class name
!               String lClassName = getClass().getName();
  
                // remove "BeanInfo" to get the bean class
!               lClassName = lClassName.substring(0, lClassName.indexOf("BeanInfo"));
  
!               Class lTagClass = null;
  
                try
                {
                        // get the tag class
!                       lTagClass = Class.forName(lClassName);
                }
                catch (ClassNotFoundException ex1)
***************
*** 61,81 ****
  
                // get the method array
!               Method[] lMethods= lTagClass.getMethods();
  
                String lMethodName;
!               int lNumberOfMethods= lMethods.length;
  
!               for (int lCounter= 0; lCounter < lNumberOfMethods; lCounter++)
                {
!                       Method lMeth= lMethods[lCounter];
  
                        // look for setters only
                        if ((lMeth.getParameterTypes().length == 1)
!                               && (lMethodName= lMeth.getName()).indexOf("set") == 0
                                && (lMethodName.length() > 3)
                                && Character.isUpperCase(lMethodName.charAt(3)))
                        {
  
!                               String lAttributeName= 
Character.toLowerCase(lMethodName.charAt(3)) + lMethodName.substring(4);
  
                                try
--- 60,80 ----
  
                // get the method array
!               Method[] lMethods = lTagClass.getMethods();
  
                String lMethodName;
!               int lNumberOfMethods = lMethods.length;
  
!               for (int lCounter = 0; lCounter < lNumberOfMethods; lCounter++)
                {
!                       Method lMeth = lMethods[lCounter];
  
                        // look for setters only
                        if ((lMeth.getParameterTypes().length == 1)
!                               && (lMethodName = lMeth.getName()).indexOf("set") == 0
                                && (lMethodName.length() > 3)
                                && Character.isUpperCase(lMethodName.charAt(3)))
                        {
  
!                               String lAttributeName = 
Character.toLowerCase(lMethodName.charAt(3)) + lMethodName.substring(4);
  
                                try
***************
*** 87,90 ****
--- 86,90 ----
                                {
                                        // ignore
+                                       continue;
                                }
  
***************
*** 92,104 ****
                }
  
!               PropertyDescriptor[] lPd= new PropertyDescriptor[lPdArray.size()];
  
!               Iterator lIterator= lPdArray.iterator();
  
!               int lPid= 0;
  
                while (lIterator.hasNext())
                {
!                       lPd[lPid]= (PropertyDescriptor) (lIterator.next());
                        lPid++;
                }
--- 92,104 ----
                }
  
!               PropertyDescriptor[] lPd = new PropertyDescriptor[lPdArray.size()];
  
!               Iterator lIterator = lPdArray.iterator();
  
!               int lPid = 0;
  
                while (lIterator.hasNext())
                {
!                       lPd[lPid] = (PropertyDescriptor) (lIterator.next());
                        lPid++;
                }

Index: HtmlTagUtil.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/HtmlTagUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** HtmlTagUtil.java    21 Jun 2003 12:34:50 -0000      1.1
--- HtmlTagUtil.java    9 Aug 2003 19:54:08 -0000       1.2
***************
*** 9,13 ****
   * @version $Revision$ ($Author$)
   */
! public class HtmlTagUtil
  {
        /**
--- 9,13 ----
   * @version $Revision$ ($Author$)
   */
! public final class HtmlTagUtil
  {
        /**
***************
*** 27,31 ****
        {
  
!               StringBuffer lBuffer= new StringBuffer();
  
                
lBuffer.append(TagConstants.TAG_OPEN).append(pTagName).append(pAttributes.toString()).append(
--- 27,31 ----
        {
  
!               StringBuffer lBuffer = new StringBuffer();
  
                
lBuffer.append(TagConstants.TAG_OPEN).append(pTagName).append(pAttributes.toString()).append(

Index: RequestHelper.java
===================================================================
RCS file: /cvsroot/displaytag/display09/src/org/displaytag/util/RequestHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RequestHelper.java  21 Jun 2003 12:34:50 -0000      1.1
--- RequestHelper.java  9 Aug 2003 19:54:08 -0000       1.2
***************
*** 6,9 ****
--- 6,11 ----
  import javax.servlet.http.HttpServletRequest;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
  import org.displaytag.model.Href;
  
***************
*** 21,24 ****
--- 23,31 ----
  
        /**
+        * logger
+        */
+       private static Log mLog = LogFactory.getLog(RequestHelper.class);
+ 
+       /**
         * original HttpServletRequest
         */
***************
*** 31,35 ****
        public RequestHelper(HttpServletRequest pRequest)
        {
!               mRequest= pRequest;
        }
  
--- 38,42 ----
        public RequestHelper(HttpServletRequest pRequest)
        {
!               mRequest = pRequest;
        }
  
***************
*** 39,43 ****
         * @return String parameter value
         */
!       public String getParameter(String pKey)
        {
                // actually simply return the parameter, this behaviour could be 
changed
--- 46,50 ----
         * @return String parameter value
         */
!       public final String getParameter(String pKey)
        {
                // actually simply return the parameter, this behaviour could be 
changed
***************
*** 50,56 ****
         * @return Integer parameter value or null if the parameter is not found or it 
can't be transformed to an Integer
         */
!       public Integer getIntParameter(String pKey)
        {
!               String lParamValue= mRequest.getParameter(pKey);
  
                if (lParamValue != null)
--- 57,63 ----
         * @return Integer parameter value or null if the parameter is not found or it 
can't be transformed to an Integer
         */
!       public final Integer getIntParameter(String pKey)
        {
!               String lParamValue = mRequest.getParameter(pKey);
  
                if (lParamValue != null)
***************
*** 63,66 ****
--- 70,74 ----
                        {
                                // It's ok to ignore, simply return null
+                               mLog.debug("Invalid \"" + pKey + "\" parameter from 
request: value=\"" + lParamValue + "\"");
                        }
                }
***************
*** 73,88 ****
         * @return HashMap
         */
!       public HashMap getParameterMap()
        {
  
!               HashMap lMap= new HashMap();
  
                // get the parameters names
!               Enumeration lParametersName= mRequest.getParameterNames();
  
                while (lParametersName.hasMoreElements())
                {
                        // ... get the value
!                       String lParamName= (String) lParametersName.nextElement();
  
                        // put key/value in the map
--- 81,96 ----
         * @return HashMap
         */
!       public final HashMap getParameterMap()
        {
  
!               HashMap lMap = new HashMap();
  
                // get the parameters names
!               Enumeration lParametersName = mRequest.getParameterNames();
  
                while (lParametersName.hasMoreElements())
                {
                        // ... get the value
!                       String lParamName = (String) lParametersName.nextElement();
  
                        // put key/value in the map
***************
*** 98,104 ****
         * @return Href
         */
!       public Href getHref()
        {
!               Href lHref= new Href(mRequest.getRequestURI());
                lHref.setParameterMap(getParameterMap());
                return lHref;
--- 106,112 ----
         * @return Href
         */
!       public final Href getHref()
        {
!               Href lHref = new Href(mRequest.getRequestURI());
                lHref.setParameterMap(getParameterMap());
                return lHref;




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to