You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mo...@apache.org on 2003/01/24 11:04:34 UTC
cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core FileTag.java SetPropertiesTag.java SetTag.java UseBeanTag.java UseListTag.java
morgand 2003/01/24 02:04:34
Modified: jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean
BeanPropertyTag.java BeanTag.java
jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing
ActionTag.java ComponentTag.java ContainerTag.java
DialogTag.java GbcTag.java GridBagLayoutTag.java
LayoutTagSupport.java TableModelColumnTag.java
TableModelTag.java TdTag.java TrTag.java
jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt
LayoutDataTag.java LayoutTag.java
LayoutTagSupport.java SwtHelper.java WidgetTag.java
jelly/src/java/org/apache/commons/jelly/expression
CompositeExpression.java
jelly/src/java/org/apache/commons/jelly/impl BeanSource.java
DynamicBeanTag.java TagScript.java
jelly/src/java/org/apache/commons/jelly/parser
XMLParser.java
jelly/src/java/org/apache/commons/jelly/servlet
JellyServlet.java
jelly/src/java/org/apache/commons/jelly/tags/core
FileTag.java SetPropertiesTag.java SetTag.java
UseBeanTag.java UseListTag.java
Log:
miscellaneous changes to Exception handling
Revision Changes Path
1.3 +6 -6 jakarta-commons-sandbox/jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanPropertyTag.java
Index: BeanPropertyTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanPropertyTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BeanPropertyTag.java 21 Jan 2003 15:16:32 -0000 1.2
+++ BeanPropertyTag.java 24 Jan 2003 10:04:30 -0000 1.3
@@ -105,7 +105,7 @@
/**
* Creates a new instance by calling a create method on the parent bean
*/
- protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws Exception {
+ protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws JellyException {
Object parentObject = getParentObject();
if (parentObject != null) {
// now lets try call the create method...
1.3 +15 -8 jakarta-commons-sandbox/jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanTag.java
Index: BeanTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BeanTag.java 21 Jan 2003 15:16:32 -0000 1.2
+++ BeanTag.java 24 Jan 2003 10:04:30 -0000 1.3
@@ -62,6 +62,7 @@
package org.apache.commons.jelly.tags.bean;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
@@ -118,7 +119,7 @@
* Output the tag as a named variable. If the parent bean has an adder or setter
* method then invoke that to register this bean with its parent.
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
if (var != null) {
context.setVariable(var, bean);
}
@@ -144,7 +145,13 @@
}
}
else {
- BeanUtils.setProperty(parentObject, tagName, bean);
+ try {
+ BeanUtils.setProperty(parentObject, tagName, bean);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
+ }
}
}
@@ -180,7 +187,7 @@
/**
* @return the parent bean object
*/
- protected Object getParentObject() throws Exception {
+ protected Object getParentObject() throws JellyException {
BeanSource tag = (BeanSource) findAncestorWithClass(BeanSource.class);
if (tag != null) {
return tag.getBean();
1.5 +14 -5 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ActionTag.java
Index: ActionTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ActionTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ActionTag.java 11 Dec 2002 12:40:57 -0000 1.4
+++ ActionTag.java 24 Jan 2003 10:04:30 -0000 1.5
@@ -69,6 +69,7 @@
import javax.swing.Action;
import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.tags.core.UseBeanTag;
import org.apache.commons.logging.Log;
@@ -128,7 +129,7 @@
* An existing Action could be specified via the 'action' attribute or an action class
* may be specified via the 'class' attribute, otherwise a default Action class is created.
*/
- protected Class convertToClass(Object classObject) throws Exception {
+ protected Class convertToClass(Object classObject) throws MissingAttributeException, ClassNotFoundException {
if (classObject == null) {
return null;
}
@@ -141,11 +142,19 @@
* An existing Action could be specified via the 'action' attribute or an action class
* may be specified via the 'class' attribute, otherwise a default Action class is created.
*/
- protected Object newInstance(Class theClass, Map attributes, final XMLOutput output) throws Exception {
+ protected Object newInstance(Class theClass, Map attributes, final XMLOutput output) throws JellyException {
Action action = (Action) attributes.remove( "action" );
if ( action == null ) {
if (theClass != null ) {
- return theClass.newInstance();
+
+ try {
+ return theClass.newInstance();
+ } catch (InstantiationException e) {
+ throw new JellyException(e);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ }
+
}
else {
action = new AbstractAction() {
@@ -168,7 +177,7 @@
/**
* Either defines a variable or adds the current component to the parent
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
if (var != null) {
context.setVariable(var, bean);
}
@@ -187,7 +196,7 @@
/**
* Perform the strange setting of Action properties using its custom API
*/
- protected void setBeanProperties(Object bean, Map attributes) throws Exception {
+ protected void setBeanProperties(Object bean, Map attributes) throws JellyException {
Action action = getAction();
for ( Iterator iter = attributes.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry entry = (Map.Entry) iter.next();
1.11 +40 -10 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java
Index: ComponentTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ComponentTag.java 30 Oct 2002 19:16:19 -0000 1.10
+++ ComponentTag.java 24 Jan 2003 10:04:30 -0000 1.11
@@ -71,6 +71,7 @@
import java.awt.Color;
import java.awt.Window;
import java.awt.event.WindowListener;
+import java.lang.reflect.InvocationTargetException;
import java.util.Iterator;
import java.util.Map;
@@ -81,6 +82,7 @@
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.tags.core.UseBeanTag;
@@ -119,11 +121,17 @@
/**
* Sets the Action of this component
*/
- public void setAction(Action action) throws Exception {
+ public void setAction(Action action) throws JellyException {
Component component = getComponent();
if ( component != null ) {
// lets just try set the 'action' property
- BeanUtils.setProperty( component, "action", action );
+ try {
+ BeanUtils.setProperty( component, "action", action );
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
+ }
}
}
@@ -252,7 +260,7 @@
/**
* A class may be specified otherwise the Factory will be used.
*/
- protected Class convertToClass(Object classObject) throws Exception {
+ protected Class convertToClass(Object classObject) throws MissingAttributeException, ClassNotFoundException {
if (classObject == null) {
return null;
}
@@ -264,12 +272,22 @@
/**
* A class may be specified otherwise the Factory will be used.
*/
- protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws Exception {
+ protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws JellyException {
if (theClass != null ) {
- return theClass.newInstance();
+ try {
+ return theClass.newInstance();
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InstantiationException e) {
+ throw new JellyException(e);
+ }
}
else {
- return factory.newInstance();
+ try {
+ return factory.newInstance();
+ } catch (InstantiationException e) {
+ throw new JellyException(e);
+ }
}
}
@@ -277,7 +295,7 @@
/**
* Either defines a variable or adds the current component to the parent
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
if (var != null) {
context.setVariable(var, bean);
}
@@ -298,7 +316,7 @@
/**
* Patch to handle wierd properties that don't quite match the Java Beans contract
*/
- protected void setBeanProperties(Object bean, Map attributes) throws Exception {
+ protected void setBeanProperties(Object bean, Map attributes) throws JellyException {
for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry entry = (Map.Entry) iter.next();
String name = (String) entry.getKey();
@@ -373,11 +391,23 @@
v.intValue());
}
else {
- BeanUtils.setProperty(component, name, value);
+ try {
+ BeanUtils.setProperty(component, name, value);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
+ }
}
}
else {
- BeanUtils.setProperty(bean, name, value);
+ try {
+ BeanUtils.setProperty(bean, name, value);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
+ }
}
}
}
1.3 +3 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ContainerTag.java
Index: ContainerTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ContainerTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ContainerTag.java 30 Oct 2002 19:16:19 -0000 1.2
+++ ContainerTag.java 24 Jan 2003 10:04:30 -0000 1.3
@@ -61,6 +61,8 @@
*/
package org.apache.commons.jelly.tags.swing;
+import org.apache.commons.jelly.JellyException;
+
import java.awt.Component;
/**
@@ -77,5 +79,5 @@
* Adds a child component to this container with optional constraints.
* If the constraints are null they are ignored
*/
- public void addChild(Component component, Object constraints) throws Exception;
+ public void addChild(Component component, Object constraints) throws JellyException;
}
1.2 +8 -6 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/DialogTag.java
Index: DialogTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/DialogTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DialogTag.java 3 Jan 2003 21:22:36 -0000 1.1
+++ DialogTag.java 24 Jan 2003 10:04:30 -0000 1.2
@@ -68,6 +68,7 @@
import java.util.Map;
import javax.swing.JDialog;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.tags.core.UseBeanTag;
import org.apache.commons.logging.Log;
@@ -95,7 +96,8 @@
/**
* Creates a JDialog. The constructor used depends on the value of the owner attribute.
*/
- protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws Exception {
+ protected Object newInstance(Class theClass, Map attributes, XMLOutput output)
+ throws JellyException {
Object owner = attributes.remove( "owner" );
if (owner instanceof Frame) {
return new JDialog((Frame) owner);
1.5 +12 -4 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/GbcTag.java
Index: GbcTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/GbcTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GbcTag.java 11 Dec 2002 12:40:57 -0000 1.4
+++ GbcTag.java 24 Jan 2003 10:04:30 -0000 1.5
@@ -66,6 +66,7 @@
import java.util.Map;
import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.tags.core.UseBeanTag;
import org.apache.commons.jelly.tags.swing.impl.GridBagConstraintBean;
@@ -106,7 +107,7 @@
/**
* Adds a child component to this parent
*/
- public void addChild(Component component, Object constraints) throws Exception {
+ public void addChild(Component component, Object constraints) throws JellyException {
GridBagLayoutTag tag = (GridBagLayoutTag) findAncestorWithClass( GridBagLayoutTag.class );
if (tag == null) {
throw new JellyException( "this tag must be nested within a <tr> tag" );
@@ -120,7 +121,8 @@
/**
* A class may be specified otherwise the Factory will be used.
*/
- protected Class convertToClass(Object classObject) throws Exception {
+ protected Class convertToClass(Object classObject)
+ throws MissingAttributeException, ClassNotFoundException {
if (classObject == null) {
return null;
}
@@ -132,9 +134,15 @@
/**
* A class may be specified otherwise the Factory will be used.
*/
- protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws Exception {
+ protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws JellyException {
if (theClass != null ) {
- return theClass.newInstance();
+ try {
+ return theClass.newInstance();
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InstantiationException e) {
+ throw new JellyException(e);
+ }
}
else {
return new GridBagConstraintBean();
1.4 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/GridBagLayoutTag.java
Index: GridBagLayoutTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/GridBagLayoutTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GridBagLayoutTag.java 11 Dec 2002 12:40:57 -0000 1.3
+++ GridBagLayoutTag.java 24 Jan 2003 10:04:30 -0000 1.4
@@ -87,7 +87,7 @@
/**
* Creates a GridBagLayout
*/
- protected LayoutManager createLayoutManager() throws Exception {
+ protected LayoutManager createLayoutManager() {
return new GridBagLayout();
}
}
1.4 +2 -2 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/LayoutTagSupport.java
Index: LayoutTagSupport.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/LayoutTagSupport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LayoutTagSupport.java 11 Dec 2002 12:40:57 -0000 1.3
+++ LayoutTagSupport.java 24 Jan 2003 10:04:30 -0000 1.4
@@ -90,7 +90,7 @@
/**
* Adds the given layout component to the container with the specified constraints
*/
- public void addLayoutComponent(Component component, Object constraints) throws Exception {
+ public void addLayoutComponent(Component component, Object constraints) throws JellyException {
getComponentTag().addChild(component, constraints);
}
@@ -130,7 +130,7 @@
/**
* @return the parent component tag or throw an exception
*/
- protected ComponentTag getComponentTag() throws Exception {
+ protected ComponentTag getComponentTag() throws JellyException {
ComponentTag tag = (ComponentTag) findAncestorWithClass( ComponentTag.class );
if ( tag == null ) {
throw new JellyException( "This tag must be nested within a JellySwing widget tag" );
1.5 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableModelColumnTag.java
Index: TableModelColumnTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableModelColumnTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TableModelColumnTag.java 24 Jan 2003 05:54:37 -0000 1.4
+++ TableModelColumnTag.java 24 Jan 2003 10:04:30 -0000 1.5
@@ -87,7 +87,7 @@
// Implementation methods
//-------------------------------------------------------------------------
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
super.processBean(var, bean);
TableModelTag tag = (TableModelTag) findAncestorWithClass( TableModelTag.class );
1.4 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableModelTag.java
Index: TableModelTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableModelTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TableModelTag.java 11 Dec 2002 12:40:57 -0000 1.3
+++ TableModelTag.java 24 Jan 2003 10:04:30 -0000 1.4
@@ -82,7 +82,7 @@
// Implementation methods
//-------------------------------------------------------------------------
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
super.processBean(var, bean);
ComponentTag tag = (ComponentTag) findAncestorWithClass( ComponentTag.class );
1.5 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TdTag.java
Index: TdTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TdTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TdTag.java 11 Dec 2002 12:40:57 -0000 1.4
+++ TdTag.java 24 Jan 2003 10:04:30 -0000 1.5
@@ -98,7 +98,7 @@
/**
* Adds a child component to this parent
*/
- public void addChild(Component component, Object constraints) throws Exception {
+ public void addChild(Component component, Object constraints) throws JellyException {
// add my child component to the layout manager
TrTag tag = (TrTag) findAncestorWithClass( TrTag.class );
if (tag == null) {
1.4 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TrTag.java
Index: TrTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TrTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TrTag.java 11 Dec 2002 12:40:57 -0000 1.3
+++ TrTag.java 24 Jan 2003 10:04:30 -0000 1.4
@@ -96,7 +96,7 @@
/**
* Adds a new cell to this row
*/
- public void addCell(Component component, GridBagConstraints constraints) throws Exception {
+ public void addCell(Component component, GridBagConstraints constraints) throws JellyException {
constraints.gridx = cells.size();
cells.add(new Cell(constraints, component));
}
1.2 +18 -6 jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutDataTag.java
Index: LayoutDataTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutDataTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LayoutDataTag.java 6 Jan 2003 16:40:34 -0000 1.1
+++ LayoutDataTag.java 24 Jan 2003 10:04:31 -0000 1.2
@@ -62,6 +62,7 @@
package org.apache.commons.jelly.tags.swt;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.commons.jelly.JellyException;
@@ -93,7 +94,7 @@
/**
* Either defines a variable or adds the current component to the parent
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
super.processBean(var, bean);
Widget parent = getParentWidget();
@@ -115,7 +116,7 @@
Class theClass,
Map attributes,
XMLOutput output)
- throws Exception {
+ throws JellyException {
String text = (String) attributes.remove("style");
if (text != null) {
@@ -123,10 +124,21 @@
// now lets try invoke a constructor
Class[] types = { int.class };
- Constructor constructor = theClass.getConstructor(types);
- if (constructor != null) {
- Object[] values = { new Integer(style) };
- return constructor.newInstance(values);
+
+ try {
+ Constructor constructor = theClass.getConstructor(types);
+ if (constructor != null) {
+ Object[] values = { new Integer(style) };
+ return constructor.newInstance(values);
+ }
+ } catch (NoSuchMethodException e) {
+ throw new JellyException(e);
+ } catch (InstantiationException e) {
+ throw new JellyException(e);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
}
}
return super.newInstance(theClass, attributes, output);
1.2 +2 -2 jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutTag.java
Index: LayoutTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LayoutTag.java 6 Jan 2003 16:40:34 -0000 1.1
+++ LayoutTag.java 24 Jan 2003 10:04:31 -0000 1.2
@@ -105,7 +105,7 @@
/**
* Either defines a variable or adds the current component to the parent
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
super.processBean(var, bean);
Widget parent = getParentWidget();
@@ -122,7 +122,7 @@
* @see org.apache.commons.jelly.tags.swt.LayoutTagSupport#convertValue(java.lang.Object, java.lang.String, java.lang.Object)
*/
protected Object convertValue(Object bean, String name, Object value)
- throws Exception {
+ throws JellyException {
if (bean instanceof FillLayout && name.equals("type") && value instanceof String) {
int style = SwtHelper.parseStyle(SWT.class, (String) value);
1.2 +22 -12 jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutTagSupport.java
Index: LayoutTagSupport.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/LayoutTagSupport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LayoutTagSupport.java 6 Jan 2003 16:40:34 -0000 1.1
+++ LayoutTagSupport.java 24 Jan 2003 10:04:31 -0000 1.2
@@ -62,11 +62,13 @@
package org.apache.commons.jelly.tags.swt;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.tags.core.UseBeanTag;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -118,7 +120,7 @@
/**
* Either defines a variable or adds the current component to the parent
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
if (var != null) {
context.setVariable(var, bean);
}
@@ -128,7 +130,7 @@
* @see org.apache.commons.jelly.tags.core.UseBeanTag#setBeanProperties(java.lang.Object, java.util.Map)
*/
protected void setBeanProperties(Object bean, Map attributes)
- throws Exception {
+ throws JellyException {
if (bean != null) {
Class theClass = bean.getClass();
@@ -139,16 +141,24 @@
value = convertValue(bean, name, value);
- // lets first see if there's a field available
- Field field = theClass.getField(name);
- if (field != null) {
- if (value instanceof String) {
- value = ConvertUtils.convert((String) value, field.getType());
+ try {
+ // lets first see if there's a field available
+ Field field = theClass.getField(name);
+ if (field != null) {
+ if (value instanceof String) {
+ value = ConvertUtils.convert((String) value, field.getType());
+ }
+ field.set(bean, value);
}
- field.set(bean, value);
- }
- else {
- BeanUtils.setProperty(bean, name, value);
+ else {
+ BeanUtils.setProperty(bean, name, value);
+ }
+ } catch (NoSuchFieldException e) {
+ throw new JellyException(e);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
}
}
}
@@ -163,7 +173,7 @@
* @param value the value of the property
* @return the new value
*/
- protected Object convertValue(Object bean, String name, Object value) throws Exception {
+ protected Object convertValue(Object bean, String name, Object value) throws JellyException {
return value;
}
1.2 +6 -5 jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/SwtHelper.java
Index: SwtHelper.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/SwtHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SwtHelper.java 6 Jan 2003 16:40:34 -0000 1.1
+++ SwtHelper.java 24 Jan 2003 10:04:31 -0000 1.2
@@ -90,7 +90,7 @@
* @param text is a comma delimited text value such as "border, resize"
* @return the int code
*/
- public static int parseStyle(Class constantClass, String text) throws Exception {
+ public static int parseStyle(Class constantClass, String text) throws JellyException {
return parseStyle(constantClass, text, true);
}
@@ -105,7 +105,7 @@
*
* @return the int code
*/
- public static int parseStyle(Class constantClass, String text, boolean toUpperCase) throws Exception {
+ public static int parseStyle(Class constantClass, String text, boolean toUpperCase) throws JellyException{
int answer = 0;
if (text != null) {
if (toUpperCase) {
@@ -124,7 +124,7 @@
* @return the code for the given word or zero if the word doesn't match a
* valid style
*/
- public static int getStyleCode(Class constantClass,String text) throws Exception {
+ public static int getStyleCode(Class constantClass,String text) throws JellyException {
try {
Field field = constantClass.getField(text);
if (field == null) {
@@ -132,8 +132,9 @@
return 0;
}
return field.getInt(null);
- }
- catch (Exception e) {
+ } catch (NoSuchFieldException e) {
+ throw new JellyException("The value: " + text + " is not understood", e);
+ } catch (IllegalAccessException e) {
throw new JellyException("The value: " + text + " is not understood", e);
}
}
1.2 +35 -24 jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/WidgetTag.java
Index: WidgetTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/WidgetTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WidgetTag.java 6 Jan 2003 16:40:34 -0000 1.1
+++ WidgetTag.java 24 Jan 2003 10:04:31 -0000 1.2
@@ -62,6 +62,7 @@
package org.apache.commons.jelly.tags.swt;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.commons.jelly.JellyException;
@@ -126,7 +127,7 @@
/**
* Factory method to create a new widget
*/
- protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws Exception {
+ protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws JellyException {
int style = getStyle(attributes);
// now lets call the constructor with the parent
@@ -157,43 +158,53 @@
* @param style the SWT style code
* @return the new Widget
*/
- protected Object createWidget(Class theClass, Widget parent, int style) throws Exception {
+ protected Object createWidget(Class theClass, Widget parent, int style) throws JellyException {
if (theClass == null) {
throw new JellyException( "No Class available to create the new widget");
}
- if (parent == null) {
- // lets try call a constructor with a single style
- Class[] types = { int.class };
- Constructor constructor = theClass.getConstructor(types);
- if (constructor != null) {
- Object[] arguments = { new Integer(style)};
- return constructor.newInstance(arguments);
- }
- }
- else {
- // lets try to find the constructor with 2 arguments with the 2nd argument being an int
- Constructor[] constructors = theClass.getConstructors();
- if (constructors != null) {
- for (int i = 0, size = constructors.length; i < size; i++ ) {
- Constructor constructor = constructors[i];
- Class[] types = constructor.getParameterTypes();
- if (types.length == 2 && types[1].isAssignableFrom(int.class)) {
- if (types[0].isAssignableFrom(parent.getClass())) {
- Object[] arguments = { parent, new Integer(style)};
- return constructor.newInstance(arguments);
+
+ try {
+ if (parent == null) {
+ // lets try call a constructor with a single style
+ Class[] types = { int.class };
+ Constructor constructor = theClass.getConstructor(types);
+ if (constructor != null) {
+ Object[] arguments = { new Integer(style)};
+ return constructor.newInstance(arguments);
+ }
+ } else {
+ // lets try to find the constructor with 2 arguments with the 2nd argument being an int
+ Constructor[] constructors = theClass.getConstructors();
+ if (constructors != null) {
+ for (int i = 0, size = constructors.length; i < size; i++ ) {
+ Constructor constructor = constructors[i];
+ Class[] types = constructor.getParameterTypes();
+ if (types.length == 2 && types[1].isAssignableFrom(int.class)) {
+ if (types[0].isAssignableFrom(parent.getClass())) {
+ Object[] arguments = { parent, new Integer(style)};
+ return constructor.newInstance(arguments);
+ }
}
}
}
}
+ return theClass.newInstance();
+ } catch (NoSuchMethodException e) {
+ throw new JellyException(e);
+ } catch (InstantiationException e) {
+ throw new JellyException(e);
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException(e);
}
- return theClass.newInstance();
}
/**
* Creates the SWT style code for the current attributes
* @return the SWT style code
*/
- protected int getStyle(Map attributes) throws Exception {
+ protected int getStyle(Map attributes) throws JellyException {
String text = (String) attributes.remove("style");
if (text != null) {
return SwtHelper.parseStyle(SWT.class, text);
1.7 +1 -1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/CompositeExpression.java
Index: CompositeExpression.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/expression/CompositeExpression.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CompositeExpression.java 24 Jan 2003 07:40:59 -0000 1.6
+++ CompositeExpression.java 24 Jan 2003 10:04:32 -0000 1.7
@@ -106,7 +106,7 @@
*
* @return the Expresssion for the given String.
* @throws JellyException if the text is invalid (such as missing '}' character).
- * @throws Exception if there was some problem creating the underlying Expression object
+ * @throws JellyException if there was some problem creating the underlying Expression object
* from the ExpressionFactory
*/
public static Expression parse(String text, ExpressionFactory factory) throws JellyException {
1.3 +3 -1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/BeanSource.java
Index: BeanSource.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/BeanSource.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BeanSource.java 30 Oct 2002 19:16:23 -0000 1.2
+++ BeanSource.java 24 Jan 2003 10:04:32 -0000 1.3
@@ -61,6 +61,8 @@
*/
package org.apache.commons.jelly.impl;
+import org.apache.commons.jelly.JellyException;
+
/**
* A tag which is associated with a JavaBean, such as a {@link DynamicBeanTag}
*
@@ -72,5 +74,5 @@
/**
* @return the bean to which this tag is associated
*/
- public Object getBean() throws Exception;
+ public Object getBean() throws JellyException;
}
1.7 +3 -3 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/DynamicBeanTag.java
Index: DynamicBeanTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/DynamicBeanTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DynamicBeanTag.java 24 Jan 2003 01:48:45 -0000 1.6
+++ DynamicBeanTag.java 24 Jan 2003 10:04:32 -0000 1.7
@@ -223,10 +223,10 @@
method.invoke( bean, emptyArgs );
}
catch (IllegalAccessException e) {
- methodInvocationError(bean, method, e);
+ methodInvocationException(bean, method, e);
}
catch (IllegalArgumentException e) {
- methodInvocationError(bean, method, e);
+ methodInvocationException(bean, method, e);
}
catch (InvocationTargetException e) {
// methodInvocationError(bean, method, e);
@@ -254,7 +254,7 @@
* @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 {
+ private void methodInvocationException(Object bean, Method method, Exception e) throws Exception {
log.error("Could not invoke " + method, e);
BeanMap beanMap = new BeanMap(bean);
1.34 +6 -6 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java
Index: TagScript.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- TagScript.java 24 Jan 2003 05:26:13 -0000 1.33
+++ TagScript.java 24 Jan 2003 10:04:32 -0000 1.34
@@ -565,7 +565,7 @@
* @param requiredType the type that the value should be converted to
*/
protected Object convertType(Object value, Class requiredType)
- throws Exception {
+ throws JellyException {
if (requiredType.isInstance(value)) {
return value;
}
1.45 +9 -13 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/parser/XMLParser.java
Index: XMLParser.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/parser/XMLParser.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- XMLParser.java 23 Jan 2003 22:25:01 -0000 1.44
+++ XMLParser.java 24 Jan 2003 10:04:33 -0000 1.45
@@ -79,6 +79,7 @@
import org.apache.commons.collections.ArrayStack;
import org.apache.commons.jelly.JellyContext;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.Script;
import org.apache.commons.jelly.Tag;
import org.apache.commons.jelly.TagLibrary;
@@ -745,11 +746,7 @@
else {
tagScript = (TagScript) tagScriptStack.get(tagScriptStack.size() - 1);
}
- }
- catch (SAXException e) {
- throw e;
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.error( "Caught exception: " + e, e );
throw new SAXException( "Runtime Exception: " + e, e );
}
@@ -1159,7 +1156,7 @@
* Adds the text to the current script block parsing any embedded
* expressions inot ExpressionScript objects.
*/
- protected void addTextScript(String text) throws Exception {
+ protected void addTextScript(String text) throws JellyException {
Expression expression =
CompositeExpression.parse(text, getExpressionFactory());
@@ -1199,8 +1196,7 @@
protected Expression createConstantExpression(
String tagName,
String attributeName,
- String attributeValue)
- throws Exception {
+ String attributeValue) {
return new ConstantExpression(attributeValue);
}
1.4 +8 -7 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/servlet/JellyServlet.java
Index: JellyServlet.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/servlet/JellyServlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JellyServlet.java 17 Dec 2002 08:32:56 -0000 1.3
+++ JellyServlet.java 24 Jan 2003 10:04:33 -0000 1.4
@@ -76,6 +76,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.jelly.JellyContext;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.XMLOutput;
/**
@@ -183,14 +184,14 @@
* @param res
* @throws IOException
* @throws UnsupportedEncodingException
- * @throws Exception
+ * @throws JellyException
*/
protected void runScript(
URL script,
JellyContext context,
HttpServletRequest req,
HttpServletResponse res)
- throws IOException, UnsupportedEncodingException, Exception {
+ throws IOException, UnsupportedEncodingException, JellyException {
ServletOutputStream output = res.getOutputStream();
XMLOutput xmlOutput = XMLOutput.createXMLOutput(output);
1.8 +8 -5 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/FileTag.java
Index: FileTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/FileTag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FileTag.java 11 Jan 2003 10:47:59 -0000 1.7
+++ FileTag.java 24 Jan 2003 10:04:33 -0000 1.8
@@ -69,6 +69,8 @@
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
+import org.xml.sax.SAXException;
+
/**
* A tag that pipes its body to a file denoted by the name attribute or to an in memory String
* which is then output to a variable denoted by the var variable.
@@ -183,23 +185,24 @@
/**
* Writes the body fo this tag to the given Writer
*/
- protected void writeBody(Writer writer) throws Exception {
+ protected void writeBody(Writer writer) throws JellyException {
XMLOutput newOutput = createXMLOutput(writer);
try {
newOutput.startDocument();
invokeBody(newOutput);
newOutput.endDocument();
- }
- finally {
- newOutput.close();
+ } catch (SAXException e) {
+ throw new JellyException(e);
+ } finally {
+ try { newOutput.close(); } catch (IOException e) {}
}
}
/**
* A Factory method to create a new XMLOutput from the given Writer.
*/
- protected XMLOutput createXMLOutput(Writer writer) throws Exception {
+ protected XMLOutput createXMLOutput(Writer writer) throws JellyException {
OutputFormat format = null;
if (prettyPrint) {
1.4 +10 -2 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/SetPropertiesTag.java
Index: SetPropertiesTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/SetPropertiesTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SetPropertiesTag.java 30 Oct 2002 19:16:20 -0000 1.3
+++ SetPropertiesTag.java 24 Jan 2003 10:04:33 -0000 1.4
@@ -56,10 +56,12 @@
*/
package org.apache.commons.jelly.tags.core;
+import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.MapTagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -112,7 +114,13 @@
* Sets the properties on the bean. Derived tags could implement some custom
* type conversion etc.
*/
- protected void setBeanProperties(Object bean, Map attributes) throws Exception {
- BeanUtils.populate(bean, attributes);
+ protected void setBeanProperties(Object bean, Map attributes) throws JellyException {
+ try {
+ BeanUtils.populate(bean, attributes);
+ } catch (IllegalAccessException e) {
+ throw new JellyException("could not set the properties on a bean",e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException("could not set the properties on a bean",e);
+ }
}
}
1.11 +10 -8 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/SetTag.java
Index: SetTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/SetTag.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SetTag.java 11 Dec 2002 12:40:54 -0000 1.10
+++ SetTag.java 24 Jan 2003 10:04:33 -0000 1.11
@@ -61,6 +61,7 @@
*/
package org.apache.commons.jelly.tags.core;
+import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
@@ -187,7 +188,7 @@
// Implementation methods
//-------------------------------------------------------------------------
- protected void setPropertyValue( Object target, String property, Object value ) throws Exception {
+ protected void setPropertyValue( Object target, String property, Object value ) {
try {
if ( target instanceof Map ) {
Map map = (Map) target;
@@ -196,8 +197,9 @@
else {
BeanUtils.setProperty( target, property, value );
}
- }
- catch (Exception e) {
+ } catch (InvocationTargetException e) {
+ log.error( "Failed to set the property: " + property + " on bean: " + target + " to value: " + value + " due to exception: " + e, e );
+ } catch (IllegalAccessException e) {
log.error( "Failed to set the property: " + property + " on bean: " + target + " to value: " + value + " due to exception: " + e, e );
}
}
1.8 +25 -10 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java
Index: UseBeanTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- UseBeanTag.java 30 Nov 2002 07:41:21 -0000 1.7
+++ UseBeanTag.java 24 Jan 2003 10:04:33 -0000 1.8
@@ -56,10 +56,12 @@
*/
package org.apache.commons.jelly.tags.core;
+import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.MapTagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -143,7 +145,8 @@
* otherwise it will be converted to a String and loaded
* using the default class loading mechanism.
*/
- protected Class convertToClass(Object classObject) throws Exception {
+ protected Class convertToClass(Object classObject)
+ throws MissingAttributeException, ClassNotFoundException {
if (classObject instanceof Class) {
return (Class) classObject;
}
@@ -165,11 +168,10 @@
* which is to try use the current Thread's context class loader first
* otherise use the class loader which loaded this class.
*/
- protected Class loadClass(String className) throws Exception {
+ protected Class loadClass(String className) throws ClassNotFoundException {
try {
- return Thread.currentThread().getContextClassLoader().loadClass(className);
- }
- catch (Exception e) {
+ return Thread.currentThread().getContextClassLoader().loadClass(className);
+ } catch (ClassNotFoundException e) {
return getClass().getClassLoader().loadClass(className);
}
}
@@ -179,16 +181,29 @@
* default constructor.
* Derived tags could do something different here.
*/
- protected Object newInstance(Class theClass, Map attributes, XMLOutput output) throws Exception {
- return theClass.newInstance();
+ protected Object newInstance(Class theClass, Map attributes, XMLOutput output)
+ throws JellyException {
+ try {
+ return theClass.newInstance();
+ } catch (IllegalAccessException e) {
+ throw new JellyException(e.toString());
+ } catch (InstantiationException e) {
+ throw new JellyException(e.toString());
+ }
}
/**
* Sets the properties on the bean. Derived tags could implement some custom
* type conversion etc.
*/
- protected void setBeanProperties(Object bean, Map attributes) throws Exception {
- BeanUtils.populate(bean, attributes);
+ protected void setBeanProperties(Object bean, Map attributes) throws JellyException {
+ try {
+ BeanUtils.populate(bean, attributes);
+ } catch (IllegalAccessException e) {
+ throw new JellyException("could not set the properties of the bean",e);
+ } catch (InvocationTargetException e) {
+ throw new JellyException("could not set the properties of the bean",e);
+ }
}
/**
@@ -196,7 +211,7 @@
* This Strategy method allows derived tags to process the beans in different ways
* such as to register this bean with its parent tag etc.
*/
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
if (var != null) {
context.setVariable(var, bean);
} else {
1.6 +2 -2 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseListTag.java
Index: UseListTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseListTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UseListTag.java 24 Jan 2003 05:54:37 -0000 1.5
+++ UseListTag.java 24 Jan 2003 10:04:33 -0000 1.6
@@ -106,12 +106,12 @@
// Implementation methods
//-------------------------------------------------------------------------
- protected void setBeanProperties(Object bean, Map attributes) throws Exception {
+ protected void setBeanProperties(Object bean, Map attributes) throws JellyException {
items = (Expression) attributes.remove("items");
super.setBeanProperties(bean, attributes);
}
- protected void processBean(String var, Object bean) throws Exception {
+ protected void processBean(String var, Object bean) throws JellyException {
super.processBean(var, bean);
List list = getList();
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>