org.apache.commons.scaffold.text
Class Merge

java.lang.Object
  extended byorg.apache.commons.scaffold.text.Merge

public class Merge
extends java.lang.Object

Merge utilities.

Version:
$Revision: 1.2 $ $Date: 2004/03/21 21:10:18 $

Field Summary
static java.lang.String TOKEN_PREFIX
          The token markers for replacement variables, i.e.
static java.lang.String TOKEN_SUFFIX
           
 
Constructor Summary
Merge()
           
 
Method Summary
static int keys(java.lang.StringBuffer content, java.util.Map tokens)
          Merge a Map of tokens with a template in a StringBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOKEN_PREFIX

public static java.lang.String TOKEN_PREFIX
The token markers for replacement variables, i.e. ${a1}


TOKEN_SUFFIX

public static java.lang.String TOKEN_SUFFIX
Constructor Detail

Merge

public Merge()
Method Detail

keys

public static int keys(java.lang.StringBuffer content,
                       java.util.Map tokens)
Merge a Map of tokens with a template in a StringBuffer. The parameters are marked by ${key} where (String) Map.get(key)!=null. The merged content is returned in the same StringBuffer. Tokens cannot be nested. Unmatched tokens are ignored.

Parameters:
content - The text containing merge tokens to be replaced.
Returns:
int Number of replacements made


Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.