org.hibernate.search.impl
Class SimpleInitializer

java.lang.Object
  extended by org.hibernate.search.impl.SimpleInitializer
All Implemented Interfaces:
InstanceInitializer

public final class SimpleInitializer
extends Object
implements InstanceInitializer

Simple pass-through implementation of InstanceInitializer.

Author:
Sanne Grinovero (C) 2011 Red Hat Inc.

Field Summary
static SimpleInitializer INSTANCE
           
 
Method Summary
<T> Class<T>
getClass(T entity)
           
<T> Class<T>
getClassFromWork(Work<T> work)
           
 Object[] initializeArray(Object[] value)
           
<T> Collection<T>
initializeCollection(Collection<T> value)
           
<K,V> Map<K,V>
initializeMap(Map<K,V> value)
           
 Object unproxy(Object entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final SimpleInitializer INSTANCE
Method Detail

unproxy

public Object unproxy(Object entity)
Specified by:
unproxy in interface InstanceInitializer
Parameters:
entity - the object to unproxy
Returns:
if value is a proxy, unwraps it, otherwise works as a pass-through function.

getClassFromWork

public <T> Class<T> getClassFromWork(Work<T> work)
Specified by:
getClassFromWork in interface InstanceInitializer

getClass

public <T> Class<T> getClass(T entity)
Specified by:
getClass in interface InstanceInitializer
Parameters:
entity - an instance or proxy of T
Returns:
the class from the instance, or the underlying class from a proxy.

initializeCollection

public <T> Collection<T> initializeCollection(Collection<T> value)
Specified by:
initializeCollection in interface InstanceInitializer
Parameters:
value - the collection to initialize
Returns:
the initialized Collection, to be used on lazily-loading collections

initializeMap

public <K,V> Map<K,V> initializeMap(Map<K,V> value)
Specified by:
initializeMap in interface InstanceInitializer
Parameters:
value - the map to initialize
Returns:
the initialized Map, to be used on lazily-loading maps

initializeArray

public Object[] initializeArray(Object[] value)
Specified by:
initializeArray in interface InstanceInitializer
Parameters:
value - the array to initialize
Returns:
the initialized array, to be used on lazily-loading arrays


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved