public abstract class AbstractNlsBundleFactory extends AbstractComponent implements NlsBundleFactory
NlsBundleFactory
.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractNlsBundleFactory.NlsBundleInvocationHandler
This inner class is an
InvocationHandler for the dynamic NlsBundle instance. |
protected static class |
AbstractNlsBundleFactory.NlsBundleMethodInfo
This inner class holds all the information to be cached for a
NlsBundle -method. |
Modifier and Type | Field and Description |
---|---|
private Map<Class<? extends NlsBundle>,NlsBundle> |
bundleMap |
private ClassLoader |
classLoader |
static String |
METHOD_NAME_LOOKUP
The name of the method
NlsBundleWithLookup.getMessage(String, Map) . |
CDI_NAME
Constructor and Description |
---|
AbstractNlsBundleFactory()
The constructor.
|
AbstractNlsBundleFactory(ClassLoader classLoader)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
<BUNDLE extends NlsBundle> |
createBundle(Class<BUNDLE> bundleInterface)
This method dynamically creates an instance for the given
bundleInterface . |
protected InvocationHandler |
createHandler(Class<? extends NlsBundle> bundleInterface)
This method creates a new
InvocationHandler for the given bundleInterface . |
protected NlsBundleOptions |
getBundleOptions(Class<? extends NlsBundle> bundleInterface)
This method gets the
NlsBundleOptions for the given bundleInterface . |
protected NlsMessageFactory |
getMessageFactory() |
doInitialize, doInitialized, getInitializationState, initialize
public static final String METHOD_NAME_LOOKUP
NlsBundleWithLookup.getMessage(String, Map)
.private final ClassLoader classLoader
createBundle(Class)
private final Map<Class<? extends NlsBundle>,NlsBundle> bundleMap
createBundle(Class)
public AbstractNlsBundleFactory()
public AbstractNlsBundleFactory(ClassLoader classLoader)
classLoader
- is the ClassLoader
to use.public <BUNDLE extends NlsBundle> BUNDLE createBundle(Class<BUNDLE> bundleInterface)
bundleInterface
.createBundle
in interface NlsBundleFactory
BUNDLE
- is the generic type of the requested NlsBundle
.bundleInterface
- the interface of the requested NlsBundle
. Has to be a sub-interface of
NlsBundle
with according methods.NlsBundle
interface.protected NlsBundleOptions getBundleOptions(Class<? extends NlsBundle> bundleInterface)
NlsBundleOptions
for the given bundleInterface
. If NOT present
a default instance is returned.bundleInterface
- is the Class
reflecting the NlsBundle
interface.NlsBundleOptions
or the default if bundleInterface
is NOT
annotated accordingly.protected InvocationHandler createHandler(Class<? extends NlsBundle> bundleInterface)
InvocationHandler
for the given bundleInterface
.bundleInterface
- is the Class
reflecting the NlsBundle
interface.InvocationHandler
for the given bundleInterface
.protected NlsMessageFactory getMessageFactory()
NlsMessageFactory
.Copyright © 2001–2014 mmm-Team. All rights reserved.