Sunday, November 25, 2018

AttributeExtractorEntity

package attributeExtractor;

import com.wm.data.IData;
import com.wm.data.IDataUtil;
import java.util.Properties;
import net.sf.ehcache.Element;
import net.sf.ehcache.search.attribute.AttributeExtractor;
import net.sf.ehcache.search.attribute.AttributeExtractorException;

public class AttributeExtractorEntity implements AttributeExtractor
{
  private static final long serialVersionUID = 1L;
  private Properties p;
  
  public AttributeExtractorEntity(Properties p)
  {
    this.p = p;
  }
  
  public Object attributeFor(Element element, String attributeName)
    throws AttributeExtractorException
  {
    return IDataUtil.get(((IData)element.getObjectValue()).getCursor(), attributeName);
  }
}

No comments:

Post a Comment