public class TokenizedStringParameterDecoder extends ParameterDecoder
ParameterDecoder used to tokenize a parameter values into a List
or HashSet.
Tokenizes parameter values into a List (param-type="string-list")
or HashSet (param-type="string-hashset") using StringTokenizer.
Two default configurations of this decoder are pre-installed for all profiles. They're named
"string-list" and "string-hashset".
<resource-config target-profile="html4" selector="XXX">
<resource>com.acme.XXXContentDeliveryUnit</resource>
<param name="blockLevelElements" type="string-hashset">
p,h1,h2,h3,h4,h5,h6,div,ul,ol,dl,menu,dir,pre,hr,blockquote,address,center,noframes,isindex,fieldset,table
</param>
</resource-config>
Usage:Note, we will make this filter easier in the next release. You'll be able to call a method such as "getDecodedParameter" on theParameterparam =resourceConfig.getParameter("blockLevelElements");HashSetblockLevelElements = (HashSet)param.getValue(ContentDeliveryConfig);
SmooksResourceConfiguration, returning a decoded parameter Object.
See SmooksResourceConfiguration.| Constructor and Description |
|---|
TokenizedStringParameterDecoder() |
| Modifier and Type | Method and Description |
|---|---|
Object |
decodeValue(String value)
Decodes the value based on the smooks-resource configuration passed in the constructor.
|
void |
setConfiguration(SmooksResourceConfiguration resourceConfig)
Public constructor.
|
public void setConfiguration(SmooksResourceConfiguration resourceConfig)
resourceConfig - Configuration.public Object decodeValue(String value) throws ParameterDecodeException
decodeValue in class ParameterDecodervalue - The value to be decoded.ParameterDecodeException - Unable to decode parameter value.Copyright © 2020. All rights reserved.