Top Description Constructors Methods
net.sf.ehcache.search.attribute

public Class KeyObjectAttributeExtractor

extends Object
implements AttributeExtractor
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.search.attribute.AttributeExtractor, java.io.Serializable
Imports
net.sf.ehcache.Element

Attempt to use the element key object itself as a search attribute. If the key is not a legal type it is omitted
Author
teck

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
attributeFor(Element
the cache element to inspect
element
,
String
the name of the requested attribute
attributeName
)

Implements net.sf.ehcache.search.attribute.AttributeExtractor.attributeFor.

Extract the attribute value.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

KeyObjectAttributeExtractorback to summary
public KeyObjectAttributeExtractor()

Method Detail

attributeForback to summary
public Object attributeFor(Element element, String attributeName) throws AttributeExtractorException

Implements net.sf.ehcache.search.attribute.AttributeExtractor.attributeFor.

Doc from net.sf.ehcache.search.attribute.AttributeExtractor.attributeFor.

Extract the attribute value. The instance returned from this method must be one of:

  • java.lang.Boolean
  • java.lang.Byte
  • java.lang.Character
  • java.lang.Double
  • java.lang.Float
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Short
  • java.lang.String
  • java.util.Date
  • java.sql.Date
  • java.lang.Enum

Note

null is a legal return here as well indicating that this attribute will not be available for the given element

Parameters
element:Element

the cache element to inspect

attributeName:String

the name of the requested attribute

Returns:Object

the attribute value

Exceptions
AttributeExtractorException:
if the attribute cannot be found or extracted