com.florianingerl.util.regex.CaptureReplacer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of regex Show documentation
Show all versions of regex Show documentation
This is a Regular Expressions library for Java. Compared to java.util.regex, it supports Recursive and Conditional Regular Expressions, Capture Trees and Plugins.
package com.florianingerl.util.regex;
/**
* Used to replace all captures of capturing
* groups recursively with a computed replacement string.
*
* @author Florian Ingerl
* @see Matcher#replaceAll(CaptureReplacer)
*/
public interface CaptureReplacer {
/**
* Returns the whole input sequence
*
* @return The whole input sequence
*/
public CharSequence getInput();
/**
* Sets the whole input sequence
*
* @param input
* The whole input sequence
*/
public void setInput(CharSequence input);
/**
* Computes the replacement string for the given {@link CaptureTreeNode}
*
* @param node
* The node to be replaced
* @return The replacement string for the given {@link CaptureTreeNode}
*/
public String replace(CaptureTreeNode node);
}