public class SearchReplace extends Object implements ContentUtil.Visitor
ContentUtil.Visitor
which allows simple search/replace functionality.
For sample usage, see SearchReplaceTest
.Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
protected void |
onPropertyVisit(NodeData prop,
int count,
String oldValue,
StringBuffer newValue) |
void |
visit(Content node) |
public SearchReplace(String propertyNamePattern, String search, String replace)
search
.Pattern.LITERAL
public void visit(Content node) throws Exception
visit
in interface ContentUtil.Visitor
Exception
protected void onPropertyVisit(NodeData prop, int count, String oldValue, StringBuffer newValue)
Copyright © 2003–2016 Magnolia International Ltd.. All rights reserved.