com.adobe.epubcheck.util.TextSearchDictionaryEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of epubcheck Show documentation
Show all versions of epubcheck Show documentation
EPUBCheck is a tool to validate the conformance of EPUB publications against
the EPUB specifications. EPUBCheck can be run as a standalone command-line tool or used
as a Java library.
package com.adobe.epubcheck.util;
import com.adobe.epubcheck.messages.MessageId;
import java.util.regex.Pattern;
public class TextSearchDictionaryEntry
{
private String searchedValue;
private String regexExp;
private MessageId errorCode;
private Pattern pattern;
public TextSearchDictionaryEntry(String searchedValue, String regex, MessageId errorCode)
{
this.searchedValue = searchedValue;
this.regexExp = regex;
this.errorCode = errorCode;
this.pattern = null;
}
public String getSearchedValue()
{
return searchedValue;
}
public String getRegexExp()
{
return regexExp;
}
public MessageId getErrorCode()
{
return errorCode;
}
public Pattern getPattern()
{
if (pattern == null)
{
pattern = Pattern.compile(this.getRegexExp());
}
return pattern;
}
}