Package org.thymeleaf.util
Class AbstractLazyCharSequence
Object
org.thymeleaf.util.AbstractLazyCharSequence
- All Implemented Interfaces:
CharSequence
,IWritableCharSequence
- Direct Known Subclasses:
LazyEscapingCharSequence
,LazyProcessingCharSequence
Abstract class for character sequences that perform lazy evaluation of their textual contents.
Implementations of this class allow the possibility that their textual contents are actually computed during output writing (if possible), and therefore directly written to output buffers and never requiring being completely resolved in memory.
This is mostly an internal class, and its use is not recommended from user's code.
Children of this class are not thread-safe.
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal char
charAt
(int index) final boolean
final int
hashCode()
final int
length()
protected abstract String
final CharSequence
subSequence
(int beginIndex, int endIndex) final String
toString()
final void
Write the contents of this char sequence directly to an outputWriter
.protected abstract void
writeUnresolved
(Writer writer) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
Constructor Details
-
AbstractLazyCharSequence
protected AbstractLazyCharSequence()
-
-
Method Details
-
resolveText
-
length
public final int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public final char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
write
Description copied from interface:IWritableCharSequence
Write the contents of this char sequence directly to an output
Writer
.This method can avoid the need to create a
String
object containing all the contents in this character sequence just when we want to write it to aWriter
.- Specified by:
write
in interfaceIWritableCharSequence
- Parameters:
writer
- the writer to write the character sequence to.- Throws:
IOException
- if an input/output exception happens during writing
-
writeUnresolved
- Throws:
IOException
-
equals
-
hashCode
public final int hashCode() -
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-