ehcache

net.sf.ehcache.config
Class SearchAttribute

java.lang.Object
  extended by net.sf.ehcache.config.SearchAttribute

public class SearchAttribute
extends Object

A cache search attribute. Search attributes must have a name and optionally an expression or class set (if neither is set then this implies java bean style)

Author:
teck

Constructor Summary
SearchAttribute()
           
 
Method Summary
 NodeElement asConfigElement(NodeElement parent)
          Create a generated config element node for this search attribute definition
 SearchAttribute className(String className)
          Set the attribute extractor class name
 AttributeExtractor constructExtractor(ClassLoader loader)
          Construct the extractor for this attribute configuration
 SearchAttribute expression(String expression)
          Set the attribute expression
 String getClassName()
          Get the extractor class name
 String getExpression()
          Get the attribute expression
 String getName()
          Get the attribute name
 String getTypeName()
           
 SearchAttribute name(String name)
          Set the attribute name
 SearchAttribute properties(String props)
          Set the extractor properties
 SearchAttribute propertySeparator(String sep)
          Set the extractor properties separator
 void setClass(String className)
          Set the extractor class for this attribute.
 void setExpression(String expression)
          Set the attribute expression.
 void setName(String name)
          Set the attribute name
 void setProperties(String props)
          Set the extractor properties
 void setPropertySeparator(String sep)
          Set the extractor properties separator
 void setType(Class<?> type)
          Set optional attribute type
 void setType(String type)
          Set optional attribute type
 SearchAttribute type(Class<?> type)
          Set optional attribute type
 SearchAttribute type(String type)
          Set optional attribute type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchAttribute

public SearchAttribute()
Method Detail

setName

public void setName(String name)
Set the attribute name

Parameters:
name -

setClass

public void setClass(String className)
Set the extractor class for this attribute. This class must be available at runtime and must implement AttributeExtractor

Parameters:
className -

setExpression

public void setExpression(String expression)
Set the attribute expression. See ReflectionAttributeExtractor for more information

Parameters:
expression -

setType

public void setType(String type)
Set optional attribute type

Parameters:
type -

setType

public void setType(Class<?> type)
Set optional attribute type

Parameters:
type -

getClassName

public String getClassName()
Get the extractor class name


getExpression

public String getExpression()
Get the attribute expression


getName

public String getName()
Get the attribute name


getTypeName

public String getTypeName()
Returns:
String representation of attribute type

constructExtractor

public AttributeExtractor constructExtractor(ClassLoader loader)
Construct the extractor for this attribute configuration


name

public SearchAttribute name(String name)
Set the attribute name

Parameters:
name -
Returns:
this

className

public SearchAttribute className(String className)
Set the attribute extractor class name

Parameters:
className - attribute extractor class
Returns:
this

expression

public SearchAttribute expression(String expression)
Set the attribute expression

Parameters:
expression - attribute expression
Returns:
this

type

public SearchAttribute type(String type)
Set optional attribute type

Parameters:
type -
Returns:
this

type

public SearchAttribute type(Class<?> type)
Set optional attribute type

Parameters:
type -
Returns:
this

setProperties

public void setProperties(String props)
Set the extractor properties

Parameters:
props -

setPropertySeparator

public void setPropertySeparator(String sep)
Set the extractor properties separator

Parameters:
sep -

propertySeparator

public SearchAttribute propertySeparator(String sep)
Set the extractor properties separator

Parameters:
sep -
Returns:
this

properties

public SearchAttribute properties(String props)
Set the extractor properties

Parameters:
props -
Returns:
this

asConfigElement

public NodeElement asConfigElement(NodeElement parent)
Create a generated config element node for this search attribute definition

Parameters:
parent - the enclosing parent config element
Returns:
generated config element for this search attribute

ehcache

Copyright 2001-2014, Terracotta, Inc.