|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.schwarzrot.data.access.support.EntityEnumResolver
public class EntityEnumResolver
an enum-resolver class, that uses catalog/EntityManager to interface persistence and: - is designed as singleton, to be useful, where application services are not accessible - caches the enums - uses StaticLabeledEnumResolver as fallback for enums, that are not enitities - has a refresh()-call to reload the internal cache
Constructor Summary | |
---|---|
EntityEnumResolver()
|
Method Summary | |
---|---|
protected void |
checkEnumCache4Type(Class clazz)
internal call to load enums of given type, if they are not already found in cache. |
StaticLabeledEnumResolver |
getFallback()
|
LabeledEnum |
getLabeledEnumByCode(Class clazz,
Comparable code)
|
LabeledEnum |
getLabeledEnumByLabel(Class clazz,
String label)
|
Map |
getLabeledEnumMap(Class clazz)
|
Set |
getLabeledEnumSet(Class clazz)
|
static EntityEnumResolver |
instance()
|
static void |
refresh()
as this class is intended to handle enums, that a user may extend, a call to refresh the cache(s) is evident. |
void |
setFallback(StaticLabeledEnumResolver fallback)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EntityEnumResolver()
Method Detail |
---|
public final StaticLabeledEnumResolver getFallback()
public LabeledEnum getLabeledEnumByCode(Class clazz, Comparable code) throws IllegalArgumentException
getLabeledEnumByCode
in interface LabeledEnumResolver
IllegalArgumentException
public LabeledEnum getLabeledEnumByLabel(Class clazz, String label) throws IllegalArgumentException
getLabeledEnumByLabel
in interface LabeledEnumResolver
IllegalArgumentException
public Map getLabeledEnumMap(Class clazz) throws IllegalArgumentException
getLabeledEnumMap
in interface LabeledEnumResolver
IllegalArgumentException
public Set getLabeledEnumSet(Class clazz) throws IllegalArgumentException
getLabeledEnumSet
in interface LabeledEnumResolver
IllegalArgumentException
public final void setFallback(StaticLabeledEnumResolver fallback)
protected void checkEnumCache4Type(Class clazz)
clazz
- - class of enums that should be loadedpublic static final EntityEnumResolver instance()
public static void refresh()
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |