cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r517733 [1/2] - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms: binding/ binding/library/ formmodel/ formmodel/library/ samples/bindings/
Date Tue, 13 Mar 2007 15:37:24 GMT
Author: vgritsenko
Date: Tue Mar 13 08:37:22 2007
New Revision: 517733

URL: http://svn.apache.org/viewvc?view=rev&rev=517733
Log:
continue exception handling refactoring

Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/BindingException.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ClassJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ExpandJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ImportJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathAdapter.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/StructJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPath.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPathBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/Library.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryException.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManagerImpl.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterField.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/Library.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/bindings/CustomValueWrapBinding.java

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -70,7 +70,7 @@
         super.doLoad(aggregate, subContext);
         aggregate.combineFields();
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Done loading " + toString());
+            getLogger().debug("Done loading " + this);
         }
     }
 
@@ -87,7 +87,7 @@
                 jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
         super.doSave(aggregate, subContext);
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Done saving " + toString());
+            getLogger().debug("Done saving " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -64,7 +64,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building aggregate field binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building aggregate field binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/BindingException.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/BindingException.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/BindingException.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/BindingException.java Tue Mar 13 08:37:22 2007
@@ -18,13 +18,14 @@
 
 import org.apache.cocoon.util.location.LocatedException;
 import org.apache.cocoon.util.location.Location;
+import org.apache.cocoon.forms.FormsException;
 
 /**
  * This exception is thrown when something goes wrong with the binding.
  *
  * @version $Id$
  */
-public class BindingException extends LocatedException {
+public class BindingException extends FormsException {
 
     public BindingException(String message, Location location) {
         super(message, location);

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -62,7 +62,7 @@
      * before continuing the binding over the child-bindings.
      */
     public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
-        Union unionWidget = (Union)frmModel;
+        Union unionWidget = (Union) frmModel;
         if (widgetId.equals(unionWidget.getValue())) {
             // JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
             Binding[] subBindings = getChildBindings();
@@ -73,7 +73,7 @@
                 }
             }
             if (getLogger().isDebugEnabled()) {
-                getLogger().debug("done loading " + toString());
+                getLogger().debug("done loading " + this);
             }
         }
     }
@@ -84,7 +84,7 @@
      * before continuing the binding over the child-bindings.
      */
     public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException {
-        Union unionWidget = (Union)frmModel;
+        Union unionWidget = (Union) frmModel;
         if (widgetId.equals(unionWidget.getValue())) {
             // JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
             Binding[] subBindings = getChildBindings();
@@ -95,7 +95,7 @@
                 }
             }
             if (getLogger().isDebugEnabled()) {
-                getLogger().debug("done saving " + toString());
+                getLogger().debug("done saving " + this);
             }
         }
     }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -65,7 +65,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building case binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building case binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ClassJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ClassJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ClassJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ClassJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -61,7 +61,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building class binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building class binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -86,11 +86,12 @@
         if (ptr.getNode() != null) {
             JXPathContext subContext = jxpc.getRelativeContext(ptr);
             super.doLoad(frmModel, subContext);
-            if (getLogger().isDebugEnabled())
-                getLogger().debug("done loading " + toString());
+            if (getLogger().isDebugEnabled()) {
+                getLogger().debug("done loading " + this);
+            }
         } else {
             if (getLogger().isDebugEnabled()) {
-                getLogger().debug("non-existent path: skipping " + toString());
+                getLogger().debug("non-existent path: skipping " + this);
             }
         }
     }
