net.sf.mmm.util.pojo.path.impl
Class PojoPathNavigatorImpl

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.pojo.path.base.AbstractPojoPathNavigator
              extended by net.sf.mmm.util.pojo.path.impl.PojoPathNavigatorImpl
All Implemented Interfaces:
PojoPathNavigator

@Singleton
@Named
public class PojoPathNavigatorImpl
extends AbstractPojoPathNavigator

This is the implementation of the PojoPathNavigator interface.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.mmm.util.pojo.path.base.AbstractPojoPathNavigator
AbstractPojoPathNavigator.CachingPojoPath, AbstractPojoPathNavigator.PojoPathCache, AbstractPojoPathNavigator.PojoPathState
 
Field Summary
private  PojoDescriptorBuilder descriptorBuilder
           
private  PojoDescriptorBuilderFactory descriptorBuilderFactory
           
 
Constructor Summary
PojoPathNavigatorImpl()
          The constructor.
 
Method Summary
protected  void doInitialize()
          This method performs the actual initialization.
protected  PojoDescriptorBuilder getDescriptorBuilder()
          This method gets the PojoDescriptorBuilder used for the underlying reflectional property access.
protected  Object getFromPojo(AbstractPojoPathNavigator.CachingPojoPath currentPath, PojoPathContext context, AbstractPojoPathNavigator.PojoPathState state)
          This method reflectively gets the single segment of the given currentPath from the Pojo given by parentPojo.
 void setDescriptorBuilder(PojoDescriptorBuilder descriptorBuilder)
          This method sets the descriptor-builder to use.
 void setDescriptorBuilderFactory(PojoDescriptorBuilderFactory descriptorBuilderFactory)
           
protected  Object setInPojo(AbstractPojoPathNavigator.CachingPojoPath currentPath, PojoPathContext context, AbstractPojoPathNavigator.PojoPathState state, Object parentPojo, Object value)
          This method sets the single segment of the given currentPath from the Pojo given by parentPojo.
 
Methods inherited from class net.sf.mmm.util.pojo.path.base.AbstractPojoPathNavigator
convert, convertList, create, createState, createStateByType, get, get, get, getCollectionReflectionUtil, getFromFunction, getFromList, getFromMap, getFunction, getFunctionManager, getPojoFactory, getRecursive, getReflectionUtil, getType, getType, getValueConverter, pojo2Map, pojo2Map, set, set, setCollectionReflectionUtil, setFunctionManager, setInList, setPojoFactory, setReflectionUtil, setValueConverter
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent
doInitialized, getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

descriptorBuilder

private PojoDescriptorBuilder descriptorBuilder
See Also:
getDescriptorBuilder()

descriptorBuilderFactory

private PojoDescriptorBuilderFactory descriptorBuilderFactory
See Also:
setDescriptorBuilderFactory(PojoDescriptorBuilderFactory)
Constructor Detail

PojoPathNavigatorImpl

public PojoPathNavigatorImpl()
The constructor.
ATTENTION:
You need to AbstractComponent.initialize() this component before it can be used.

Method Detail

getDescriptorBuilder

protected PojoDescriptorBuilder getDescriptorBuilder()
This method gets the PojoDescriptorBuilder used for the underlying reflectional property access.

Returns:
the descriptorBuilder

setDescriptorBuilder

public void setDescriptorBuilder(PojoDescriptorBuilder descriptorBuilder)
This method sets the descriptor-builder to use.

Parameters:
descriptorBuilder - is the descriptorBuilder to use.

setDescriptorBuilderFactory

@Inject
public void setDescriptorBuilderFactory(PojoDescriptorBuilderFactory descriptorBuilderFactory)
Parameters:
descriptorBuilderFactory - is the descriptorBuilderFactory to set

doInitialize

protected void doInitialize()
This method performs the actual initialization. It is called when AbstractComponent.initialize() is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a super.AbstractComponent.doInitialize().

Overrides:
doInitialize in class AbstractPojoPathNavigator

getFromPojo

protected Object getFromPojo(AbstractPojoPathNavigator.CachingPojoPath currentPath,
                             PojoPathContext context,
                             AbstractPojoPathNavigator.PojoPathState state)
This method reflectively gets the single segment of the given currentPath from the Pojo given by parentPojo. If the result is null and mode is PojoPathMode.CREATE_IF_NULL it creates and attaches (sets) the missing object.

Specified by:
getFromPojo in class AbstractPojoPathNavigator
Parameters:
currentPath - is the current AbstractPojoPathNavigator.CachingPojoPath to evaluate.
context - is the context for this operation.
state - is the state of this operation.
Returns:
the result of the evaluation. It might be null according to the mode.

setInPojo

protected Object setInPojo(AbstractPojoPathNavigator.CachingPojoPath currentPath,
                           PojoPathContext context,
                           AbstractPojoPathNavigator.PojoPathState state,
                           Object parentPojo,
                           Object value)
This method sets the single segment of the given currentPath from the Pojo given by parentPojo. If the result is null and mode is PojoPathMode.CREATE_IF_NULL it creates and attaches (sets) the missing object.

Specified by:
setInPojo in class AbstractPojoPathNavigator
Parameters:
currentPath - is the current AbstractPojoPathNavigator.CachingPojoPath to set.
context - is the context for this operation.
state - is the state to use.
parentPojo - is the parent Pojo to work on.
value - is the value to set in parentPojo.
Returns:
the replaced value. It may be null.


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