Author: simonetripodi
Date: Sun May 15 18:20:46 2011
New Revision: 1103496
URL: http://svn.apache.org/viewvc?rev=1103496&view=rev
Log:
restored the SetRootBuilder class
SetRootBuilder plugged in the Digester EDSL
Added:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.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=1103496&r1=1103495&r2=1103496&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 18:20:46 2011
@@ -185,6 +185,22 @@ public final class LinkedRuleBuilder
}
/**
+ * Calls a method on the root object on the stack, passing the top object
(child) as an argument.
+ *
+ * @param methodName Method name of the parent method to call
+ */
+ public SetRootBuilder setRoot( String methodName )
+ {
+ if ( methodName == null || methodName.length() == 0 )
+ {
+ mainBinder.addError( "{ forPattern( \"%s\" ).setRoot( String ) }
empty 'methodName' not allowed",
+ keyPattern );
+ }
+
+ return addProvider( new SetRootBuilder( 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/SetRootBuilder.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.java?rev=1103496&view=auto
==============================================================================
---
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.java
(added)
+++
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.java
Sun May 15 18:20:46 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.SetRootRule;
+
+/**
+ * Builder chained when invoking {@link LinkedRuleBuilder#setRoot(String)}.
+ *
+ * @since 3.0
+ */
+public final class SetRootBuilder
+ extends AbstractParamTypeBuilder<SetRootRule>
+{
+
+ SetRootBuilder( String keyPattern, String namespaceURI, RulesBinder
mainBinder,
+ LinkedRuleBuilder mainBuilder, String methodName,
ClassLoader classLoader )
+ {
+ super( keyPattern, namespaceURI, mainBinder, mainBuilder, methodName,
classLoader );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected SetRootRule createRule()
+ {
+ SetRootRule rule = new SetRootRule( getMethodName(),
getParamType().getName() );
+ rule.setExactMatch( isUseExactMatch() );
+ return rule;
+ }
+
+}
Propchange:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/SetRootBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain