com.smartling.maven.plugins.smartlingapi.mojo.Regex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smartling-api-maven-plugin Show documentation
Show all versions of smartling-api-maven-plugin Show documentation
Maven plugin for accessing Smartling API.
The newest version!
package com.smartling.maven.plugins.smartlingapi.mojo;
import org.apache.commons.lang3.StringUtils;
public class Regex extends NameTransformer
{
private String pattern;
private String replacement = StringUtils.EMPTY;
public String getPattern()
{
return pattern;
}
public void setPattern(final String pattern)
{
this.pattern = pattern;
}
public String getReplacement()
{
return replacement;
}
public void setReplacement(final String replacement)
{
this.replacement = (null != replacement) ? replacement : StringUtils.EMPTY;
}
@Override
public String transform(final String name, final String locale)
{
return name.replaceAll(injectLocale(pattern, locale), injectLocale(replacement, locale));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy