To add a filter to the Pod we need to use the PodBuilder.addFilter(...) method which accepts a parameter of type PodFilter. The PodFilter object specifies the id of the filter and the renderer configuration that will be used to invoke the render that will create the filter. In our example we are creating a filter with the id "genre" and we will be using a renderer called the ChoiceRenderer to render the content of the filter.
010 RendererConfig filterRenderer = 011 new RendererConfig(RendererConfigType.DOMAIN, "CT_CHOICE"); 012 013 // Create the PodFitler 014 PodFilter genreFilter = 015 new PodFilter("genre", document, filterRenderer);
On line 10-11 we create a renderer configuration which is mapped to a domain 'CT_CHOICE'. This configuration will invoke a renderer called ChoiceRenderer. We then create a PodFilter object passing an id, the document instance of the PodLoader and the renderer configuration.