/**
   * Helper method.
   *
   * @param contentType the content type.
   * @param className the class name.
   * @return the newly created scriptFilter (always non-null).
   */
  private ScriptFilter createScriptFilter(String contentType, String className) throws Exception {

    ScriptFilter filter = new ScriptFilter();
    filter.setContentType(contentType);
    filter.setScriptClass(Class.forName(className));
    return filter;
  }
 /**
  * Helper method.
  *
  * @param filter the content type.
  * @return true if the filter is in the container, false otherwise.
  */
 private boolean isFilterInContainer(ScriptFilter filter) throws Exception {
   if (filter != null) {
     Map map = (Map) PrivateAccessor.getField(module, "scriptFilters");
     if (map != null) {
       return map.containsKey(filter.getContentType());
     }
   }
   return false;
 }