Package net.sf.ehcache.config
Class SearchAttribute
- java.lang.Object
-
- net.sf.ehcache.config.SearchAttribute
-
public class SearchAttribute extends java.lang.ObjectA 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
Constructors Constructor Description SearchAttribute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeElementasConfigElement(NodeElement parent)Create a generated config element node for this search attribute definitionSearchAttributeclassName(java.lang.String className)Set the attribute extractor class nameAttributeExtractorconstructExtractor(java.lang.ClassLoader loader)Construct the extractor for this attribute configurationSearchAttributeexpression(java.lang.String expression)Set the attribute expressionjava.lang.StringgetClassName()Get the extractor class namejava.lang.StringgetExpression()Get the attribute expressionjava.lang.StringgetName()Get the attribute namejava.lang.StringgetTypeName()SearchAttributename(java.lang.String name)Set the attribute nameSearchAttributeproperties(java.lang.String props)Set the extractor propertiesSearchAttributepropertySeparator(java.lang.String sep)Set the extractor properties separatorvoidsetClass(java.lang.String className)Set the extractor class for this attribute.voidsetExpression(java.lang.String expression)Set the attribute expression.voidsetName(java.lang.String name)Set the attribute namevoidsetProperties(java.lang.String props)Set the extractor propertiesvoidsetPropertySeparator(java.lang.String sep)Set the extractor properties separatorvoidsetType(java.lang.Class<?> type)Set optional attribute typevoidsetType(java.lang.String type)Set optional attribute typeSearchAttributetype(java.lang.Class<?> type)Set optional attribute typeSearchAttributetype(java.lang.String type)Set optional attribute type
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Set the attribute name- Parameters:
name-
-
setClass
public void setClass(java.lang.String className)
Set the extractor class for this attribute. This class must be available at runtime and must implementAttributeExtractor- Parameters:
className-
-
setExpression
public void setExpression(java.lang.String expression)
Set the attribute expression. SeeReflectionAttributeExtractorfor more information- Parameters:
expression-
-
setType
public void setType(java.lang.String type)
Set optional attribute type- Parameters:
type-
-
setType
public void setType(java.lang.Class<?> type)
Set optional attribute type- Parameters:
type-
-
getClassName
public java.lang.String getClassName()
Get the extractor class name
-
getExpression
public java.lang.String getExpression()
Get the attribute expression
-
getName
public java.lang.String getName()
Get the attribute name
-
getTypeName
public java.lang.String getTypeName()
- Returns:
- String representation of attribute type
-
constructExtractor
public AttributeExtractor constructExtractor(java.lang.ClassLoader loader)
Construct the extractor for this attribute configuration
-
name
public SearchAttribute name(java.lang.String name)
Set the attribute name- Parameters:
name-- Returns:
- this
-
className
public SearchAttribute className(java.lang.String className)
Set the attribute extractor class name- Parameters:
className- attribute extractor class- Returns:
- this
-
expression
public SearchAttribute expression(java.lang.String expression)
Set the attribute expression- Parameters:
expression- attribute expression- Returns:
- this
-
type
public SearchAttribute type(java.lang.String type)
Set optional attribute type- Parameters:
type-- Returns:
- this
-
type
public SearchAttribute type(java.lang.Class<?> type)
Set optional attribute type- Parameters:
type-- Returns:
- this
-
setProperties
public void setProperties(java.lang.String props)
Set the extractor properties- Parameters:
props-
-
setPropertySeparator
public void setPropertySeparator(java.lang.String sep)
Set the extractor properties separator- Parameters:
sep-
-
propertySeparator
public SearchAttribute propertySeparator(java.lang.String sep)
Set the extractor properties separator- Parameters:
sep-- Returns:
- this
-
properties
public SearchAttribute properties(java.lang.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
-
-