commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/define BeanTag.java
Date Mon, 15 Jul 2002 21:34:54 GMT
jvanzyl     2002/07/15 14:34:54

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/define
                        BeanTag.java
  Log:
  o fixed coding style
  o javadoc
  
  Revision  Changes    Path
  1.3       +15 -10    jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/define/BeanTag.java
  
  Index: BeanTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/define/BeanTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BeanTag.java	15 Jul 2002 21:31:34 -0000	1.2
  +++ BeanTag.java	15 Jul 2002 21:34:53 -0000	1.3
  @@ -87,6 +87,7 @@
    * which will be invoked after the bean has been configured.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  + * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
    * @version $Revision$
    */
   public class BeanTag extends DynaBeanTagSupport {
  @@ -125,32 +126,36 @@
           
           // now, I may invoke the 'execute' method if I have one
           if ( method != null ) {
  -            try
  -            {
  +            try {
                   method.invoke( bean, emptyArgs );
               }
  -            catch (IllegalAccessException e)
  -            {
  +            catch (IllegalAccessException e) {
                   methodInvocationError(bean, method, e);
               }
  -            catch (IllegalArgumentException e)
  -            {
  +            catch (IllegalArgumentException e) {
                   methodInvocationError(bean, method, e);
               }
  -            catch (InvocationTargetException e)
  -            {
  +            catch (InvocationTargetException e) {
                   methodInvocationError(bean, method, e);
               }
           }
       }
       
  +    /**
  +     * Report the state of the bean when method invocation fails
  +     * so that the user can determine any problems that might
  +     * be occuring while using dynamic jelly beans.
  +     *
  +     * @param bean Bean on which <code>method</code was invoked
  +     * @param method Method that was invoked
  +     * @param e Exception throw when <code>method</code> was invoked
  +     */
       private void methodInvocationError(Object bean, Method method, Exception e) throws
Exception {
           log.error("Could not invoke " + method, e);
           BeanMap beanMap = new BeanMap(bean);
           
           log.error("Bean properties:");
  -        for (Iterator i = beanMap.keySet().iterator(); i.hasNext();)
  -        {
  +        for (Iterator i = beanMap.keySet().iterator(); i.hasNext();) {
               String property = (String) i.next();
               Object value = beanMap.get(property);
               log.error(property + " -> " + value);
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message