Package net.sf.ehcache.search.attribute
Interface AttributeExtractor
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
JavaBeanAttributeExtractor,KeyObjectAttributeExtractor,ReflectionAttributeExtractor,ValueObjectAttributeExtractor
public interface AttributeExtractor extends java.io.SerializableUsed to extract a search attribute value for a given cache element.
Instances must beSerializablein order to ensure identical extractors are used in distributed caches- Author:
- teck
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectattributeFor(Element element, java.lang.String attributeName)Extract the attribute value.
-
-
-
Method Detail
-
attributeFor
java.lang.Object attributeFor(Element element, java.lang.String attributeName) throws AttributeExtractorException
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- the cache element to inspectattributeName- the name of the requested attribute- Returns:
- the attribute value
- Throws:
AttributeExtractorException- if the attribute cannot be found or extracted
-
-