Class TokenizedStringParameterDecoder
- java.lang.Object
-
- org.smooks.engine.resource.config.ParameterDecoder<String>
-
- org.smooks.engine.resource.config.TokenizedStringParameterDecoder
-
- All Implemented Interfaces:
ContentHandler
public class TokenizedStringParameterDecoder extends ParameterDecoder<String>
ParameterDecoder
used to tokenize a parameter values into aList
orHashSet
. Tokenizes parameter values into aList
(param-type="string-list") orHashSet
(param-type="string-hashset") usingStringTokenizer
. Two default configurations of this decoder are pre-installed for all profiles. They're named "string-list" and "string-hashset".Example Usage
The following example illustrates use of the pre-installed "string-hashset" decoder: Configuration:<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:
... and "com.acme.XXXContentDeliveryUnit" accesses this parameter value as follows:Parameter
param =resourceConfig
.getParameter("blockLevelElements")
;HashSet
blockLevelElements = (HashSet)param.getValue(ContentDeliveryConfig)
;ResourceConfig
, returning a decoded parameter Object.See
ResourceConfig
.- Author:
- tfennelly
-
-
Constructor Summary
Constructors Constructor Description TokenizedStringParameterDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
decodeValue(String value)
Decodes the value based on the smooks-resource configuration passed in the constructor.void
setConfiguration(ResourceConfig resourceConfig)
Public constructor.
-
-
-
Method Detail
-
setConfiguration
public void setConfiguration(ResourceConfig resourceConfig)
Public constructor.- Parameters:
resourceConfig
- Configuration.
-
decodeValue
public Object decodeValue(String value) throws ParameterDecodeException
Decodes the value based on the smooks-resource configuration passed in the constructor.- Specified by:
decodeValue
in classParameterDecoder<String>
- Parameters:
value
- The value to be decoded.- Returns:
- The decode value Object.
- Throws:
ParameterDecodeException
- Unable to decode parameter value.
-
-