All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pro.verron.officestamper.core.StandardPlaceholder Maven / Gradle / Ivy

Go to download

Office-stamper is a Java template engine for docx documents, forked from org.wickedsource.docx-stamper

There is a newer version: 2.6.0
Show 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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy