<commit_before>/*
 * Created on 19 Sep 2006
 */
package uk.org.ponder.rsf.templateresolver;

import uk.org.ponder.rsf.viewstate.ContextURLProvider;
import uk.org.ponder.rsf.viewstate.ViewParameters;
import uk.org.ponder.stringutil.StringList;

/**
 * A simple TemplateResolverStrategy that follows a static strategy guided by
 * field values.
 * 
 * @author <NAME> (<EMAIL>)
 */

public class StaticTemplateResolverStrategy implements RootAwareTRS,
    MultipleTemplateResolverStrategy, BaseAwareTemplateResolverStrategy {
  private String templateResourceBase = "/";
  private int rootResolverPriority = 1;
  private String names;
  private ContextURLProvider cup;
  private String externalURLbase;
  private String basedir;
  private boolean ismultiple = true;

  public void setContextURLProvider(ContextURLProvider cup) {
    this.cup = cup;
  }

  /** Set a comma-separated list of template names to be returned */
  public void setTemplateNames(String names) {
    this.names = names;
  }

  public void setRootResolverPriority(int rootResolverPriority) {
    this.rootResolverPriority = rootResolverPriority;
  }

  public void setMultiple(boolean ismultiple) {
    this.ismultiple = ismultiple;
  }

  public boolean isMultiple() {
    return ismultiple;
  }
  
  /** Set the base directory in which templates will be found * */
  public void setBaseDirectory(String basedir) {
    this.basedir = basedir;
  }

  public StringList resolveTemplatePath(ViewParameters viewparams) {
    StringList togo = StringList.fromString(names);
    for (int i = 0; i < togo.size(); ++i) {
      togo.set(i, basedir + togo.get(i));
    }
    return togo;
  }

  public void setExternalURLBase(String externalURLBase) {
    this.externalURLbase = externalURLBase;
  }

  public String getExternalURLBase() {
    return externalURLbase == null ? cup.getContextBaseURL()
        : externalURLbase;
  }
<commit_msg>Added setter<commit_after>/*
 * Created on 19 Sep 2006
 */
package uk.org.ponder.rsf.templateresolver;

import uk.org.ponder.rsf.viewstate.ContextURLProvider;
import uk.org.ponder.rsf.viewstate.ViewParameters;
import uk.org.ponder.stringutil.StringList;

/**
 * A simple TemplateResolverStrategy that follows a static strategy guided by
 * field values.
 * 
 * @author <NAME> (<EMAIL>)
 */

public class StaticTemplateResolverStrategy implements RootAwareTRS,
    MultipleTemplateResolverStrategy, BaseAwareTemplateResolverStrategy {
  private String templateResourceBase = "/";
  private int rootResolverPriority = 1;
  private String names;
  private ContextURLProvider cup;
  private String externalURLbase;
  private String basedir;
  private boolean ismultiple = true;

  public void setContextURLProvider(ContextURLProvider cup) {
    this.cup = cup;
  }

  /** Set a comma-separated list of template names to be returned */
  public void setTemplateNames(String names) {
    this.names = names;
  }

  public void setRootResolverPriority(int rootResolverPriority) {
    this.rootResolverPriority = rootResolverPriority;
  }

  public void setMultiple(boolean ismultiple) {
    this.ismultiple = ismultiple;
  }

  public boolean isMultiple() {
    return ismultiple;
  }
  
  /** Set the base directory in which templates will be found * */
  public void setBaseDirectory(String basedir) {
    this.basedir = basedir;
  }

  public StringList resolveTemplatePath(ViewParameters viewparams) {
    StringList togo = StringList.fromString(names);
    for (int i = 0; i < togo.size(); ++i) {
      togo.set(i, basedir + togo.get(i));
    }
    return togo;
  }

  public void setExternalURLBase(String externalURLBase) {
    this.externalURLbase = externalURLBase;
  }

  public String getExternalURLBase() {
    return externalURLbase == null ? cup.getContextBaseURL()
        : externalURLbase;
  }

  public void setTemplateResourceBase(String templateResourceBase) {
    this.templateResourceBase = templateResourceBase;
  }
  
{'fraction_non_alphanumeric': 0.08606245239908607, 'fraction_numerical': 0.004061944656004062, 'mean_word_length': 4.031928480204343, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5664502', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1113, 'n_words': 301}