Spring Data Commons

org.springframework.data.convert
Class EntityInstantiators

java.lang.Object
  extended by org.springframework.data.convert.EntityInstantiators

public class EntityInstantiators
extends Object

Simple value object allowing access to EntityInstantiator instances for a given type falling back to a default one.

Author:
Oliver Gierke

Constructor Summary
EntityInstantiators()
          Creates a new EntityInstantiators using the default fallback instantiator and no custom ones.
EntityInstantiators(EntityInstantiator fallback)
          Creates a new EntityInstantiators using the given EntityInstantiator as fallback.
EntityInstantiators(EntityInstantiator defaultInstantiator, Map<Class<?>,EntityInstantiator> customInstantiators)
          Creates a new EntityInstantiator using the given fallback EntityInstantiator and the given custom ones.
EntityInstantiators(Map<Class<?>,EntityInstantiator> customInstantiators)
          Creates a new EntityInstantiators using the default fallback instantiator and the given custom ones.
 
Method Summary
 EntityInstantiator getInstantiatorFor(PersistentEntity<?,?> entity)
          Returns the EntityInstantiator to be used to create the given PersistentEntity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityInstantiators

public EntityInstantiators()
Creates a new EntityInstantiators using the default fallback instantiator and no custom ones.


EntityInstantiators

public EntityInstantiators(EntityInstantiator fallback)
Creates a new EntityInstantiators using the given EntityInstantiator as fallback.

Parameters:
fallback - must not be null.

EntityInstantiators

public EntityInstantiators(Map<Class<?>,EntityInstantiator> customInstantiators)
Creates a new EntityInstantiators using the default fallback instantiator and the given custom ones.

Parameters:
customInstantiators - must not be null.

EntityInstantiators

public EntityInstantiators(EntityInstantiator defaultInstantiator,
                           Map<Class<?>,EntityInstantiator> customInstantiators)
Creates a new EntityInstantiator using the given fallback EntityInstantiator and the given custom ones.

Parameters:
fallback - must not be null.
customInstantiators - must not be null.
Method Detail

getInstantiatorFor

public EntityInstantiator getInstantiatorFor(PersistentEntity<?,?> entity)
Returns the EntityInstantiator to be used to create the given PersistentEntity.

Parameters:
entity - must not be null.
Returns:
will never be null.

Spring Data Commons

Copyright © 2012. All Rights Reserved.