public class SearchResultToAttrValueList extends Object implements org.apache.commons.collections.Transformer, org.springframework.beans.factory.InitializingBean
tokenName
from the attribute attributeName
. Ignores
attribute value if value is not of type String
. Returns the entire attribute value if
tokenName
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
instance
Transformer output: Collection
of String
instances
Constructor and Description |
---|
SearchResultToAttrValueList(String attributeName) |
SearchResultToAttrValueList(String attributeName,
String tokenName) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected String |
extract(String src,
String inTokenName)
Assumes that
src consists of name-value pairs linked via '=' and each pair separated by
',' . |
Object |
transform(Object obj) |
public SearchResultToAttrValueList(String attributeName)
protected String extract(String src, String inTokenName)
src
consists of name-value pairs linked via '='
and each pair separated by
','
.src
- the source stringinTokenName
- the name part of the name-value pair whose value will be returnedtokenName
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
Copyright © 2019 Hitachi Vantara. All rights reserved.