public final class RegExPool extends AbstractNotifyingCacheWithMaxSize<RegExPattern,Pattern>
Pattern objects.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CACHE_SIZE
The default number of items to keep in the cache
|
DEFAULT_JMX_ENABLED, m_aCacheAccessStats, m_aRWLock, STATISTICS_PREFIX| Modifier and Type | Method and Description |
|---|---|
static EChange |
clearPatternCache()
Clear all cached patterns.
|
static Pattern |
getPattern(String sRegEx)
Get the cached regular expression pattern.
|
static Pattern |
getPattern(String sRegEx,
int nOptions)
Get the cached regular expression pattern.
|
protected Pattern |
getValueToCache(RegExPattern aRegEx)
This abstract method is invoked, once a new value needs to be put into the
cache.
|
createCache, getMaxSize, toStringgetFromCacheclearCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getFromCacheNotLocked, getName, isEmpty, isJMXEnabled, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, setJMXEnabled, sizepublic static final int MAX_CACHE_SIZE
@Nullable @IsLocked(value=WRITE) protected Pattern getValueToCache(@Nullable@RegEx RegExPattern aRegEx)
AbstractNotifyingCachegetValueToCache in class AbstractNotifyingCache<RegExPattern,Pattern>aRegEx - The key for which the value to cache is required. May be
nullable or not - depends upon the implementation.null.@Nonnull public static Pattern getPattern(@Nonnull@Nonempty@RegEx String sRegEx)
sRegEx - The regular expression to retrieve. May neither be null
nor empty.null
.IllegalArgumentException - If the passed regular expression has an illegal syntax@Nonnull public static Pattern getPattern(@Nonnull@Nonempty@RegEx String sRegEx, @Nonnegative int nOptions)
sRegEx - The regular expression to retrieve. May neither be null
nor empty.nOptions - The options used for Pattern.compilenull
.IllegalArgumentException - If the passed regular expression has an illegal syntaxPattern.compile(String, int)Copyright © 2006–2014 phloc systems. All rights reserved.