commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1069734 [2/2] - in /commons/sandbox/digester3/trunk: ./ src/main/java/org/apache/commons/digester3/ src/main/java/org/apache/commons/digester3/internal/ src/main/java/org/apache/commons/digester3/internal/rulesbinder/ src/main/java/org/apa...
Date Fri, 11 Feb 2011 10:21:48 GMT
Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/RulesBinderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/RulesBinderImpl.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/RulesBinderImpl.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/RulesBinderImpl.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,174 @@
+/* $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.internal.rulesbinder;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Formatter;
+import java.util.List;
+
+import org.apache.commons.digester3.DigesterLoadingException;
+import org.apache.commons.digester3.Rule;
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.RulesModule;
+import org.apache.commons.digester3.rulesbinder.ConverterBuilder;
+import org.apache.commons.digester3.rulesbinder.LinkedRuleBuilder;
+import org.apache.commons.digester3.spi.Rules;
+import org.apache.commons.digester3.spi.TypeConverter;
+
+/**
+ * The Digester EDSL implementation.
+ */
+public final class RulesBinderImpl implements RulesBinder {
+
+    /**
+     * The default head when reporting an errors list.
+     */
+    private static final String HEADING = "Digester creation errors:%n%n";
+
+    /**
+     * Errors that can occur during binding time or rules creation.
+     */
+    private final List<ErrorMessage> errors = new ArrayList<ErrorMessage>();
+
+    /**
+     * The data structure where storing the providers binding.
+     */
+    private final Collection<RegisteredProvider> providers = new ArrayList<RegisteredProvider>();
+
+    private final ClassLoader classLoader;
+
+    public RulesBinderImpl(final ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addError(String messagePattern, Object... arguments) {
+        this.addError(new ErrorMessage(messagePattern, arguments));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addError(Throwable t) {
+        String message = "An exception was caught and reported. Message: " + t.getMessage();
+        this.addError(new ErrorMessage(message, t));
+    }
+
+    /**
+     * 
+     *
+     * @param errorMessage
+     */
+    private void addError(ErrorMessage errorMessage) {
+        this.errors.add(errorMessage);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void install(RulesModule rulesModule) {
+        rulesModule.configure(this);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public LinkedRuleBuilder forPattern(String pattern) {
+        final String keyPattern;
+
+        if (pattern == null || pattern.length() == 0) {
+            this.addError(new IllegalArgumentException("Null or empty pattern is not valid"));
+            keyPattern = null;
+        } else {
+            if (pattern.endsWith("/")) {
+                // to help users who accidently add '/' to the end of their patterns
+                keyPattern = pattern.substring(0, pattern.length() - 1);
+            } else {
+                keyPattern = pattern;
+            }
+        }
+
+        return new LinkedRuleBuilderImpl(this, this.providers, this.classLoader, keyPattern);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public <T> ConverterBuilder<T> convert(final Class<T> type) {
+        if (type == null) {
+            this.addError(new IllegalArgumentException("NULL type is not allowed to be converted"));
+        }
+        return new ConverterBuilder<T>() {
+
+            public void withConverter(TypeConverter<T> typeConverter) {
+                if (typeConverter == null) {
+                    addError(new IllegalArgumentException(
+                            String.format("NULL TypeConverter is not allowed for converting
'%s' type",
+                                    type.getName())));
+                }
+
+                // TODO register the type converter!!!
+            }
+
+        };
+    }
+
+    /**
+     * Invokes the bound providers, then create the rule and associate it to the related
pattern,
+     * storing them in the proper {@link Rules} implementation data structure.
+     *
+     * @param rules The {@link Rules} implementation to store the produced {@link Rule}s
+     */
+    public void populateRules(Rules rules) {
+        if (!this.errors.isEmpty()) {
+            Formatter fmt = new Formatter().format(HEADING);
+            int index = 1;
+
+            for (ErrorMessage errorMessage : this.errors) {
+                fmt.format("%s) %s%n", index++, errorMessage.getMessage());
+
+                Throwable cause = errorMessage.getCause();
+                if (cause != null) {
+                    StringWriter writer = new StringWriter();
+                    cause.printStackTrace(new PrintWriter(writer));
+                    fmt.format("Caused by: %s", writer.getBuffer());
+                }
+
+                fmt.format("%n");
+            }
+
+            if (this.errors.size() == 1) {
+                fmt.format("1 error");
+            } else {
+                fmt.format("%s errors", this.errors.size());
+            }
+
+            throw new DigesterLoadingException(fmt.toString());
+        }
+
+        for (RegisteredProvider registeredProvider : this.providers) {
+            rules.add(registeredProvider.getPattern(), registeredProvider.getProvider().get());
+        }
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/RulesBinderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetNextBuilderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetNextBuilderImpl.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetNextBuilderImpl.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetNextBuilderImpl.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,42 @@
+/* $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.internal.rulesbinder;
+
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.SetNextRule;
+import org.apache.commons.digester3.rulesbinder.SetNextBuilder;
+
+final class SetNextBuilderImpl extends AbstractParamTypeBuilder<SetNextRule> implements
SetNextBuilder {
+
+    public SetNextBuilderImpl(String keyPattern,
+            String namespaceURI,
+            RulesBinder mainBinder,
+            LinkedRuleBuilderImpl mainBuilder,
+            String methodName) {
+        super(keyPattern, namespaceURI, mainBinder, mainBuilder, methodName);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected SetNextRule createRule() {
+        return new SetNextRule(this.getMethodName(), this.getParamType(), this.isUseExactMatch());
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetNextBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertiesBuilderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertiesBuilderImpl.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertiesBuilderImpl.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertiesBuilderImpl.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,103 @@
+/* $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.internal.rulesbinder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.SetPropertiesRule;
+import org.apache.commons.digester3.rulesbinder.SetPropertiesBuilder;
+
+/**
+ * Builder chained when invoking {@link LinkedRuleBuilderImpl#setNestedProperties()}.
+ */
+final class SetPropertiesBuilderImpl
+        extends AbstractBackToLinkedRuleBuilder<SetPropertiesRule>
+        implements SetPropertiesBuilder {
+
+    private final Map<String, String> aliases = new HashMap<String, String>();
+
+    private boolean ignoreMissingProperty = true;
+
+    public SetPropertiesBuilderImpl(String keyPattern,
+            String namespaceURI,
+            RulesBinder mainBinder,
+            LinkedRuleBuilderImpl mainBuilder) {
+        super(keyPattern, namespaceURI, mainBinder, mainBuilder);
+    }
+
+    /**
+     * Add an attribute name to the ignore list.
+     *
+     * @param attributeName The attribute to match has to be ignored
+     * @return this builder instance
+     */
+    public SetPropertiesBuilderImpl ignoreAttribute(String attributeName) {
+        if (attributeName == null) {
+            this.reportError("setProperties().ignoreAttribute(String)}", "empty 'attributeName'
not allowed");
+        } else {
+            this.aliases.put(attributeName, null);
+        }
+        return this;
+    }
+
+    /**
+     * Add an additional attribute name to property name mapping.
+     *
+     * @param attributeName The attribute to match
+     * @param propertyName The java bean property to be assigned the value
+     * @return this builder instance
+     */
+    public SetPropertiesBuilderImpl addAlias(String attributeName, String propertyName) {
+        if (attributeName == null) {
+            this.reportError("setProperties().addAlias(String,String)}", "empty 'attributeName'
not allowed");
+        } else {
+            if (propertyName == null) {
+                this.reportError("setProperties().addAlias(String,String)}", "empty 'propertyName'
not allowed");
+            } else {
+                this.aliases.put(attributeName, propertyName);
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Sets whether attributes found in the XML without matching properties should be ignored.
+     * 
+     * If set to false, the parsing will throw an {@code NoSuchMethodException}
+     * if an unmatched attribute is found.
+     * This allows to trap misspellings in the XML file.
+     *
+     * @param ignoreMissingProperty false to stop the parsing on unmatched attributes
+     * @return this builder instance
+     */
+    public SetPropertiesBuilderImpl ignoreMissingProperty(boolean ignoreMissingProperty)
{
+        this.ignoreMissingProperty = ignoreMissingProperty;
+        return this;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected SetPropertiesRule createRule() {
+        return new SetPropertiesRule(this.aliases, this.ignoreMissingProperty);
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertiesBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertyBuilderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertyBuilderImpl.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertyBuilderImpl.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertyBuilderImpl.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,64 @@
+/* $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.internal.rulesbinder;
+
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.SetPropertyRule;
+import org.apache.commons.digester3.rulesbinder.SetPropertyBuilder;
+
+/**
+ * Builder chained when invoking {@link LinkedRuleBuilderImpl#setProperty(String)}.
+ */
+final class SetPropertyBuilderImpl extends AbstractBackToLinkedRuleBuilder<SetPropertyRule>
implements SetPropertyBuilder {
+
+    private final String attributePropertyName;
+
+    private String valueAttributeName;
+
+    public SetPropertyBuilderImpl(String keyPattern,
+            String namespaceURI,
+            RulesBinder mainBinder,
+            LinkedRuleBuilderImpl mainBuilder,
+            String attributePropertyName) {
+        super(keyPattern, namespaceURI, mainBinder, mainBuilder);
+        this.attributePropertyName = attributePropertyName;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public SetPropertyBuilder extractingValueFromAttribute(String valueAttributeName) {
+        if (attributePropertyName == null || attributePropertyName.length() == 0) {
+            this.reportError(
+                    String.format("setProperty(\"%s\").extractingValueFromAttribute(String)}",
this.attributePropertyName),
+                    "empty 'valueAttributeName' not allowed");
+        }
+
+        this.valueAttributeName = valueAttributeName;
+        return this;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected SetPropertyRule createRule() {
+        return new SetPropertyRule(this.attributePropertyName, this.valueAttributeName);
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetPropertyBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetRootBuilderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetRootBuilderImpl.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetRootBuilderImpl.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetRootBuilderImpl.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,42 @@
+/* $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.internal.rulesbinder;
+
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.SetRootRule;
+import org.apache.commons.digester3.rulesbinder.SetRootBuilder;
+
+final class SetRootBuilderImpl extends AbstractParamTypeBuilder<SetRootRule> implements
SetRootBuilder {
+
+    public SetRootBuilderImpl(String keyPattern,
+            String namespaceURI,
+            RulesBinder mainBinder,
+            LinkedRuleBuilderImpl mainBuilder,
+            String methodName) {
+        super(keyPattern, namespaceURI, mainBinder, mainBuilder, methodName);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected SetRootRule createRule() {
+        return new SetRootRule(this.getMethodName(), this.getParamType(), this.isUseExactMatch());
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetRootBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetTopBuilderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetTopBuilderImpl.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetTopBuilderImpl.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetTopBuilderImpl.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,42 @@
+/* $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.internal.rulesbinder;
+
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.SetTopRule;
+import org.apache.commons.digester3.rulesbinder.SetTopBuilder;
+
+final class SetTopBuilderImpl extends AbstractParamTypeBuilder<SetTopRule> implements
SetTopBuilder {
+
+    public SetTopBuilderImpl(String keyPattern,
+            String namespaceURI,
+            RulesBinder mainBinder,
+            LinkedRuleBuilderImpl mainBuilder,
+            String methodName) {
+        super(keyPattern, namespaceURI, mainBinder, mainBuilder, methodName);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected SetTopRule createRule() {
+        return new SetTopRule(this.getMethodName(), this.getParamType(), this.isUseExactMatch());
+    }
+
+}

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/SetTopBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java?rev=1069734&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java
(added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java
Fri Feb 11 10:21:47 2011
@@ -0,0 +1,22 @@
+/* $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.
+ */
+
+/**
+ * The Digester EDSL.
+ */
+package org.apache.commons.digester3.internal.rulesbinder;

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/internal/rulesbinder/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/ObjectParamBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/ObjectParamBuilder.java?rev=1069734&r1=1069733&r2=1069734&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/ObjectParamBuilder.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/rulesbinder/ObjectParamBuilder.java
Fri Feb 11 10:21:47 2011
@@ -22,7 +22,7 @@ import org.apache.commons.digester3.Obje
 /**
  * Builder chained when invoking {@link LinkedRuleBuilder#objectCreate(String)}.
  */
-public interface ObjectParamBuilder extends BackToLinkedRuleBuilder<ObjectParamRule>
{
+public interface ObjectParamBuilder<T> extends BackToLinkedRuleBuilder<ObjectParamRule>
{
 
     /**
      * The zero-relative index of the parameter we are saving.
@@ -30,7 +30,7 @@ public interface ObjectParamBuilder exte
      * @param paramIndex The zero-relative index of the parameter we are saving
      * @return this builder instance
      */
-    ObjectParamBuilder ofIndex(int paramIndex);
+    ObjectParamBuilder<T> ofIndex(int paramIndex);
 
     /**
      * The attribute which we are attempting to match.
@@ -38,6 +38,6 @@ public interface ObjectParamBuilder exte
      * @param attributeName The attribute which we are attempting to match
      * @return this builder instance
      */
-    ObjectParamBuilder matchingAttribute(String attributeName);
+    ObjectParamBuilder<T> matchingAttribute(String attributeName);
 
 }



Mime
View raw message