Node.TemplateText (Apache Tomcat 11.0.25 API Documentation)
Description: declaration: package: org.apache.jasper.compiler, class: Node, class: TemplateText

# Class Node.TemplateText

java.lang.Object
org.apache.jasper.compiler.Node
org.apache.jasper.compiler.Node.TemplateText

All Implemented Interfaces:
  `TagConstants`

Enclosing class:
  `Node`

public static class Node.TemplateText extends Node
Represents a template text string

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Node

  `Node.AttributeDirective, Node.AttributeGenerator, Node.ChildInfo, Node.ChildInfoBase, Node.Comment, Node.CustomTag, Node.Declaration, Node.DoBodyAction, Node.ELExpression, Node.Expression, Node.ForwardAction, Node.GetProperty, Node.IncludeAction, Node.IncludeDirective, Node.InvokeAction, Node.JspAttribute, Node.JspBody, Node.JspElement, Node.JspOutput, Node.JspRoot, Node.JspText, Node.NamedAttribute, Node.Nodes, Node.PageDirective, Node.ParamAction, Node.Root, Node.ScriptingElement, Node.Scriptlet, Node.SetProperty, Node.TagDirective, Node.TaglibDirective, Node.TemplateText, Node.UninterpretedTag, Node.UseBean, Node.VariableDirective, Node.Visitor`

- ## Field Summary

  ### Fields inherited from class Node

  `attrs, beginJavaLine, body, endJavaLine, innerClassName, localName, namedAttributeNodes, nonTaglibXmlnsAttrs, parent, qName, startMark, taglibAttrs, text`

  ### Fields inherited from interface TagConstants

  `ATTRIBUTE_ACTION, ATTRIBUTE_DIRECTIVE_ACTION, BODY_ACTION, DECLARATION_ACTION, DIRECTIVE_ACTION, DOBODY_ACTION, ELEMENT_ACTION, EXPRESSION_ACTION, FORWARD_ACTION, GET_PROPERTY_ACTION, INCLUDE_ACTION, INCLUDE_DIRECTIVE_ACTION, INVOKE_ACTION, JSP_ATTRIBUTE_ACTION, JSP_ATTRIBUTE_DIRECTIVE_ACTION, JSP_BODY_ACTION, JSP_DECLARATION_ACTION, JSP_DOBODY_ACTION, JSP_ELEMENT_ACTION, JSP_EXPRESSION_ACTION, JSP_FORWARD_ACTION, JSP_GET_PROPERTY_ACTION, JSP_INCLUDE_ACTION, JSP_INCLUDE_DIRECTIVE_ACTION, JSP_INVOKE_ACTION, JSP_OUTPUT_ACTION, JSP_PAGE_DIRECTIVE_ACTION, JSP_PARAM_ACTION, JSP_ROOT_ACTION, JSP_SCRIPTLET_ACTION, JSP_SET_PROPERTY_ACTION, JSP_TAG_DIRECTIVE_ACTION, JSP_TAGLIB_DIRECTIVE_ACTION, JSP_TEXT_ACTION, JSP_TEXT_ACTION_END, JSP_URI, JSP_USE_BEAN_ACTION, JSP_VARIABLE_DIRECTIVE_ACTION, OUTPUT_ACTION, PAGE_DIRECTIVE_ACTION, PARAM_ACTION, ROOT_ACTION, SCRIPTLET_ACTION, SET_PROPERTY_ACTION, TAG_DIRECTIVE_ACTION, TAGLIB_DIRECTIVE_ACTION, TEXT_ACTION, URN_JSPTAGDIR, URN_JSPTLD, USE_BEAN_ACTION, VARIABLE_DIRECTIVE_ACTION`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(Node.Visitor v)`
  `void`
  `addSmap(int srcLine)`
  Add a source to Java line mapping
  `ArrayList<Integer>`
  `getExtraSmap()`
  Returns the extra source-to-Java line mappings for this template text.
  `boolean`
  `isAllSpace()`
  Checks if this template text contains whitespace only.
  `void`
  `ltrim()`
  Trim all whitespace from the left of the template text
  `void`
  `rtrim()`
  Trim all whitespace from the right of the template text
  `void`
  `setText(String text)`
  Sets the text content of this template text node.

  ### Methods inherited from class Node

  `getAttributes, getAttributeValue, getBeginJavaLine, getBody, getEndJavaLine, getInnerClassName, getLocalName, getNamedAttributeNode, getNamedAttributeNodes, getNonTaglibXmlnsAttributes, getParent, getQName, getRoot, getStart, getTaglibAttributes, getText, getTextAttribute, setAttributes, setBeginJavaLine, setBody, setEndJavaLine, setInnerClassName`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### accept

    public void accept(Node.Visitor v) throws JasperException
    Throws:
      `JasperException`

  - ### ltrim

    public void ltrim()
    Trim all whitespace from the left of the template text

  - ### setText

    public void setText(String text)
    Sets the text content of this template text node.
    Parameters:
      `text` - The text content to set

  - ### rtrim

    public void rtrim()
    Trim all whitespace from the right of the template text

  - ### isAllSpace

    public boolean isAllSpace()
    Checks if this template text contains whitespace only.
    Returns:
      true if this template text contains whitespace only

  - ### addSmap

    public void addSmap(int srcLine)
    Add a source to Java line mapping
    Parameters:
      `srcLine` - The position of the source line, relative to the line at the start of this node. The corresponding java line is assumed to be consecutive, i.e. one more than the last.

  - ### getExtraSmap

    public ArrayList<Integer> getExtraSmap()
    Returns the extra source-to-Java line mappings for this template text.
    Returns:
      The extra SMAP entries, or null if none