@@ -112,7 +113,7 @@
         JXPathContext subContext = jxpc.getRelativeContext(ptr);
         super.doSave(frmModel, subContext);
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + toString());
+            getLogger().debug("done saving " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -77,7 +77,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building context binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building context binding",
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -143,7 +143,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building custom binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building custom binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ExpandJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ExpandJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ExpandJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ExpandJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -28,8 +28,8 @@
  */
 public class ExpandJXPathBindingBuilder extends JXPathBindingBuilderBase {
 
-	/* (non-Javadoc)
-	 * @see org.apache.cocoon.forms.binding.JXPathBindingBuilderBase#buildBinding(org.w3c.dom.Element, org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant)
+	/**
+	 * @see JXPathBindingBuilderBase#buildBinding(Element, JXPathBindingManager.Assistant)
 	 */
 	public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant)
     throws BindingException {
@@ -37,15 +37,16 @@
 		Library lib = assistant.getContext().getLocalLibrary();
 
 		String id = DomHelper.getAttribute(bindingElm, "id", null);
-
         if (id == null) {
-            throw new BindingException("Attribute id is required! (at " + DomHelper.getLocation(bindingElm) + ")");
+            throw new BindingException("Attribute id is required",
+                                       DomHelper.getLocationObject(bindingElm));
         }
 
         try {
             return (JXPathBindingBase) lib.getBinding(id);
         } catch (LibraryException e) {
-            throw new BindingException("Could not expand binding from library! (at " + DomHelper.getLocation(bindingElm) + ")", e);
+            throw new BindingException("Could not expand binding from library", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -65,7 +65,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building group binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building group binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ImportJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ImportJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ImportJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ImportJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -30,7 +30,7 @@
  */
 public class ImportJXPathBindingBuilder extends JXPathBindingBuilderBase {
 
-	/* (non-Javadoc)
+	/**
 	 * @see JXPathBindingBuilderBase#buildBinding(Element, JXPathBindingManager.Assistant)
 	 */
 	public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant)
@@ -39,18 +39,18 @@
 
         String prefix = DomHelper.getAttribute(bindingElm, "prefix", null);
         String uri = DomHelper.getAttribute(bindingElm, "uri", null);
-
         if (prefix == null || uri == null) {
-            throw new BindingException("Import needs to specify both @uri and @prefix! (at " + DomHelper.getLocation(bindingElm) + ")");
+            throw new BindingException("Import needs to specify both @uri and @prefix!",
+                                       DomHelper.getLocationObject(bindingElm));
         }
 
         try {
             lib.includeAs(prefix, uri);
         } catch (LibraryException e) {
-            throw new BindingException("Could not import library !(at " + DomHelper.getLocation(bindingElm) + ")", e);
+            throw new BindingException("Could not import library", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
 
         return new ImportJXPathBinding();
 	}
-
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -91,8 +91,9 @@
             // invoke this method with this new beast.
             addMethod.invoke(parent, args);
 
-            if (getLogger().isDebugEnabled())
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("InsertBean performed.");
+            }
         } catch (Exception e) {
             throw new CascadingRuntimeException("InsertBean failed.", e);
         }
@@ -125,7 +126,7 @@
         // });
         //
         // if (getLogger().isDebugEnabled())
-        //     getLogger().debug("done registered factory for inserting node -- " + toString());
+        //     getLogger().debug("done registered factory for inserting node -- " + this);
     }
 
     public String toString() {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -69,7 +69,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building a insert-bean binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building a insert-bean binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -89,7 +89,7 @@
         // });
         //
         // if (getLogger().isDebugEnabled())
-        //     getLogger().debug("done registered factory for inserting node -- " + toString());
+        //     getLogger().debug("done registered factory for inserting node -- " + this);
     }
 
     public String toString() {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -63,7 +63,7 @@
             String src = DomHelper.getAttribute(bindingElm, "src", null);
             if (src != null) {
                 ServiceManager manager = assistant.getServiceManager();
-                SourceResolver sourceResolver = (SourceResolver)manager.lookup(SourceResolver.ROLE);
+                SourceResolver sourceResolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
                 Source source = null;
                 try {
                     source = sourceResolver.resolveURI(src);
@@ -72,14 +72,18 @@
 
                     String xpath = DomHelper.getAttribute(bindingElm, "xpath", null);
                     if (xpath != null) {
-                        XPathProcessor xpathProcessor = (XPathProcessor)manager.lookup(XPathProcessor.ROLE);
+                        XPathProcessor xpathProcessor = (XPathProcessor) manager.lookup(XPathProcessor.ROLE);
                         try {
                             Node node = xpathProcessor.selectSingleNode(document, xpath);
-                            if (node == null)
-                                throw new BindingException("XPath expression \"" + xpath + "\" didn't return a result.");
-                            if (!(node instanceof Element))
-                                throw new BindingException("XPath expression \"" + xpath + "\" did not return an element node.");
-                            element = (Element)node;
+                            if (node == null) {
+                                throw new BindingException("XPath expression '" + xpath + "' didn't return a result.",
+                                                           DomHelper.getLocationObject(bindingElm));
+                            }
+                            if (!(node instanceof Element)) {
+                                throw new BindingException("XPath expression '" + xpath + "' did not return an element node.",
+                                                           DomHelper.getLocationObject(bindingElm));
+                            }
+                            element = (Element) node;
                         } finally {
                             manager.release(xpathProcessor);
                         }
@@ -92,7 +96,7 @@
                     }
                     manager.release(sourceResolver);
                 }
-            } else if(bindingElm.hasChildNodes()) {
+            } else if (bindingElm.hasChildNodes()) {
                 // FIXME: using the binding's document prevents it to be garbage collected.
                 //        --> create a new Document and use doc.importNode();
                 domTemplate = bindingElm.getOwnerDocument().createDocumentFragment();
@@ -101,7 +105,7 @@
                 for (int i = 0; i < size; i++) {
                     Node node = nested.item(i).cloneNode(true);
                     if (node.getNodeType() == Node.ELEMENT_NODE) {
-                        LocationAttributes.remove((Element)node, true);
+                        LocationAttributes.remove((Element) node, true);
                     }
                     domTemplate.appendChild(node);
                 }
@@ -118,8 +122,11 @@
             }
 
             return new InsertNodeJXPathBinding(commonAtts, domTemplate);
+        } catch (BindingException e) {
+            throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building the insert-node binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building the insert-node binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java Tue Mar 13 08:37:22 2007
@@ -107,12 +107,14 @@
             //TODO: should we eventually remove this?
             //throw an error if people are still using the old-style @read-only or @readonly
             if (DomHelper.getAttributeAsBoolean(bindingElm, "readonly", false)) {
-                throw new BindingException("Error in binding file " + location
-                        + "\nThe usage of the attribute @readonly has been deprecated in favour of @direction.");
+                throw new BindingException("Error in the binding." +
+                                           "\nThe usage of the attribute @readonly has been deprecated in favour of @direction.",
+                                           DomHelper.getLocationObject(bindingElm));
             }
             if (DomHelper.getAttributeAsBoolean(bindingElm, "read-only", false)) {
-                throw new BindingException("Error in binding file " + location
-                        + "\nThe usage of the attribute @read-only has been deprecated in favour of @direction.");
+                throw new BindingException("Error in the binding." +
+                                           "\nThe usage of the attribute @read-only has been deprecated in favour of @direction.",
+                                           DomHelper.getLocationObject(bindingElm));
             }
 
             String direction = DomHelper.getAttribute(bindingElm, "direction", "both");
@@ -130,9 +132,11 @@
             Map nsDeclarationMap = DomHelper.getInheritedNSDeclarations(bindingElm);
             // we (actually jxpath) doesn't support un-prefixed namespace-declarations:
             // so we decide to break on those above silently ignoring them
-            if (nsDeclarationMap != null && nsDeclarationMap.values().contains(null))
-                throw new BindingException("Error in binding file " + location
-                                + "\nBinding doesn't support having namespace-declarations without explicit prefixes.");
+            if (nsDeclarationMap != null && nsDeclarationMap.values().contains(null)) {
+                throw new BindingException("Error in the binding." +
+                                           "\nBinding doesn't support having namespace-declarations without explicit prefixes.",
+                                           DomHelper.getLocationObject(bindingElm));
+            }
 
             String jxPathFactoryName = bindingElm.getAttribute("jxpath-factory");
             AbstractFactory jxPathFactory = null;
@@ -141,7 +145,8 @@
                     Class jxPathFactoryClass = JXPathBindingBuilderBase.class.getClassLoader().loadClass(jxPathFactoryName);
                     jxPathFactory = (AbstractFactory)jxPathFactoryClass.newInstance();
                 } catch (Exception e) {
-                    throw new BindingException("Error with specified jxpath factory " + jxPathFactoryName, e);
+                    throw new BindingException("Error with specified jxpath factory " + jxPathFactoryName, e,
+                                               DomHelper.getLocationObject(bindingElm));
                 }
             }
 
@@ -149,33 +154,38 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
      }
 
     public static CommonAttributes mergeCommonAttributes(CommonAttributes existing, CommonAttributes extra) {
-
-    	if (extra == null) {
+        if (extra == null) {
             return existing;
         }
 
         Boolean leniency;
-        if (existing.leniency == null)
+        if (existing.leniency == null) {
             leniency = extra.leniency;
-        else
+        } else {
             leniency = existing.leniency;
+        }
 
         String strLeniency = null;
-        if (leniency != null)
+        if (leniency != null) {
             strLeniency = leniency.toString();
+        }
 
         String direction = existing.direction;
-        if (extra.direction != null) // was defined
+        if (extra.direction != null) {
+            // was defined
             direction = extra.direction;
+        }
 
         AbstractFactory jxPathFactory = existing.jxPathFactory;
-        if (extra.jxPathFactory != null)
+        if (extra.jxPathFactory != null) {
             jxPathFactory = extra.jxPathFactory;
+        }
 
         return new CommonAttributes(extra.location, direction, strLeniency, extra.nsDeclarations, jxPathFactory);
     }
@@ -185,7 +195,7 @@
      * member fields indicating the activity of the separate load and save
      * actions of a given binding.
      */
-    public static class CommonAttributes{
+    public static class CommonAttributes {
 
         /**
          * store direction (load/save enabledness) too for easier merging
@@ -221,7 +231,8 @@
 
         CommonAttributes(String location, String direction, String leniency,
                          Map nsDeclarations, AbstractFactory jxPathFactory){
-            this(location, isLoadEnabled(direction), isSaveEnabled(direction), decideLeniency(leniency), nsDeclarations, jxPathFactory);
+            this(location, isLoadEnabled(direction), isSaveEnabled(direction),
+                 decideLeniency(leniency), nsDeclarations, jxPathFactory);
             this.direction = direction;
         }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java Tue Mar 13 08:37:22 2007
@@ -140,8 +140,7 @@
             } catch (BindingException e) {
                 throw e;
             } catch (Exception e) {
-                throw new BindingException("Error creating binding from " +
-                        source.getURI(), e);
+                throw new BindingException("Error creating binding from " + source.getURI(), e);
             }
         }
 
@@ -157,8 +156,7 @@
                 sourceResolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
                 source = sourceResolver.resolveURI(bindingURI);
             } catch (Exception e) {
-                throw new BindingException("Error resolving binding source: " +
-                        bindingURI);
+                throw new BindingException("Error resolving binding source: " + bindingURI);
             }
             return createBinding(source);
         } finally {
@@ -174,8 +172,7 @@
     public Binding createBinding(Element bindingElement) throws BindingException {
         Binding binding = null;
         if (BindingManager.NAMESPACE.equals(bindingElement.getNamespaceURI())) {
-            binding = getBuilderAssistant()
-            .getBindingForConfigurationElement(bindingElement);
+            binding = getBuilderAssistant().getBindingForConfigurationElement(bindingElement);
             ((JXPathBindingBase) binding).enableLogging(getLogger());
             if (getLogger().isDebugEnabled()) {
                 getLogger().debug("Creation of new binding finished. " + binding);
@@ -217,14 +214,12 @@
         private BindingBuilderContext context = new BindingBuilderContext();
         private Stack contextStack = new Stack();
 
-
         private JXPathBindingBuilderBase getBindingBuilder(String bindingType)
         throws BindingException {
             try {
                 return (JXPathBindingBuilderBase) bindingBuilderSelector.select(bindingType);
             } catch (ServiceException e) {
-                throw new BindingException("Cannot handle binding element with " + "name \"" +
-                                           bindingType + "\".", e);
+                throw new BindingException("Cannot handle binding element '" + bindingType + "'.", e);
             }
         }
 
@@ -240,10 +235,9 @@
             boolean flag = false;
             if (context.getLocalLibrary() == null) {
                 // FIXME Use newLibrary()?
-                Library lib = new Library(libraryManager);
+                Library lib = new Library(libraryManager, getBuilderAssistant());
                 lib.enableLogging(getMyLogger());
                 context.setLocalLibrary(lib);
-                lib.setAssistant(getBuilderAssistant());
                 lib.setSourceURI(LocationAttributes.getURI(configElm));
                 flag = true;
             }
@@ -251,8 +245,7 @@
             if (context.getLocalLibrary() != null && configElm.hasAttribute("extends")) {
                 try {
                     context.setSuperBinding(context.getLocalLibrary().getBinding(configElm.getAttribute("extends")));
-
-                } catch(LibraryException e) {
+                } catch (LibraryException e) {
                     // throw new RuntimeException("Error extending binding! (at "+DomHelper.getLocation(configElm)+")", e);
                     throw new NestableRuntimeException("Error extending binding! (at " + DomHelper.getLocation(configElm) + ")", e);
                 }
@@ -261,7 +254,6 @@
             }
 
             JXPathBindingBase childBinding = bindingBuilder.buildBinding(configElm, this);
-
             if (flag && childBinding != null) {
                 childBinding.setEnclosingLibrary(context.getLocalLibrary());
             }
@@ -322,8 +314,9 @@
          */
         public JXPathBindingBase[] makeChildBindings(Element parentElement, JXPathBindingBase[] existingBindings)
         throws BindingException {
-            if (existingBindings == null)
+            if (existingBindings == null) {
                 existingBindings = new JXPathBindingBase[0];
+            }
 
             if (parentElement != null) {
                 Element[] childElements = DomHelper.getChildElements(
@@ -331,20 +324,20 @@
                 if (childElements.length > 0) {
                     JXPathBindingBase[] childBindings = new JXPathBindingBase[childElements.length];
                     for (int i = 0; i < childElements.length; i++) {
-
                         pushContext();
                         context.setSuperBinding(null);
 
                         String id = DomHelper.getAttribute(childElements[i], "id", null);
                         String path = DomHelper.getAttribute(childElements[i], "path", null);
-                        if(context.getLocalLibrary()!=null && childElements[i].getAttribute("extends")!=null) {
+                        if (context.getLocalLibrary() != null && childElements[i].getAttribute("extends") != null) {
                             try {
                                 context.setSuperBinding(context.getLocalLibrary().getBinding(childElements[i].getAttribute("extends")));
 
-                                if(context.getSuperBinding() == null) // not found in library
-                                    context.setSuperBinding(getBindingByIdOrPath(id,path,existingBindings));
-
-                            } catch(LibraryException e) {
+                                if (context.getSuperBinding() == null) {
+                                    // not found in library
+                                    context.setSuperBinding(getBindingByIdOrPath(id, path, existingBindings));
+                                }
+                            } catch (LibraryException e) {
                                 throw new BindingException("Error extending binding! (at "+DomHelper.getLocation(childElements[i])+")",e);
                             }
                         }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -130,7 +130,7 @@
             }
         } else {
             if (getLogger().isInfoEnabled()) {
-                getLogger().info("[Javascript Binding] - saveForm: No code available on the javascript binding with id \"" + this.getId() + "\"");
+                getLogger().info("[Javascript Binding] - saveForm: No code available on the javascript binding with id '" + getId() + "'");
             }
         }
     }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -170,10 +170,11 @@
             result.enableLogging(getLogger());
             return result;
 
-        } catch(BindingException be) {
-            throw be;
-        } catch(Exception e) {
-            throw new BindingException("Cannot build binding at " + DomHelper.getLocation(element), e);
+        } catch (BindingException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new BindingException("Cannot build binding", e,
+                                       DomHelper.getLocationObject(element));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -74,7 +74,7 @@
     public Locale getLocale() { return convertorLocale; }
 
     public void doLoad(Widget frmModel, JXPathContext jctx) throws BindingException {
-        Widget widget = selectWidget(frmModel,this.multiValueId);
+        Widget widget = selectWidget(frmModel, this.multiValueId);
         if (widget == null) {
             throw new BindingException("The widget with the ID [" + this.multiValueId
                     + "] referenced in the binding does not exist in the form definition.");
@@ -112,8 +112,9 @@
             widget.setValue(list.toArray());
         }
 
-        if (getLogger().isDebugEnabled())
-            getLogger().debug("done loading values " + toString());
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug("done loading values " + this);
+        }
     }
 
     public void doSave(Widget frmModel, JXPathContext jctx) throws BindingException {
@@ -167,7 +168,7 @@
 
 
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + toString() + " -- on-update == " + update);
+            getLogger().debug("done saving " + this + " -- on-update == " + update);
         }
 
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -96,7 +96,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building multi value binding defined at " + DomHelper.getLocation(bindingElem), e);
+            throw new BindingException("Error building multi value binding", e,
+                                       DomHelper.getLocationObject(bindingElem));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -58,7 +58,7 @@
     private void resolve() throws BindingException {
         classBinding = getClass(widgetId);
         if (classBinding == null) {
-            throw new BindingException("Class \"" + widgetId + "\" does not exist");
+            throw new BindingException("Class '" + widgetId + "' does not exist");
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/NewJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -61,7 +61,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building new binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building new binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathAdapter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathAdapter.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathAdapter.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathAdapter.java Tue Mar 13 08:37:22 2007
@@ -166,22 +166,25 @@
 		public int compare(Object o1, Object o2) {
 			RepeaterItem i1 = (RepeaterItem) o1;
 			RepeaterItem i2 = (RepeaterItem) o2;
-			Object val1 = null;
+
+            Object val1;
 			if (i1.getRow() != null) {
 				val1 = i1.getRow().getChild(field).getValue();
 			} else {
 				val1 = i1.getContext().getValue(path);
 			}
-			Object val2 = null;
+
+            Object val2;
 			if (i2.getRow() != null) {
 				val2 = i2.getRow().getChild(field).getValue();
 			} else {
 				val2 = i2.getContext().getValue(path);
 			}
-			if (val1 instanceof Comparable) {
-				return ((Comparable)val1).compareTo(val2);
-			}
-			return val1.toString().compareTo(val2.toString());
+
+            if (val1 instanceof Comparable) {
+                return ((Comparable) val1).compareTo(val2);
+            }
+            return val1.toString().compareTo(val2.toString());
 		}
 
 	}
@@ -194,8 +197,8 @@
 		public int compare(Object o1, Object o2) {
 			RepeaterItem i1 = (RepeaterItem) o1;
 			RepeaterItem i2 = (RepeaterItem) o2;
-			return ((Integer)i1.getHandle()).compareTo((Integer)i2.getHandle());
-		}
+            return ((Integer) i1.getHandle()).compareTo((Integer) i2.getHandle());
+        }
 	}
 
 	public RepeaterItem generateItem(RepeaterRow row) {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -168,7 +168,7 @@
             }
         }
         if (getLogger().isDebugEnabled())
-            getLogger().debug("done loading rows " + toString());
+            getLogger().debug("done loading rows " + this);
     }
 
     /**
@@ -290,7 +290,7 @@
 //            }
         }
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving rows " + toString());
+            getLogger().debug("done saving rows " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -17,7 +17,6 @@
 package org.apache.cocoon.forms.binding;
 
 import org.apache.cocoon.forms.util.DomHelper;
-import org.apache.cocoon.util.location.LocationAttributes;
 
 import org.w3c.dom.Element;
 
@@ -69,12 +68,12 @@
     throws BindingException {
         if (bindingElm.hasAttribute("unique-row-id")) {
             throw new BindingException("Attribute 'unique-row-id' is no more supported, use <fb:identity> instead",
-                                       LocationAttributes.getLocation(bindingElm));
+                                       DomHelper.getLocationObject(bindingElm));
         }
 
         if (bindingElm.hasAttribute("unique-path")) {
             throw new BindingException("Attribute 'unique-path' is no more supported, use <fb:identity> instead",
-                                       LocationAttributes.getLocation(bindingElm));
+                                       DomHelper.getLocationObject(bindingElm));
         }
 
         try {
@@ -92,7 +91,7 @@
             String adapterClass =
             	DomHelper.getAttribute(bindingElm, "adapter-class", null);
 
-//          do inheritance
+            // do inheritance
             RepeaterJXPathBinding otherBinding = (RepeaterJXPathBinding)assistant.getContext().getSuperBinding();
             JXPathBindingBase[] existingOnBind = null;
             JXPathBindingBase[] existingOnDelete = null;
@@ -184,8 +183,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building repeater binding defined at " +
-                            DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building repeater binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -63,7 +63,7 @@
     public void doSave(Widget frmModel, JXPathContext jxpc) {
         jxpc.setValue("@" + this.name, this.value);
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + toString());
+            getLogger().debug("done saving " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -65,8 +65,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building set-attribute binding defined at " +
-                    DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building set-attribute binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -112,14 +112,14 @@
             }
         }
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done loading rows " + toString());
+            getLogger().debug("done loading rows " + this);
         }
     }
 
     public void doSave(Widget frmModel, JXPathContext jctx)
     throws BindingException {
         // Find the repeater
-        Repeater repeater = (Repeater)selectWidget(frmModel, this.repeaterId);
+        Repeater repeater = (Repeater) selectWidget(frmModel, this.repeaterId);
 
         if (repeater.getSize() == 0 && this.deleteIfEmpty) {
             // Repeater is empty : erase all
@@ -138,8 +138,7 @@
                         this.rowPath + '[' + (i+1) + ']');
                 JXPathContext rowContext =
                     repeaterContext.getRelativeContext(rowPtr);
-                this.rowBinding.saveFormToModel(repeater.getRow(i),
-                        rowContext);
+                this.rowBinding.saveFormToModel(repeater.getRow(i), rowContext);
             }
         }
     }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -86,8 +86,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building repeater binding defined at " +
-                    DomHelper.getLocation(bindingElem), e);
+            throw new BindingException("Error building repeater binding", e,
+                                       DomHelper.getLocationObject(bindingElem));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/StructJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/StructJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/StructJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/StructJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -67,7 +67,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building struct binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building struct binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -176,7 +176,7 @@
         }
 
         if (getLogger().isDebugEnabled())
-            getLogger().debug("done loading rows " + toString());
+            getLogger().debug("done loading rows " + this);
     }
 
     public void doSave(Widget frmModel, JXPathContext jctx) throws BindingException {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -102,9 +102,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException(
-                    "Error building temp-repeater binding defined at " +
-                    DomHelper.getLocation(bindingElem), e);
+            throw new BindingException("Error building temp-repeater binding", e,
+                                       DomHelper.getLocationObject(bindingElem));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPath.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPath.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPath.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPath.java Tue Mar 13 08:37:22 2007
@@ -19,8 +19,6 @@
 	
     /**
      * Constructs FieldJXPathBinding.
-     *
-     * @param convertor may be null
      */
     public TreeModelJXPath(JXPathBindingBuilderBase.CommonAttributes commonAtts,
                               String widgetId,
@@ -52,7 +50,7 @@
     }
 
 	public void doSave(Widget frmModel, JXPathContext jxpc)
-			throws BindingException {
+    throws BindingException {
 		// Does nothing
 	}
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPathBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPathBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPathBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TreeModelJXPathBuilder.java Tue Mar 13 08:37:22 2007
@@ -1,9 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.cocoon.forms.binding;
 
 import org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant;
 import org.apache.cocoon.forms.util.DomHelper;
 import org.w3c.dom.Element;
 
+/**
+ * @version $Id$
+ */
 public class TreeModelJXPathBuilder extends JXPathBindingBuilderBase {
 
 	public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant) throws BindingException {
@@ -16,7 +35,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
 	}
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -65,9 +65,10 @@
     public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
         Widget widget = selectWidget(frmModel, this.widgetId);
         JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
-        if (!(widget instanceof Union))
+        if (!(widget instanceof Union)) {
             throw new RuntimeException("Binding: Expected Union widget, but received class: \"" +
                     widget.getClass().getName() + "\".");
+        }
         Union unionWidget = (Union)widget;
         Binding[] subBindings = getChildBindings();
         if (subBindings != null) {
@@ -77,7 +78,7 @@
             }
         }
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done loading " + toString());
+            getLogger().debug("done loading " + this);
         }
     }
 
