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/05/27 00:09:09 UTC
svn commit: r1128102 -
/commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
Author: simonetripodi
Date: Thu May 26 22:09:09 2011
New Revision: 1128102
URL: http://svn.apache.org/viewvc?rev=1128102&view=rev
Log:
just reformatted sample code, added missing generics
Modified:
commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
Modified: commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml?rev=1128102&r1=1128101&r2=1128102&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml (original)
+++ commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml Thu May 26 22:09:09 2011
@@ -43,19 +43,19 @@ using a syntax such as "${user.name}".
<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<String, Object> vars = new HashMap<String, Object>();
+ 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);
+ expander.addSource( "$", vars );
// allow expansion in both xml attributes and element text
- Substitutor substitutor = new VariableSubstitutor(expander);
+ Substitutor substitutor = new VariableSubstitutor( expander );
Digester digester = new Digester();
- digester.setSubstitutor(substitutor);
+ digester.setSubstitutor( substitutor );
</source>
</section>
</body>