Spring Data Commons

org.springframework.data.persistence
Class AbstractConstructorEntityInstantiator<BACKING_INTERFACE,STATE>

java.lang.Object
  extended by org.springframework.data.persistence.AbstractConstructorEntityInstantiator<BACKING_INTERFACE,STATE>
All Implemented Interfaces:
EntityInstantiator<BACKING_INTERFACE,STATE>

public abstract class AbstractConstructorEntityInstantiator<BACKING_INTERFACE,STATE>
extends Object
implements EntityInstantiator<BACKING_INTERFACE,STATE>

Try for a constructor taking state: failing that, try a no-arg constructor and then setUnderlyingNode().

Author:
Rod Johnson

Constructor Summary
AbstractConstructorEntityInstantiator()
           
 
Method Summary
<T extends BACKING_INTERFACE>
T
createEntityFromState(STATE n, Class<T> c)
           
protected
<T extends BACKING_INTERFACE>
StateBackedCreator<T,STATE>
createFailingInstantiator(Class<STATE> stateType)
           
protected
<T extends BACKING_INTERFACE>
StateBackedCreator<T,STATE>
createInstantiator(Class<T> type, Class<STATE> stateType)
           
protected
<T extends BACKING_INTERFACE>
StateBackedCreator<T,STATE>
createWithoutConstructorInvocation(Class<T> type, Class<STATE> stateType)
           
protected
<T> Constructor<T>
getDeclaredConstructor(Class<T> c)
           
protected  String getFailingMessageForClass(Class<?> entityClass, Class<STATE> stateClass)
           
protected
<T extends BACKING_INTERFACE>
Constructor<T>
getNoArgConstructor(Class<T> type)
           
 void setInstantiators(Map<Class<? extends BACKING_INTERFACE>,StateBackedCreator<? extends BACKING_INTERFACE,STATE>> instantiators)
           
protected abstract  void setState(BACKING_INTERFACE entity, STATE s)
          Subclasses must implement to set state
protected
<T extends BACKING_INTERFACE>
StateBackedCreator<T,STATE>
stateTakingConstructorInstantiator(Class<T> type, Class<STATE> stateType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConstructorEntityInstantiator

public AbstractConstructorEntityInstantiator()
Method Detail

createEntityFromState

public <T extends BACKING_INTERFACE> T createEntityFromState(STATE n,
                                                             Class<T> c)
Specified by:
createEntityFromState in interface EntityInstantiator<BACKING_INTERFACE,STATE>

setInstantiators

public void setInstantiators(Map<Class<? extends BACKING_INTERFACE>,StateBackedCreator<? extends BACKING_INTERFACE,STATE>> instantiators)

createInstantiator

protected <T extends BACKING_INTERFACE> StateBackedCreator<T,STATE> createInstantiator(Class<T> type,
                                                                                       Class<STATE> stateType)

createFailingInstantiator

protected <T extends BACKING_INTERFACE> StateBackedCreator<T,STATE> createFailingInstantiator(Class<STATE> stateType)

getFailingMessageForClass

protected String getFailingMessageForClass(Class<?> entityClass,
                                           Class<STATE> stateClass)

createWithoutConstructorInvocation

protected <T extends BACKING_INTERFACE> StateBackedCreator<T,STATE> createWithoutConstructorInvocation(Class<T> type,
                                                                                                       Class<STATE> stateType)

getNoArgConstructor

protected <T extends BACKING_INTERFACE> Constructor<T> getNoArgConstructor(Class<T> type)

stateTakingConstructorInstantiator

protected <T extends BACKING_INTERFACE> StateBackedCreator<T,STATE> stateTakingConstructorInstantiator(Class<T> type,
                                                                                                       Class<STATE> stateType)

getDeclaredConstructor

protected <T> Constructor<T> getDeclaredConstructor(Class<T> c)

setState

protected abstract void setState(BACKING_INTERFACE entity,
                                 STATE s)
Subclasses must implement to set state

Parameters:
entity -
s -

Spring Data Commons

Copyright © 2011. All Rights Reserved.