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 2010/08/31 09:58:59 UTC
svn commit: r991112 - in /commons/proper/digester/trunk/src/site: site.xml
xdoc/substitution.xml
Author: simonetripodi
Date: Tue Aug 31 07:58:58 2010
New Revision: 991112
URL: http://svn.apache.org/viewvc?rev=991112&view=rev
Log:
added the 'substitution' package documentation
Added:
commons/proper/digester/trunk/src/site/xdoc/substitution.xml (with props)
Modified:
commons/proper/digester/trunk/src/site/site.xml
Modified: commons/proper/digester/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/site/site.xml?rev=991112&r1=991111&r2=991112&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/site/site.xml (original)
+++ commons/proper/digester/trunk/src/site/site.xml Tue Aug 31 07:58:58 2010
@@ -35,6 +35,7 @@
<menu name="Developers Guide">
<item name="Core APIs" href="/core.html"/>
<item name="Plugins" href="/plugins.html"/>
+ <item name="Substitution" href="/substitution.html"/>
<item name="FAQ" href="/faq.html"/>
</menu>
Added: commons/proper/digester/trunk/src/site/xdoc/substitution.xml
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/site/xdoc/substitution.xml?rev=991112&view=auto
==============================================================================
--- commons/proper/digester/trunk/src/site/xdoc/substitution.xml (added)
+++ commons/proper/digester/trunk/src/site/xdoc/substitution.xml Tue Aug 31 07:58:58 2010
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+ <properties>
+ <title>Download Commons Digester</title>
+ <author email="dev@commons.apache.org">Commons Documentation Team</author>
+ </properties>
+ <body>
+ <section name="Package Documentation for org.apache.commons.digester.substitution Package">
+ <p>Provides for manipulation of xml attributes and element body text before
+the data is processed by any Rule objects.</p>
+
+<p>
+The class org.apache.commons.digester.Substitutor defines an abstract
+interface for mechanisms which manipulate xml attributes and body text.
+The Digester method setSubstitutor can be used to define a concrete
+substitutor that will be applied to the data before it is passed to the
+matching rules.
+</p>
+<p>
+This package provides some useful concrete implementations of the abstract
+Substitutor class. In particular, it provides an implementation that allows
+the application to define "variables" which the input data can reference
+using a syntax such as "${user.name}".
+</p>
+<p>Here's an example of setting up the VariableSubstitutor:</p>
+<source>
+ // set up the variables the input xml can reference
+ Map vars = new HashMap();
+ vars.put("user.name", "me");
+ vars.put("os", "Linux");
+
+ // map ${varname} to the entries in the var map
+ MultiVariableExpander expander = new MultiVariableExpander();
+ expander.addSource("$", vars);
+
+ // allow expansion in both xml attributes and element text
+ Substitutor substitutor = new VariableSubstitutor(expander);
+
+ Digester digester = new Digester();
+ digester.setSubstitutor(substitutor);
+</source>
+ </section>
+ </body>
+</document>
Propchange: commons/proper/digester/trunk/src/site/xdoc/substitution.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/digester/trunk/src/site/xdoc/substitution.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/proper/digester/trunk/src/site/xdoc/substitution.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml