info.magnolia.cms.util
Class SearchReplace

java.lang.Object
  extended by info.magnolia.cms.util.SearchReplace
All Implemented Interfaces:
ContentUtil.Visitor

public class SearchReplace
extends java.lang.Object
implements ContentUtil.Visitor

A ContentUtil.Visitor which allows simple search/replace functionality. For sample usage, see SearchReplaceTest.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Constructor Summary
SearchReplace(java.lang.String propertyNamePattern, java.lang.String search, java.lang.String replace)
          A search and replace which searches for literal occurrences of search.
SearchReplace(java.lang.String propertyNamePattern, java.lang.String search, java.lang.String replace, int regexFlags)
          A search and replace which can use parameterized substitution; use 0 for the default java.util.Pattern behavior.
 
Method Summary
protected  void onPropertyVisit(NodeData prop, int count, java.lang.String oldValue, java.lang.StringBuffer newValue)
           
 void visit(Content node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchReplace

public SearchReplace(java.lang.String propertyNamePattern,
                     java.lang.String search,
                     java.lang.String replace)
A search and replace which searches for literal occurrences of search.

See Also:
Pattern.LITERAL

SearchReplace

public SearchReplace(java.lang.String propertyNamePattern,
                     java.lang.String search,
                     java.lang.String replace,
                     int regexFlags)
A search and replace which can use parameterized substitution; use 0 for the default java.util.Pattern behavior.

Method Detail

visit

public void visit(Content node)
           throws java.lang.Exception
Specified by:
visit in interface ContentUtil.Visitor
Throws:
java.lang.Exception

onPropertyVisit

protected void onPropertyVisit(NodeData prop,
                               int count,
                               java.lang.String oldValue,
                               java.lang.StringBuffer newValue)


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.