net.sf.mmm.util.pojo.descriptor.base
Class AbstractPojoDescriptorBuilder

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.descriptor.base.AbstractPojoDescriptorBuilder
All Implemented Interfaces:
PojoDescriptorBuilder
Direct Known Subclasses:
PojoDescriptorBuilderImpl

public abstract class AbstractPojoDescriptorBuilder
extends AbstractLoggableComponent
implements PojoDescriptorBuilder

This is the abstract base-implementation of the PojoDescriptorBuilder interface.

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

Field Summary
private  Map<GenericType<?>,PojoDescriptorImpl<?>> pojoMap
           
 
Constructor Summary
AbstractPojoDescriptorBuilder()
          The constructor.
AbstractPojoDescriptorBuilder(MapFactory mapFactory)
          The constructor.
 
Method Summary
protected abstract
<POJO> PojoDescriptorImpl<POJO>
createDescriptor(GenericType<POJO> pojoType)
          This method creates the pojo descriptor for the given pojoType.
protected abstract  PojoDescriptorDependencies getDependencies()
          This method gets the required dependencies.
<POJO> PojoDescriptorImpl<POJO>
getDescriptor(Class<POJO> pojoClass)
          This method gets (or creates) the descriptor for the given pojoClass.
<POJO> PojoDescriptorImpl<POJO>
getDescriptor(GenericType<POJO> pojoType)
          This method gets (or creates) the descriptor for the given pojoType.
 PojoDescriptorImpl<?> getDescriptor(Type pojoType)
          This method gets (or creates) the descriptor for the given pojoType.
 Map<String,Object> pojo2Map(Object pojo)
          This method creates a lazy, immutable Map reflecting the given Pojo.
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
doInitialize, 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

pojoMap

private final Map<GenericType<?>,PojoDescriptorImpl<?>> pojoMap
See Also:
getDescriptor(Class)
Constructor Detail

AbstractPojoDescriptorBuilder

public AbstractPojoDescriptorBuilder()
The constructor.


AbstractPojoDescriptorBuilder

public AbstractPojoDescriptorBuilder(MapFactory mapFactory)
The constructor.

Parameters:
mapFactory - the factory used to create the descriptor-cache.
Method Detail

getDependencies

protected abstract PojoDescriptorDependencies getDependencies()
This method gets the required dependencies.

Returns:
the PojoDescriptorDependencies.

getDescriptor

public <POJO> PojoDescriptorImpl<POJO> getDescriptor(Class<POJO> pojoClass)
This method gets (or creates) the descriptor for the given pojoClass.

Specified by:
getDescriptor in interface PojoDescriptorBuilder
Type Parameters:
POJO - is the templated type of the pojoType.
Parameters:
pojoClass - is the Class reflecting the Pojo to introspect.
Returns:
the descriptor used to get information about the properties of the given pojoClass.

getDescriptor

public PojoDescriptorImpl<?> getDescriptor(Type pojoType)
This method gets (or creates) the descriptor for the given pojoType.

Specified by:
getDescriptor in interface PojoDescriptorBuilder
Parameters:
pojoType - is the Type reflecting the Pojo to introspect.
Returns:
the descriptor used to get information about the properties of the given pojoType.
See Also:
PojoDescriptorBuilder.getDescriptor(GenericType)

getDescriptor

public <POJO> PojoDescriptorImpl<POJO> getDescriptor(GenericType<POJO> pojoType)
This method gets (or creates) the descriptor for the given pojoType.

Specified by:
getDescriptor in interface PojoDescriptorBuilder
Type Parameters:
POJO - is the templated type of the pojoType.
Parameters:
pojoType - is the GenericType reflecting the Pojo to introspect.
Returns:
the descriptor used to get information about the properties of the given pojoType.

createDescriptor

protected abstract <POJO> PojoDescriptorImpl<POJO> createDescriptor(GenericType<POJO> pojoType)
This method creates the pojo descriptor for the given pojoType.

Type Parameters:
POJO - is the templated type of the pojoType.
Parameters:
pojoType - is the GenericType reflecting the Pojo.
Returns:
the descriptor used to get information about the properties of the according Pojo.
See Also:
PojoDescriptorBuilder.getDescriptor(java.lang.Class)

pojo2Map

public Map<String,Object> pojo2Map(Object pojo)
This method creates a lazy, immutable Map reflecting the given Pojo.
ATTENTION:
The Map may be simple.

Specified by:
pojo2Map in interface PojoDescriptorBuilder
Parameters:
pojo - is the Pojo to convert.
Returns:
the Map reflecting the given Pojo.
See Also:
PojoPathNavigator.pojo2Map(Object)


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