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/02/16 10:44:43 UTC
svn commit: r1071192 - in /commons/sandbox/digester3/trunk/src/main:
java/org/apache/commons/digester3/xmlrules/metaparser/
resources/org/apache/commons/digester3/xmlrules/
Author: simonetripodi
Date: Wed Feb 16 09:44:43 2011
New Revision: 1071192
URL: http://svn.apache.org/viewvc?rev=1071192&view=rev
Log:
like setProperties(), added a way to explicitly set elements have to be ignored when setNestedProperties()
Added:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java (with props)
Modified:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/XmlRulesModule.java
commons/sandbox/digester3/trunk/src/main/resources/org/apache/commons/digester3/xmlrules/digester-rules.dtd
Added: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java?rev=1071192&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java (added)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java Wed Feb 16 09:44:43 2011
@@ -0,0 +1,43 @@
+/* $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.xmlrules.metaparser;
+
+import org.apache.commons.digester3.RulesBinder;
+import org.apache.commons.digester3.rulesbinder.LinkedRuleBuilder;
+import org.xml.sax.Attributes;
+
+/**
+ *
+ */
+final class SetNestedPropertiesIgnoreRule extends AbstractXmlRule {
+
+ public SetNestedPropertiesIgnoreRule(RulesBinder targetRulesBinder, PatternStack patternStack) {
+ super(targetRulesBinder, patternStack);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void bindRule(LinkedRuleBuilder linkedRuleBuilder, Attributes attributes) throws Exception {
+ String elementName = attributes.getValue("elem-name");
+
+ linkedRuleBuilder.setNestedProperties().ignoreElement(elementName);
+ }
+
+}
Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/SetNestedPropertiesIgnoreRule.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/XmlRulesModule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/XmlRulesModule.java?rev=1071192&r1=1071191&r2=1071192&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/XmlRulesModule.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/xmlrules/metaparser/XmlRulesModule.java Wed Feb 16 09:44:43 2011
@@ -81,6 +81,8 @@ public final class XmlRulesModule implem
.addRule(new SetNestedPropertiesRule(this.targetRulesBinder, patternStack));
forPattern("*/set-nested-properties-rule/alias")
.addRule(new SetNestedPropertiesAliasRule(this.targetRulesBinder, patternStack));
+ forPattern("*/set-nested-properties-rule/ignore")
+ .addRule(new SetPropertiesIgnoreRule(this.targetRulesBinder, patternStack));
forPattern("*/set-top-rule")
.addRule(new SetTopRule(this.targetRulesBinder, patternStack));
Modified: commons/sandbox/digester3/trunk/src/main/resources/org/apache/commons/digester3/xmlrules/digester-rules.dtd
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/resources/org/apache/commons/digester3/xmlrules/digester-rules.dtd?rev=1071192&r1=1071191&r2=1071192&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/resources/org/apache/commons/digester3/xmlrules/digester-rules.dtd (original)
+++ commons/sandbox/digester3/trunk/src/main/resources/org/apache/commons/digester3/xmlrules/digester-rules.dtd Wed Feb 16 09:44:43 2011
@@ -181,7 +181,7 @@
ignore-missing-property CDATA #IMPLIED>
<!-- SetNestedPropertiesRule -->
-<!ELEMENT set-nested-properties-rule (alias)*>
+<!ELEMENT set-nested-properties-rule (alias|ignore)*>
<!ATTLIST set-nested-properties-rule
pattern CDATA #IMPLIED
allow-unknown-child-elements CDATA #IMPLIED>
@@ -194,7 +194,8 @@
<!ELEMENT ignore EMPTY>
<!ATTLIST ignore
- attr-name CDATA #IMPLIED>
+ attr-name CDATA #IMPLIED
+ elem-name CDATA #IMPLIED>
<!-- SetPropertyRule -->
<!ELEMENT set-property-rule EMPTY>