org.thymeleaf.dom
Class AbstractTextNode

Object
  extended by org.thymeleaf.dom.Node
      extended by org.thymeleaf.dom.AbstractTextNode
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CDATASection, Text

public abstract class AbstractTextNode
extends Node

Base abstract class for text-based node types in Thymeleaf DOM trees: Texts and CDATASections.

Since:
2.0.0
Author:
Daniel Fernández
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.thymeleaf.dom.Node
NODE_PROPERTY_XML_ENCODING, NODE_PROPERTY_XML_STANDALONE, NODE_PROPERTY_XML_VERSION
 
Method Summary
 String getContent()
           Returns the textual content of this node, as a String.
 void setContent(String content)
           Modify the textual content of this node.
 char[] unsafeGetContentCharArray()
           Returns the unsafe inner char[] with the textual content of this code.
 void unsafeSetContent(char[] newContent)
           Modify the textual content of this node.
 
Methods inherited from class org.thymeleaf.dom.Node
applyDialectPrefix, cloneNode, getDocumentName, getLineNumber, getNodeLocalVariableNames, getNodeProperty, getNodePropertyNames, getParent, getRecomputeProcessorsAfterEachExecution, getRecomputeProcessorsImmediately, hasNodeLocalVariables, hasNodeProperty, hasParent, isSkippable, normalizeName, setAllNodeLocalVariables, setNodeLocalVariable, setNodeProperty, setParent, setRecomputeProcessorsAfterEachExecution, setRecomputeProcessorsImmediately, setSkippable, unsafeGetNodeLocalVariables, unsafeGetNodeProperties, visit
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContent

public String getContent()

Returns the textual content of this node, as a String.

Returns:
the textual content of this node.

unsafeGetContentCharArray

public char[] unsafeGetContentCharArray()

Returns the unsafe inner char[] with the textual content of this code.

Calling this method avoids the need to create a new String object (like getContent() does, but requires to be extremely careful with the result, as any modification to the returned char array will actually modify the node's contents.

Returns:
the textual content of this node.

setContent

public void setContent(String content)

Modify the textual content of this node.

Parameters:
content - the new content

unsafeSetContent

public void unsafeSetContent(char[] newContent)

Modify the textual content of this node. This method is considered unsafe because it does not copy the specified array (instead, it is merely assigned to an internal variable).

Parameters:
newContent - the new content


Copyright © 2012 The THYMELEAF team. All Rights Reserved.