net.sf.mmm.util.pojo.path.base
Class AbstractPojoPathNavigator.PojoPathState

java.lang.Object
  extended by net.sf.mmm.util.pojo.path.base.AbstractPojoPathNavigator.PojoPathState
Enclosing class:
AbstractPojoPathNavigator

protected static class AbstractPojoPathNavigator.PojoPathState
extends Object

This inner class represents the state for a PojoPath evaluation.


Field Summary
private  Map<String,AbstractPojoPathNavigator.CachingPojoPath> cache
          The actual cache that maps a PojoPath to the resulting Pojo.
private  boolean cachingDisabled
           
private  PojoPathMode mode
           
private  String pojoPath
           
private  AbstractPojoPathNavigator.CachingPojoPath rootPath
          The root path.
 
Constructor Summary
protected AbstractPojoPathNavigator.PojoPathState(AbstractPojoPathNavigator.CachingPojoPath rootPath, PojoPathMode mode, String pojoPath)
          The constructor for no caching.
protected AbstractPojoPathNavigator.PojoPathState(AbstractPojoPathNavigator.CachingPojoPath rootPath, PojoPathMode mode, String pojoPath, Map<String,AbstractPojoPathNavigator.CachingPojoPath> cache)
          The constructor.
 
Method Summary
 AbstractPojoPathNavigator.CachingPojoPath getCachedPath(String currentPojoPath)
          This method gets the AbstractPojoPathNavigator.CachingPojoPath from the cache.
 PojoPathMode getMode()
          This method gets the PojoPathMode that determines how to deal with null-values.
 String getPojoPath()
           
 AbstractPojoPathNavigator.CachingPojoPath getRootPath()
           
 boolean isCachingDisabled()
          This method determines if this cache has been disabled.
 boolean isGetType()
          This method determines if we have been invoked from getType.
 void removeCachedPath(String currentPojoPath)
          This method removes a AbstractPojoPathNavigator.CachingPojoPath from the cache.
 void setCachedPath(String currentPojoPath, AbstractPojoPathNavigator.CachingPojoPath evaluatedPojoPath)
          This method stored a AbstractPojoPathNavigator.CachingPojoPath in the cache.
 void setCachingDisabled()
          This method disables further caching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

private final Map<String,AbstractPojoPathNavigator.CachingPojoPath> cache
The actual cache that maps a PojoPath to the resulting Pojo.


rootPath

private AbstractPojoPathNavigator.CachingPojoPath rootPath
The root path.


mode

private final PojoPathMode mode
See Also:
getMode()

pojoPath

private final String pojoPath
See Also:
getPojoPath()

cachingDisabled

private boolean cachingDisabled
See Also:
setCachingDisabled()
Constructor Detail

AbstractPojoPathNavigator.PojoPathState

protected AbstractPojoPathNavigator.PojoPathState(AbstractPojoPathNavigator.CachingPojoPath rootPath,
                                                  PojoPathMode mode,
                                                  String pojoPath)
The constructor for no caching.

Parameters:
rootPath - is the PojoPath with the initial Pojo.
mode - is the mode that determines how to deal null values.
pojoPath - is the pojo-path.

AbstractPojoPathNavigator.PojoPathState

protected AbstractPojoPathNavigator.PojoPathState(AbstractPojoPathNavigator.CachingPojoPath rootPath,
                                                  PojoPathMode mode,
                                                  String pojoPath,
                                                  Map<String,AbstractPojoPathNavigator.CachingPojoPath> cache)
The constructor.

Parameters:
rootPath - is the PojoPath with the initial Pojo.
mode - is the mode that determines how to deal null values.
pojoPath - is the pojo-path.
cache - is the underlying Map used for caching.
Method Detail

getCachedPath

public AbstractPojoPathNavigator.CachingPojoPath getCachedPath(String currentPojoPath)
This method gets the AbstractPojoPathNavigator.CachingPojoPath from the cache.

Parameters:
currentPojoPath - is the PojoPath to lookup.
Returns:
the cached AbstractPojoPathNavigator.CachingPojoPath or null if NOT (yet) cached.

setCachedPath

public void setCachedPath(String currentPojoPath,
                          AbstractPojoPathNavigator.CachingPojoPath evaluatedPojoPath)
This method stored a AbstractPojoPathNavigator.CachingPojoPath in the cache. This method will do nothing if this state is disabled.

Parameters:
currentPojoPath - is the PojoPath leading to the given pojo.
evaluatedPojoPath - is the AbstractPojoPathNavigator.CachingPojoPath that has been evaluated and should be cached.

removeCachedPath

public void removeCachedPath(String currentPojoPath)
This method removes a AbstractPojoPathNavigator.CachingPojoPath from the cache. This method will do nothing if this state is disabled.

Parameters:
currentPojoPath - is the PojoPath to purge from the cache.

getRootPath

public AbstractPojoPathNavigator.CachingPojoPath getRootPath()
Returns:
the rootPath

getMode

public PojoPathMode getMode()
This method gets the PojoPathMode that determines how to deal with null-values.

Returns:
the mode.

getPojoPath

public String getPojoPath()
Returns:
the initial pojoPath

isGetType

public boolean isGetType()
This method determines if we have been invoked from getType.

Returns:
true if invoked via getType, false if invoked from get or set.

isCachingDisabled

public boolean isCachingDisabled()
This method determines if this cache has been disabled.

Returns:
true if this cache is disabled, false otherwise.

setCachingDisabled

public void setCachingDisabled()
This method disables further caching.



Copyright © 2001-2010 mmm-Team. All Rights Reserved.