public abstract class

AbstractCachingLabeledEnumResolver

extends Object
implements LabeledEnumResolver
java.lang.Object
   ↳ org.springframework.core.enums.AbstractCachingLabeledEnumResolver
Known Direct Subclasses

This class is deprecated.
as of Spring 3.0, in favor of Java 5 enums.

Class Overview

Abstract base class for LabeledEnumResolver implementations, caching all retrieved LabeledEnum instances.

Subclasses need to implement the template method findLabeledEnums(Class).

Summary

Fields
protected final Log logger
Public Constructors
AbstractCachingLabeledEnumResolver()
Public Methods
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<ComparableLabeledEnum> getLabeledEnumMap(Class type)
Return a map of enumerations of a particular type.
Set<LabeledEnum> getLabeledEnumSet(Class type)
Return a set of enumerations of a particular type.
Protected Methods
abstract Set<LabeledEnum> findLabeledEnums(Class type)
Template method to be implemented by subclasses.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.core.enums.LabeledEnumResolver

Fields

protected final Log logger

Also: SpringCore

Public Constructors

public AbstractCachingLabeledEnumResolver ()

Also: SpringCore

Public Methods

public LabeledEnum getLabeledEnumByCode (Class type, Comparable code)

Also: SpringCore

Resolve a single LabeledEnum by its identifying code.

Parameters
type the enum type
code the enum code
Returns
  • the enum

public LabeledEnum getLabeledEnumByLabel (Class type, String label)

Also: SpringCore

Resolve a single LabeledEnum by its identifying code.

Parameters
type the enum type
label the enum label
Returns
  • the enum

public Map<ComparableLabeledEnum> getLabeledEnumMap (Class type)

Also: SpringCore

Return a map of enumerations of a particular type. Each element in the map should be a key/value pair, where the key is the enum code, and the value is the LabeledEnum instance.

Parameters
type the enum type
Returns
  • a Map of localized enumeration instances, with enum code as key and LabeledEnum instance as value

public Set<LabeledEnum> getLabeledEnumSet (Class type)

Also: SpringCore

Return a set of enumerations of a particular type. Each element in the set should be an instance of LabeledEnum.

Parameters
type the enum type
Returns
  • a set of localized enumeration instances for the provided type

Protected Methods

protected abstract Set<LabeledEnum> findLabeledEnums (Class type)

Also: SpringCore

Template method to be implemented by subclasses. Supposed to find all LabeledEnum instances for the given type.

Parameters
type the enum type
Returns
  • the Set of LabeledEnum instances
See Also