public class PojoPathContextBean extends Object implements PojoPathContext
PojoPathContext
interface as simple Java bean.DefaultPojoPathContext
Modifier and Type | Field and Description |
---|---|
private ComposedValueConverter |
additionalConverter |
private PojoPathFunctionManager |
additionalFunctionManager |
private Map<Object,Object> |
cache |
private PojoFactory |
pojoFactory |
private Properties |
properties |
private PojoPathRecognizer |
recognizer |
Constructor and Description |
---|
PojoPathContextBean()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
ComposedValueConverter |
getAdditionalConverter()
This method gets an optional
ComposedValueConverter that is used in favor to ComposedValueConverter
registered to the PojoPathNavigator itself. |
PojoPathFunctionManager |
getAdditionalFunctionManager()
This method gets an optional
PojoPathFunctionManager . |
Map<Object,Object> |
getCache()
This method provides a cache that is used by the
PojoPathNavigator to speed up repetitive calls with the
same initial Pojo and PojoPath s with a common prefix. |
PojoFactory |
getPojoFactory()
This method gets an optional
PojoFactory instance used if favor to the PojoFactory registered to
the PojoPathNavigator itself. |
Properties |
getProperties()
This method gets the properties of the context.
|
PojoPathRecognizer |
getRecognizer()
This method gets an optional
recognizer that adds support for the visitor-pattern. |
void |
setAdditionalConverter(ComposedValueConverter additionalConverter)
This method sets the
additional converter . |
void |
setAdditionalFunctionManager(PojoPathFunctionManager additionalFunctionManager)
This method sets the
additional function-manager . |
void |
setCache(Map<Object,Object> cache)
This method sets the
cache . |
void |
setPojoFactory(PojoFactory pojoFactory)
This method sets the
pojo-factory . |
void |
setProperties(Properties properties)
This method sets the
properties . |
void |
setRecognizer(PojoPathRecognizer recognizer)
This method sets the
recognizer . |
private Properties properties
private PojoPathRecognizer recognizer
private ComposedValueConverter additionalConverter
private PojoPathFunctionManager additionalFunctionManager
private PojoFactory pojoFactory
public PojoPathContextBean()
null
.public PojoPathFunctionManager getAdditionalFunctionManager()
PojoPathContext
PojoPathFunctionManager
. PojoPathFunction
s
provided
by this manager overrules the PojoPathFunction
s that may be provided by the PojoPathNavigator
itself. While PojoPathFunction
s that may be
registered globally in the PojoPathNavigator
should be stateless and thread-safe, the
PojoPathFunction
s provided here may be stateful depending on the usage of this context.getAdditionalFunctionManager
in interface PojoPathContext
PojoPathFunctionManager
of this context or null
if no context-specific
PojoPathFunction
s should be provided.public void setAdditionalFunctionManager(PojoPathFunctionManager additionalFunctionManager)
additional function-manager
.additionalFunctionManager
- is the PojoPathFunctionManager
to set.public ComposedValueConverter getAdditionalConverter()
PojoPathContext
ComposedValueConverter
that is used in favor to ComposedValueConverter
registered to the PojoPathNavigator
itself.getAdditionalConverter
in interface PojoPathContext
ComposedValueConverter
of this context or null
if no context-specific
ComposedValueConverter
is provided.public void setAdditionalConverter(ComposedValueConverter additionalConverter)
additional converter
.additionalConverter
- is the ComposedValueConverter
to set.public Map<Object,Object> getCache()
PojoPathContext
PojoPathNavigator
to speed up repetitive calls with the
same initial Pojo
and PojoPath
s with a common prefix. Pojo
changed outside the
navigator
the result will be
wrong because the evaluation used an old value from the cache. PojoPathNavigator
only adds objects from the cache
. It will
never remove cached objects. To avoid memory-leaks, you should use a PojoPathContext
instance only per
transaction, per request, or whatever your grouping block will be. PojoPathNavigator
to be thread-safe and more efficient and NOT to expose it for external usage. The internal structure of the cache
may change in future releases. Use the recognizer
to track visited
Pojo
s. getCache
in interface PojoPathContext
Map
to use as cache or null
to disable caching.HashMap
,
WeakHashMap
public void setCache(Map<Object,Object> cache)
cache
.cache
- is the cache to set.public Properties getProperties()
PojoPathContext
PojoPathFunction
s for
evaluation. Please note that conditional evaluation can conflict with caching
. Ensure that such
PojoPathFunction
s are declared to be NOT deterministic
.getProperties
in interface PojoPathContext
public void setProperties(Properties properties)
properties
.properties
- are the Properties
to set.public PojoPathRecognizer getRecognizer()
PojoPathContext
recognizer
that adds support for the visitor-pattern.
Therefore all POJOs traversed by the PojoPathNavigator
are
recognized
by the returned object.getRecognizer
in interface PojoPathContext
PojoPathRecognizer
or null
to turn this feature off.public void setRecognizer(PojoPathRecognizer recognizer)
recognizer
.recognizer
- is the PojoPathRecognizer
to set.public PojoFactory getPojoFactory()
PojoPathContext
PojoFactory
instance used if favor to the PojoFactory
registered to
the PojoPathNavigator
itself. The PojoFactory
is used to create
new Pojo
s.getPojoFactory
in interface PojoPathContext
PojoFactory
or null
if no context-specific PojoFactory
is provided.public void setPojoFactory(PojoFactory pojoFactory)
pojo-factory
.pojoFactory
- is the PojoFactory
to set.Copyright © 2001–2016 mmm-Team. All rights reserved.