Skip navigation links
oracle.javatools.resourcebundle
Class ResourceBundleWrapperRT.DefaultSearchContext
java.lang.Object
oracle.javatools.resourcebundle.SearchContext
oracle.javatools.resourcebundle.ResourceBundleWrapperRT.DefaultSearchContext
- Direct Known Subclasses:
- ResourceBundleAdapter.AdapterDefaultSearchContext
- Enclosing class:
- ResourceBundleWrapperRT
-
protected static class ResourceBundleWrapperRT.DefaultSearchContext
- extends SearchContext
Method Summary |
java.util.Set<java.lang.String> |
findKeys()
|
protected java.util.Map<java.lang.String,java.lang.String> |
getEntryMap()
Allow overrides to supply an alternate source of entries to search. |
java.lang.Throwable |
getSearchCancelledBy()
|
protected boolean |
isMatch(java.lang.String key, java.lang.String text)
Overriding context classes can use this hook point to keep track of the _lastMatcherUsed and the true return to keep a collection of hints to do a replace later. |
protected boolean |
isMatchContainsKey(java.lang.String key, java.lang.String text)
|
protected boolean |
isMatchContainsMatch(java.lang.String key, java.lang.String text)
|
protected boolean |
isMatchContainsMetadata(java.lang.String key, java.lang.String text)
|
protected boolean |
isMatchExactMatch(java.lang.String key, java.lang.String text)
|
protected boolean |
isMatchMetadataMatch(java.lang.String key, java.lang.String text)
|
protected void |
setSearchCancelledBy(java.lang.Throwable t, java.lang.String key, java.util.Iterator<java.lang.String> keyIter)
Allow an override class to trap on an error only, and possibly handle recovery or restart in it's own way. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXACT_MATCH
public static final java.lang.String EXACT_MATCH
-
- See Also:
- Constant Field Values
CONTAINS_MATCH
public static final java.lang.String CONTAINS_MATCH
-
- See Also:
- Constant Field Values
METADATA_MATCH
public static final java.lang.String METADATA_MATCH
-
- See Also:
- Constant Field Values
CONTAINS_KEY
public static final java.lang.String CONTAINS_KEY
-
- See Also:
- Constant Field Values
CONTAINS_METADATA
public static final java.lang.String CONTAINS_METADATA
-
- See Also:
- Constant Field Values
LEGACY_SEARCH_TYPES
protected static final java.lang.String[] LEGACY_SEARCH_TYPES
_ignoreCase
protected final boolean _ignoreCase
_pattern
protected java.util.regex.Pattern _pattern
_lastMatcherUsed
protected java.util.regex.Matcher _lastMatcherUsed
_matcherMeth
protected java.lang.reflect.Method _matcherMeth
_searchCancelledBy
protected java.lang.Throwable _searchCancelledBy
ResourceBundleWrapperRT.DefaultSearchContext
public ResourceBundleWrapperRT.DefaultSearchContext(java.lang.Object searchTerm,
ResourceBundleWrapperRT wrapper,
java.lang.String searchTypeMeth,
boolean ignoreCase)
getEntryMap
protected java.util.Map<java.lang.String,java.lang.String> getEntryMap()
- Allow overrides to supply an alternate source of entries to search. This implementation uses the wrapper's chained key value map.
-
- Specified by:
getEntryMap
in class SearchContext
-
- Returns:
findKeys
public java.util.Set<java.lang.String> findKeys()
-
- Specified by:
findKeys
in class SearchContext
-
- Returns:
- The set of keys that match the search term in the wrapper scope
setSearchCancelledBy
protected void setSearchCancelledBy(java.lang.Throwable t,
java.lang.String key,
java.util.Iterator<java.lang.String> keyIter)
- Allow an override class to trap on an error only, and possibly handle recovery or restart in it's own way. This class just stores the exception in the context for later examination or conditional logic.
-
- Parameters:
t
- This caused the search to cancel
key
- The key being processed at the time
keyIter
- the overall iterator of keys
getSearchCancelledBy
public java.lang.Throwable getSearchCancelledBy()
-
- Returns:
- The exception that caused the search to cancel, or null.
isMatch
protected boolean isMatch(java.lang.String key,
java.lang.String text)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
- Overriding context classes can use this hook point to keep track of the _lastMatcherUsed and the true return to keep a collection of hints to do a replace later. Or they could override to trap and handle the exceptions differently. Otherwise, they will be logged by findKeys and the search operation terminated.
-
- Specified by:
isMatch
in class SearchContext
-
- Parameters:
key
- the current item key
text
- the current item value
- Returns:
- true if the item is considered a match
- Throws:
java.lang.IllegalAccessException
- if the matcher method is not appropriate
java.lang.reflect.InvocationTargetException
- if the matcher method had a runtime fault
isMatchContainsKey
protected boolean isMatchContainsKey(java.lang.String key,
java.lang.String text)
isMatchExactMatch
protected boolean isMatchExactMatch(java.lang.String key,
java.lang.String text)
isMatchContainsMatch
protected boolean isMatchContainsMatch(java.lang.String key,
java.lang.String text)
isMatchMetadataMatch
protected boolean isMatchMetadataMatch(java.lang.String key,
java.lang.String text)
isMatchContainsMetadata
protected boolean isMatchContainsMetadata(java.lang.String key,
java.lang.String text)
Skip navigation links
Copyright © 1997, 2015, Oracle. All rights reserved.