@@ -97,7 +98,7 @@
             }
         }
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + toString());
+            getLogger().debug("done saving " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -65,7 +65,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building union binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building union binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java Tue Mar 13 08:37:22 2007
@@ -118,7 +118,7 @@
 
         widget.setValue(value);
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Done loading " + toString() + " -- value= " + value);
+            getLogger().debug("Done loading " + this + " -- value= " + value);
         }
     }
 
@@ -163,7 +163,7 @@
         }
 
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + toString() + " -- value= " + value + " -- on-update == " + update);
+            getLogger().debug("done saving " + this + " -- value= " + value + " -- on-update == " + update);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBindingBuilder.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBindingBuilder.java Tue Mar 13 08:37:22 2007
@@ -102,7 +102,8 @@
         } catch (BindingException e) {
             throw e;
         } catch (Exception e) {
-            throw new BindingException("Error building binding defined at " + DomHelper.getLocation(bindingElm), e);
+            throw new BindingException("Error building binding", e,
+                                       DomHelper.getLocationObject(bindingElm));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/Library.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/Library.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/Library.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/Library.java Tue Mar 13 08:37:22 2007
@@ -32,6 +32,8 @@
 import org.w3c.dom.Element;
 
 /**
+ * Form binding library.
+ *
  * @version $Id$
  */
 public class Library extends AbstractLogEnabled {
@@ -46,19 +48,16 @@
 	protected Map inclusions = new HashMap();
 
 	// shared object with dependencies
-	protected Object shared = new Object();
+	protected final Object shared = new Object();
 
 	protected String sourceURI;
 	protected JXPathBindingManager.Assistant assistant;
 
 
-	public Library(LibraryManager lm) {
-		manager = lm;
-	}
-
-	public void setAssistant(JXPathBindingManager.Assistant assistant) {
-		this.assistant = assistant;
-	}
+	public Library(LibraryManager lm, JXPathBindingManager.Assistant assistant) {
+		this.manager = lm;
+        this.assistant = assistant;
+    }
 
 	public void setSourceURI(String uri) {
 		sourceURI = uri;
@@ -68,10 +67,10 @@
 		return sourceURI;
 	}
 
-	public boolean dependenciesHaveChanged() throws Exception {
-        Iterator it = this.inclusions.values().iterator();
-        while (it.hasNext()) {
-            Dependency dep = (Dependency) it.next();
+	public boolean dependenciesHaveChanged() throws LibraryException {
+        Iterator i = this.inclusions.values().iterator();
+        while (i.hasNext()) {
+            Dependency dep = (Dependency) i.next();
             if (!dep.isValid()) {
                 return true;
             }
@@ -87,20 +86,17 @@
 	 * @param key the key
 	 * @param sourceURI the source of the library to be know as "key"
 	 * @return true if there was no such key used before, false otherwise
+     * @throws LibraryException if unable to load included library
 	 */
 	public boolean includeAs(String key, String sourceURI)
     throws LibraryException {
-		try {
-			// library keys may not contain ":"!
-            if ((!inclusions.containsKey(key) || key.indexOf(SEPARATOR) > -1)
-                    && manager.load(sourceURI, this.sourceURI) != null) {
-                inclusions.put(key, new Dependency(sourceURI));
-                return true;
-            }
-            return false;
-        } catch (Exception e) {
-            throw new LibraryException("Could not include library '" + sourceURI + "'", e);
+        // library keys may not contain ":"!
+        if (!inclusions.containsKey(key) || key.indexOf(SEPARATOR) > -1) {
+            manager.load(sourceURI, this.sourceURI);
+            inclusions.put(key, new Dependency(sourceURI));
+            return true;
         }
+        return false;
     }
 
 	public Binding getBinding(String key) throws LibraryException {
@@ -117,11 +113,12 @@
         }
 
         if (librarykey != null) {
-            if (inclusions.containsKey(librarykey)) {
+            Dependency dependency = (Dependency) inclusions.get(librarykey);
+            if (dependency != null) {
                 try {
-                    return manager.load(((Dependency) inclusions.get(librarykey)).dependencySourceURI, sourceURI).getBinding(definitionkey);
+                    return manager.load(dependency.dependencyURI, sourceURI).getBinding(definitionkey);
                 } catch (Exception e) {
-                    throw new LibraryException("Couldn't get Library key='" + librarykey + "' source='" + inclusions.get(librarykey) + "", e);
+                    throw new LibraryException("Couldn't get library '" + librarykey + "' source='" + dependency + "'", e);
                 }
             } else {
                 throw new LibraryException("Library '" + librarykey + "' does not exist! (lookup: '" + key + "')");
@@ -143,6 +140,10 @@
     }
 
     public void addBinding(Binding binding) throws LibraryException {
+        if (binding == null) {
+            return;
+        }
+
         if (definitions.containsKey(binding.getId())) {
             throw new LibraryException("Library already contains a binding with this ID!");
         }
@@ -151,7 +152,7 @@
 
         definitions.put(binding.getId(), binding);
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug(this + ": Put binding with id: " + binding.getId());
+            getLogger().debug(this + ": Added binding '" + binding.getId() + "'");
         }
     }
 
@@ -159,31 +160,19 @@
     /**
 	 * Encapsulates a uri to designate an import plus a timestamp so previously reloaded
 	 */
-	public class Dependency {
-		private String dependencySourceURI;
-		private Object shared;
-
-		public Dependency(String dependencySourceURI) throws Exception {
-			this.dependencySourceURI = dependencySourceURI;
-
-			Library lib = manager.load(this.dependencySourceURI,sourceURI);
+	protected class Dependency {
+		private final String dependencyURI;
+		private final Object shared;
+
+		public Dependency(String dependencySourceURI) throws LibraryException {
+			this.dependencyURI = dependencySourceURI;
+			Library lib = manager.load(this.dependencyURI,sourceURI);
 			this.shared = lib.shared;
 		}
 
 		public boolean isValid() throws LibraryException {
-            try {
-                if (manager.get(dependencySourceURI, sourceURI)) {
-                    Library lib = manager.load(dependencySourceURI, sourceURI);
-
-                    if (this.shared == lib.shared) {
-                        return true;
-                    }
-                }
-
-                return false;
-            } catch (Exception forward) {
-                throw new LibraryException("Exception occured while checking dependency validity!", forward);
-            }
+            Library lib = manager.get(dependencyURI, sourceURI);
+            return lib != null && this.shared == lib.shared;
         }
 	}
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryException.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryException.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryException.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryException.java Tue Mar 13 08:37:22 2007
@@ -16,19 +16,29 @@
  */
 package org.apache.cocoon.forms.binding.library;
 
-import org.apache.avalon.framework.CascadingException;
+import org.apache.cocoon.forms.binding.BindingException;
+import org.apache.cocoon.util.location.Location;
 
 /**
  * This exception is thrown when something specific to the library system goes wrong.
  *
  * @version $Id$
  */
-public class LibraryException extends CascadingException {
+public class LibraryException extends BindingException {
+
     public LibraryException(String message) {
         super(message);
     }
 
-    public LibraryException(String message, Exception e) {
-        super(message, e);
+    public LibraryException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public LibraryException(String message, Location location) {
+        super(message, location);
+    }
+
+    public LibraryException(String message, Throwable cause, Location location) {
+        super(message, cause, location);
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManager.java?view=diff&rev=517733&r1=517732&r2=517733
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManager.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManager.java Tue Mar 13 08:37:22 2007
@@ -25,7 +25,7 @@
  */
 public interface LibraryManager {
 
-	String ROLE = LibraryManager.class.getName();
+    String ROLE = LibraryManager.class.getName();
 
     /**
      * Create new instance of the {@link Library}.
@@ -39,7 +39,7 @@
      * @param sourceURI URI of the library source.
      * @return Library loaded from the source URI.
      */
-	Library load(String sourceURI) throws Exception;
+    Library load(String sourceURI) throws LibraryException;
 
     /**
      * Loads (and caches) a library from specified source URI, resolved relative
@@ -49,7 +49,7 @@
      * @param baseURI Base URI of the library source.
      * @return Library loaded from the source URI.
      */
-	Library load(String sourceURI, String baseURI) throws Exception;
+    Library load(String sourceURI, String baseURI) throws LibraryException;
 
     /**
      * Get the cached instance of the library loaded from the specified source
@@ -58,7 +58,7 @@
      * @param sourceURI URI of the library source.
      * @return Cached instance of the library, or null if it was not loaded.
      */
-	boolean get(String sourceURI) throws Exception;
+    Library get(String sourceURI) throws LibraryException;
 
     /**
      * Get the cached instance of the library loaded from the specified source
@@ -68,5 +68,5 @@
      * @param baseURI Base URI of the library source.
      * @return Cached instance of the library, or null if it was not loaded.
      */
-	boolean get(String sourceURI, String baseURI) throws Exception;
+    Library get(String sourceURI, String baseURI) throws LibraryException;
 }



Mime
View raw message