|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.enums.AbstractCachingLabeledEnumResolver
public abstract class AbstractCachingLabeledEnumResolver
Abstract base class for LabeledEnumResolver implementations, caching all retrieved LabeledEnum instances.
Subclasses need to implement the template method
findLabeledEnums(type)
.
findLabeledEnums(Class)
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
AbstractCachingLabeledEnumResolver()
|
Method Summary | |
---|---|
protected abstract Set |
findLabeledEnums(Class type)
Template method to be implemented by subclasses. |
LabeledEnum |
getLabeledEnumByCode(Class type,
Comparable code)
Resolve a single LabeledEnum by its identifying code. |
LabeledEnum |
getLabeledEnumByLabel(Class type,
String label)
Resolve a single LabeledEnum by its identifying code. |
Map |
getLabeledEnumMap(Class type)
Return a map of enumerations of a particular type. |
Set |
getLabeledEnumSet(Class type)
Return a set of enumerations of a particular type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final transient org.apache.commons.logging.Log logger
Constructor Detail |
---|
public AbstractCachingLabeledEnumResolver()
Method Detail |
---|
public Set getLabeledEnumSet(Class type) throws IllegalArgumentException
LabeledEnumResolver
getLabeledEnumSet
in interface LabeledEnumResolver
type
- the enum type
IllegalArgumentException
- if the type is not supportedpublic Map getLabeledEnumMap(Class type) throws IllegalArgumentException
LabeledEnumResolver
LabeledEnum
instance.
getLabeledEnumMap
in interface LabeledEnumResolver
type
- the enum type
LabeledEnum
instance as value
IllegalArgumentException
- if the type is not supportedpublic LabeledEnum getLabeledEnumByCode(Class type, Comparable code) throws IllegalArgumentException
LabeledEnumResolver
LabeledEnum
by its identifying code.
getLabeledEnumByCode
in interface LabeledEnumResolver
type
- the enum typecode
- the enum code
IllegalArgumentException
- if the code did not map to a valid instancepublic LabeledEnum getLabeledEnumByLabel(Class type, String label) throws IllegalArgumentException
LabeledEnumResolver
LabeledEnum
by its identifying code.
getLabeledEnumByLabel
in interface LabeledEnumResolver
type
- the enum typelabel
- the enum label
IllegalArgumentException
- if the label did not map to a valid instanceprotected abstract Set findLabeledEnums(Class type)
type
- the enum type
LabeledEnum
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |