コード例 #1
0
  /**
   * Visits a {@link TemplateNode}, processing those that have kind html or attributes and making
   * sure that the autoescape mode is strict.
   */
  @Override
  protected void visitTemplateNode(TemplateNode node) {
    if (node.getContentKind() != ContentKind.HTML
        && node.getContentKind() != ContentKind.ATTRIBUTES) {
      return;
    }

    if (node.getAutoescapeMode() != AutoescapeMode.STRICT) {
      errorReporter.report(node.getSourceLocation(), NON_STRICT_TEMPLATE);
    }

    visitSoyNode(node, true);
  }
コード例 #2
0
 @Override
 protected void visitTemplateNode(TemplateNode node) {
   if (node.getAutoescapeMode() != AutoescapeMode.STRICT) {
     errorReporter.report(node.getSourceLocation(), INVALID_AUTOESCAPING);
   }
 }