pro.verron.officestamper.core.StandardPlaceholder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of engine Show documentation
Show all versions of engine Show documentation
Office-stamper is a Java template engine for docx documents, forked from org.wickedsource.docx-stamper
The newest version!
package pro.verron.officestamper.core;
import pro.verron.officestamper.api.Placeholder;
/**
* Represents an expression with a configured Matcher.
*/
public record StandardPlaceholder(
Matcher matcher,
String expression
)
implements Placeholder {
/**
* Returns the inner part of the expression
* by stripping the prefix and suffix.
*
* @return the inner part of the expression.
*/
@Override
public String content() {
return matcher.match(expression)
? matcher.strip(expression)
: expression;
}
}