info.magnolia.cms.util
Class SearchReplace
java.lang.Object
info.magnolia.cms.util.SearchReplace
- All Implemented Interfaces:
- ContentUtil.Visitor
public class SearchReplace
- extends 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(String propertyNamePattern,
String search,
String replace)
A search and replace which searches for literal occurrences of search . |
SearchReplace(String propertyNamePattern,
String search,
String replace,
int regexFlags)
A search and replace which can use parameterized substitution; use 0 for the default java.util.Pattern behavior. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SearchReplace
public SearchReplace(String propertyNamePattern,
String search,
String replace)
- A search and replace which searches for literal occurrences of
search
.
- See Also:
Pattern.LITERAL
SearchReplace
public SearchReplace(String propertyNamePattern,
String search,
String replace,
int regexFlags)
- A search and replace which can use parameterized substitution; use 0 for the default java.util.Pattern behavior.
visit
public void visit(Content node)
throws Exception
- Specified by:
visit
in interface ContentUtil.Visitor
- Throws:
Exception
onPropertyVisit
protected void onPropertyVisit(NodeData prop,
int count,
String oldValue,
StringBuffer newValue)
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.