Class TokenizedStringParameterDecoder

  • All Implemented Interfaces:
    ContentHandler

    public class TokenizedStringParameterDecoder
    extends ParameterDecoder<String>
    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".

    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);
     

    Note, we will make this filter easier in the next release. You'll be able to call a method such as "getDecodedParameter" on the ResourceConfig, returning a decoded parameter Object.

    See ResourceConfig.

    Author:
    tfennelly
    • Constructor Detail

      • TokenizedStringParameterDecoder

        public TokenizedStringParameterDecoder()
    • Method Detail

      • setConfiguration

        public void setConfiguration​(ResourceConfig resourceConfig)
        Public constructor.
        Parameters:
        resourceConfig - Configuration.