Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public final class BundleLookupThreadContext extends Object
Each thread has a markup context associated with it. When set, bundle lookups will be recorded with any markup-context appropriate prefixes and suffixes added. This allows the use of a normal API while providing a mechanism for in-context translation interfaces to better integrate with the underlying resource bundles.
Under concurrent programming, one context can end up being accessed concurrently by multiple threads, thus BundleLookupThreadContext is a thread-safe implementation.
Bundle lookups are not guaranteed to be recorded, such as when in-context translation is disabled (production mode).
| Modifier and Type | Method and Description |
|---|---|
BundleLookupMarkup |
getLookupMarkup(String result)
Gets the lookup markup for the given String or
null if not found. |
static BundleLookupThreadContext |
getThreadContext(boolean createIfMissing)
Gets the current context or
null if none set and none created. |
static void |
removeThreadContext()
Removes any current context.
|
void |
reset()
Removes all lookups stored in this context.
|
public static BundleLookupThreadContext getThreadContext(boolean createIfMissing)
null if none set and none created.public static void removeThreadContext()
public void reset()
public BundleLookupMarkup getLookupMarkup(String result)
null if not found.
The string is looked-up by identity only: .equals() is not called. This is to give a more precise match to lookups.
Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.