You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/15 18:11:03 UTC

svn commit: r1103440 - in /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder: LinkedRuleBuilder.java SetNextBuilder.java

Author: simonetripodi
Date: Sun May 15 16:11:02 2011
New Revision: 1103440

URL: http://svn.apache.org/viewvc?rev=1103440&view=rev
Log:
restored the SetNextBuilder class
SetNextBuilder plugged in the Digester EDSL

Added:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java   (with props)
Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java?rev=1103440&r1=1103439&r2=1103440&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java Sun May 15 16:11:02 2011
@@ -136,6 +136,21 @@ public final class LinkedRuleBuilder
     }
 
     /**
+     * Sets properties on the object at the top of the stack,
+     * based on child elements with names matching properties on that  object.
+     */
+    public SetNextBuilder setNext( String methodName )
+    {
+        if ( methodName == null || methodName.length() == 0 )
+        {
+            mainBinder.addError( "{ forPattern( \"%s\" ).setNext( String ) } empty 'methodName' not allowed",
+                                 keyPattern );
+        }
+        return this.addProvider( new SetNextBuilder( keyPattern, namespaceURI, mainBinder, this, methodName,
+                                                     classLoader ) );
+    }
+
+    /**
      * Add a custom user rule in the specified pattern built by the given provider.
      *
      * @param <R>

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java?rev=1103440&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java (added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java Sun May 15 16:11:02 2011
@@ -0,0 +1,48 @@
+/* $Id$
+ *
+ * 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.commons.digester3.binder;
+
+import org.apache.commons.digester3.SetNextRule;
+
+/**
+ * Builder chained when invoking {@link LinkedRuleBuilder#setNext(String)}.
+ *
+ * @since 3.0
+ */
+public final class SetNextBuilder
+    extends AbstractParamTypeBuilder<SetNextRule>
+{
+
+    SetNextBuilder( String keyPattern, String namespaceURI, RulesBinder mainBinder,
+                           LinkedRuleBuilder mainBuilder, String methodName, ClassLoader classLoader )
+    {
+        super( keyPattern, namespaceURI, mainBinder, mainBuilder, methodName, classLoader );
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected SetNextRule createRule()
+    {
+        SetNextRule rule = new SetNextRule( getMethodName(), getParamType().getName() );
+        rule.setExactMatch( isUseExactMatch() );
+        return rule;
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetNextBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain