Sets the template rule.

@param templateRule the template rule
342909
public void setTemplateRule(TemplateRule templateRule) {
        this.templateRule = templateRule;
        if (templateRule != null) {
            if (this.transformType == null) {
                setTransformType(TransformType.TEXT);
            }
            if (templateRule.getEncoding() != null && this.encoding == null) {
                this.encoding = templateRule.getEncoding();
            }
        }
    }
837412
public void setRule(com.google.api.ads.admanager.axis.v201808.FirstPartyAudienceSegmentRule rule) {
        this.rule = rule;
    }
85068
public void setTemplateSource(String name, String source) {
        mTemplateSources.put(name, new TemplateSource(name, source));
    }
1254892
public function setTemplate($template)
    {
        if (Format::isUri($template) === true || (gettype($template) === 'string' && empty($template) === true)) {
            $this->template = $template;
        } else {
            $msg = "The given template '${template}' is not a valid URI.";
            throw new InvalidArgumentException($msg);
        }
    }
1064431
public void addTemplate( String templateName, URLTemplate template )
    {
        if ( templateName == null || templateName.length() == 0 )
        {
            throw new IllegalArgumentException( "Template name cannot be null or empty." );
        }

        if ( template == null )
        {
            throw new IllegalArgumentException( "URLTemplate cannot be null." );
        }

        _templates.put( templateName, template );
    }
926150
void setRuleMessage(XmlModelWriter xw, ValidatorRule rule, Element element)
    {
        String messageKey = rule.getMessageKey();
        String message = rule.getMessage();

        if ( messageKey != null || message != null )
        {
            Element msgElementToUse = findChildElement(xw, element, "msg", "name", rule.getRuleName(), true, null);
            setElementAttribute(msgElementToUse, "resource", true);

            if ( messageKey != null )
            {
                setElementAttribute(msgElementToUse, "key", messageKey);
                if (_isValidatorOneOne) {
                    setElementAttribute(msgElementToUse, "bundle", rule.getBundle());
                }
            }
            else // message != null (it's a hardcoded message)
            {
                // Add our special constant as the message key, append the hardcoded message to it.
                setElementAttribute(msgElementToUse, "key", ValidatorConstants.EXPRESSION_KEY_PREFIX + message);
            }
        }
    }
510208
public function setTemplateFile(string $sRelativePathToFile) : void
  {
    if(!is_file($sRelativePathToFile)) {
      throw new \Exception('Template file not found.');
    }
    
    $sFileContent = file_get_contents($sRelativePathToFile);
    $this->setTemplate($sFileContent);
  }
1175952
public function setTemplate(Template $template = null)
	{
		if ($this->writeOnce($this->template, $template)) {
			$this->template->addTemplateLayout($this);
		}
	}
532929
public void setRules(java.util.Collection<TopicRuleListItem> rules) {
        if (rules == null) {
            this.rules = null;
            return;
        }

        this.rules = new java.util.ArrayList<TopicRuleListItem>(rules);
    }
68924
def setMenuTemplate( self, template ):
        
        try:
            xtree = ElementTree.fromstring(nativestring(template))
        except ExpatError, e:
            logger.exception(e)
            return
        
        self.uiMenuTREE.setUpdatesEnabled(False)
        self.uiMenuTREE.blockSignals(True)
        
        self.uiMenuTREE.clear()
        for xaction in xtree:
            self.uiMenuTREE.addTopLevelItem(self.loadXml(xaction))
        
        self.uiMenuTREE.setUpdatesEnabled(True)
        self.uiMenuTREE.blockSignals(False)
292727
public void setRulesPackages(java.util.Collection<RulesPackage> rulesPackages) {
        if (rulesPackages == null) {
            this.rulesPackages = null;
            return;
        }

        this.rulesPackages = new java.util.ArrayList<RulesPackage>(rulesPackages);
    }
297832
public void setRuleId(String v) {
    if (GrammarError_Type.featOkTst
        && ((GrammarError_Type) jcasType).casFeat_ruleId == null)
      jcasType.jcas.throwFeatMissing("ruleId", "cogroo.uima.GrammarError");
    jcasType.ll_cas.ll_setStringValue(addr,
        ((GrammarError_Type) jcasType).casFeatCode_ruleId, v);
  }
253702
public void setContainer(Container container) {
		this.container = container;

		Map<String, TemplateEngine> map = new HashMap<String, TemplateEngine>();

		// loading TemplateEngine class from DI Container.
		Set<String> prefixes = container.getInstanceNames(TemplateEngine.class);
		for (String prefix : prefixes) {
			TemplateEngine engine = (TemplateEngine) container.getInstance(TemplateEngine.class, prefix);
			map.put(prefix, engine);
		}
		this.templateEngines = Collections.unmodifiableMap(map);
	}
1024307
@SuppressWarnings("unchecked")
    public <T extends XPathBuilder> T setTemplate(final String key, final String value) {
        if (value == null) {
            templates.remove(key);
        } else {
            templates.put(key, value);
        }
        return (T) this;
    }
1295579
def set_template(self, template):
        
        if isinstance(template, templates.BasicTemplate):
            self.template = template
        else:
            raise TypeError('converter#set_template:'
                            'Template must inherit from BasicTemplate')
63905
public void setTemplateVars(List<TemplateVar> templateVars) {
		this.templateVars.clear();
		if(templateVars != null && !templateVars.isEmpty()) {
			this.templateVars.addAll(templateVars);
		}
	}
1272912
public void setRule(String v) {
    if (Clause_Type.featOkTst && ((Clause_Type)jcasType).casFeat_rule == null)
      jcasType.jcas.throwFeatMissing("rule", "com.digitalpebble.rasp.Clause");
    jcasType.ll_cas.ll_setStringValue(addr, ((Clause_Type)jcasType).casFeatCode_rule, v);}