Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 13282 invoked from network); 31 Aug 2010 08:00:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Aug 2010 08:00:20 -0000 Received: (qmail 72333 invoked by uid 500); 31 Aug 2010 08:00:20 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 72088 invoked by uid 500); 31 Aug 2010 08:00:17 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 72081 invoked by uid 99); 31 Aug 2010 08:00:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Aug 2010 08:00:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Aug 2010 08:00:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 261642388A40; Tue, 31 Aug 2010 07:58:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r991112 - in /commons/proper/digester/trunk/src/site: site.xml xdoc/substitution.xml Date: Tue, 31 Aug 2010 07:58:59 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100831075859.261642388A40@eris.apache.org> 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 @@ + 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 @@ + + + + + Download Commons Digester + Commons Documentation Team + + +
+

Provides for manipulation of xml attributes and element body text before +the data is processed by any Rule objects.

+ +

+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. +

+

+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}". +

+

Here's an example of setting up the VariableSubstitutor:

+ + // 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); + +
+ +
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