Class JavaBeanAttributeExtractor

  • All Implemented Interfaces:
    java.io.Serializable, AttributeExtractor

    public class JavaBeanAttributeExtractor
    extends java.lang.Object
    implements AttributeExtractor
    Extracts a search attribute determining the value as a javabean property on either the key or the value. If the property exists on both the key and the value an exception is thrown
    Author:
    teck
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object attributeFor​(Element element, java.lang.String attributeName)
      Extract the attribute value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaBeanAttributeExtractor

        public JavaBeanAttributeExtractor​(java.lang.String beanProperty)
        Constructor
        Parameters:
        beanProperty - the bean property name to extract
    • Method Detail

      • attributeFor

        public 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

        Specified by:
        attributeFor in interface AttributeExtractor
        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