public OptInTemplateClassResolver(Set allowedClasses,List trustedTemplates){
  this.allowedClasses=allowedClasses != null ? allowedClasses : Collections.EMPTY_SET;
  if (trustedTemplates != null) {
    trustedTemplateNames=new HashSet();
    trustedTemplatePrefixes=new ArrayList();
    Iterator it=trustedTemplates.iterator();
    while (it.hasNext()) {
      String li=(String)it.next();
      if (li.startsWith("/"))       li=li.substring(1);
      if (li.endsWith("*")) {
        trustedTemplatePrefixes.add(li.substring(0,li.length() - 1));
      }
 else {
        trustedTemplateNames.add(li);
      }
    }
  }
 else {
    trustedTemplateNames=Collections.EMPTY_SET;
    trustedTemplatePrefixes=Collections.EMPTY_LIST;
  }
}

public OptInTemplateClassResolver ( Set allowedClasses , List trustedTemplates ) { this . allowedClasses = allowedClasses != null ? allowedClasses : Collections . EMPTY_SET ; if ( trustedTemplates != null ) { trustedTemplateNames = new HashSet ( ) ; trustedTemplatePrefixes = new ArrayList ( ) ; Iterator it = trustedTemplates . iterator ( ) ; while ( it . hasNext ( ) ) { String li = ( String ) it . next ( ) ; if ( li . startsWith ( "/" ) ) li = li . substring ( 1 ) ; if ( li . endsWith ( "*" ) ) { trustedTemplatePrefixes . add ( li . substring ( 0 , li . length ( ) - 1 ) ) ; } else { trustedTemplateNames . add ( li ) ; } } } else { trustedTemplateNames = Collections . EMPTY_SET ; trustedTemplatePrefixes = Collections . EMPTY_LIST ; } }
creates a new instance .
