ehcache

net.sf.ehcache.search.attribute
Interface AttributeExtractor

All Superinterfaces:
Serializable
All Known Implementing Classes:
JavaBeanAttributeExtractor, KeyObjectAttributeExtractor, ReflectionAttributeExtractor, ValueObjectAttributeExtractor

public interface AttributeExtractor
extends Serializable

Used to extract a search attribute value for a given cache element.

Instances must be Serializable in order to ensure identical extractors are used in distributed caches

Author:
teck

Method Summary
 Object attributeFor(Element element, String attributeName)
          Extract the attribute value.
 

Method Detail

attributeFor

Object attributeFor(Element element,
                    String attributeName)
                    throws AttributeExtractorException
Extract the attribute value. The instance returned from this method must be one of:

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

Parameters:
element - the cache element to inspect
attributeName - the name of the requested attribute
Returns:
the attribute value
Throws:
AttributeExtractorException - if the attribute cannot be found or extracted

ehcache

Copyright 2001-2016, Terracotta, Inc.