code: 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();
              }
          }
      }
docs: Sets the template rule.
  
  @param templateRule the template rule