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).
-
Method Summary
Modifier and TypeMethodDescriptiongetLookupMarkup
(String result) Gets the lookup markup for the given String ornull
if not found.static BundleLookupThreadContext
Gets the current context for the current thread ornull
if none set.static BundleLookupThreadContext
getThreadContext
(boolean createIfMissing) Deprecated.static void
Deprecated.This should not be used directly and will become inaccessible in a future major version release, since this content is now added and removed based on the current thread settings.void
reset()
Deprecated.Lookups are no longer reset.
-
Method Details
-
getThreadContext
Deprecated.Please usegetThreadContext()
directly, since this content is now added and removed based on the current thread settings.Gets the current context for the current thread ornull
if none set and none created.- See Also:
-
getThreadContext
Gets the current context for the current thread ornull
if none set. This content is added and removed based on the current thread settings.- See Also:
-
removeThreadContext
Deprecated.This should not be used directly and will become inaccessible in a future major version release, since this content is now added and removed based on the current thread settings.Removes any current context.- See Also:
-
reset
Deprecated.Lookups are no longer reset. Instead, they are now added and removed based on the current thread settings.Removes all lookups stored in this context.- See Also:
-
getLookupMarkup
Gets the lookup markup for the given String ornull
if not found.The string is looked-up by identity only:
String.equals(java.lang.Object)
is not called. This is to give a more precise match to lookups. Much care is taken care to support this string identity lookup, including things like resource bundles, I/O buffers, and tag attribute manipulation.
-
getThreadContext()
directly, since this content is now added and removed based on the current thread settings.