Class ThreadLocalTemplateCompilerStore
- java.lang.Object
-
- org.rodnansol.core.generator.template.compiler.ThreadLocalTemplateCompilerStore
-
- All Implemented Interfaces:
TemplateCompilerMemoryStore
public class ThreadLocalTemplateCompilerStore extends Object implements TemplateCompilerMemoryStore
ThreadLocal basedTemplateCompilerMemoryStore.Good candidate to store values between the different template compiling.
- Since:
- 0.6.0
- Author:
- nandorholozsnyak
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocalTemplateCompilerStoreINSTANCEstatic org.slf4j.LoggerLOGGER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItemToMemory(String key, Object value)Adds item to the memory store.<T> TgetItem(String key)Returns an item from the store.voidresetMemory()Resets the memory.
-
-
-
Field Detail
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
INSTANCE
public static final ThreadLocalTemplateCompilerStore INSTANCE
-
-
Method Detail
-
addItemToMemory
public void addItemToMemory(String key, Object value)
Description copied from interface:TemplateCompilerMemoryStoreAdds item to the memory store.- Specified by:
addItemToMemoryin interfaceTemplateCompilerMemoryStore- Parameters:
key- key of the value.value- object to be stored.
-
getItem
public <T> T getItem(String key)
Description copied from interface:TemplateCompilerMemoryStoreReturns an item from the store.- Specified by:
getItemin interfaceTemplateCompilerMemoryStore- Type Parameters:
T- type of the object to be returned.- Parameters:
key- key value.- Returns:
- stored object, or null if it does not exist in the store.
-
resetMemory
public void resetMemory()
Description copied from interface:TemplateCompilerMemoryStoreResets the memory.- Specified by:
resetMemoryin interfaceTemplateCompilerMemoryStore
-
-