org.apache.wicket.util
Class LazyInitializer<T>

java.lang.Object
  extended by org.apache.wicket.util.LazyInitializer<T>
Type Parameters:
T - type of value
All Implemented Interfaces:
java.io.Serializable, IClusterable, IProvider<T>

public abstract class LazyInitializer<T>
extends java.lang.Object
implements IProvider<T>, IClusterable

An abstraction for lazy-initializing values. Guarantees only a single instance of the value is created. Initialized value WILL NOT be serialized, and will be recreated upon de-serialization.

Author:
igor
See Also:
Serialized Form

Constructor Summary
LazyInitializer()
           
 
Method Summary
protected abstract  T createInstance()
          Creates the lazy value
 T get()
          Provides an instance of type T
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyInitializer

public LazyInitializer()
Method Detail

get

public T get()
Description copied from interface: IProvider
Provides an instance of type T

Specified by:
get in interface IProvider<T>
Returns:
instance of type T

createInstance

protected abstract T createInstance()
Creates the lazy value

Returns:
new instance of the value


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.