Class SearchResultToAttrValueList
- java.lang.Object
-
- org.pentaho.platform.plugin.services.security.userrole.ldap.transform.SearchResultToAttrValueList
-
- All Implemented Interfaces:
org.apache.commons.collections.Transformer
,org.springframework.beans.factory.InitializingBean
public class SearchResultToAttrValueList extends Object implements org.apache.commons.collections.Transformer, org.springframework.beans.factory.InitializingBean
Extracts the value of the tokentokenName
from the attributeattributeName
. Ignores attribute value if value is not of typeString
. Returns the entire attribute value iftokenName
is not specified.Note: This transformer can produce more than one output (in the form of a collection) per single input. Any client of this class should merge the results (e.g.
collection.addAll(collection)
) into an existing collection.Transformer input:
SearchResult
instanceTransformer output:
TODO refactor into searchresulttoattributelist, attributelisttosingleattribute, attributestringtoattributesubstringCollection
ofString
instances- Author:
- mlowery
-
-
Constructor Summary
Constructors Constructor Description SearchResultToAttrValueList(String attributeName)
SearchResultToAttrValueList(String attributeName, String tokenName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected String
extract(String src, String inTokenName)
Assumes thatsrc
consists of name-value pairs linked via'='
and each pair separated by','
.Object
transform(Object obj)
-
-
-
Method Detail
-
extract
protected String extract(String src, String inTokenName)
Assumes thatsrc
consists of name-value pairs linked via'='
and each pair separated by','
.- Parameters:
src
- the source stringinTokenName
- the name part of the name-value pair whose value will be returned- Returns:
- the value part of the name-value pair whose name part is
tokenName
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
-