Class XMLStringBuffer
java.lang.Object
org.apache.sling.scripting.jsp.jasper.xmlparser.XMLString
org.apache.sling.scripting.jsp.jasper.xmlparser.XMLStringBuffer
XMLString is a structure used to pass character arrays. However,
XMLStringBuffer is a buffer in which characters can be appended
and extends XMLString so that it can be passed to methods
expecting an XMLString object. This is a safe operation because
it is assumed that any callee will not modify
the contents of the XMLString structure.
The contents of the string are managed by the string buffer. As characters are appended, the string buffer will grow as needed.
Note: Never set the ch
,
offset
, and length
fields directly.
These fields are managed by the string buffer. In order to reset
the buffer, call clear()
.
- Version:
- $Id: XMLStringBuffer.java 467222 2006-10-24 03:17:11Z markt $
- Author:
- Andy Clark, IBM, Eric Ye, IBM
-
Field Summary
-
Constructor Summary
ConstructorDescriptionXMLStringBuffer
(char c) Constructs a string buffer from a char.XMLStringBuffer
(char[] ch, int offset, int length) Constructs a string buffer from the specified character array.XMLStringBuffer
(int size) Constructs a string buffer from a String.Constructs a string buffer from the specified XMLString. -
Method Summary
-
Field Details
-
DEFAULT_SIZE
public static final int DEFAULT_SIZEDefault buffer size (32).- See Also:
-
-
Constructor Details
-
XMLStringBuffer
public XMLStringBuffer() -
XMLStringBuffer
public XMLStringBuffer(int size) - Parameters:
size
-
-
XMLStringBuffer
public XMLStringBuffer(char c) Constructs a string buffer from a char. -
XMLStringBuffer
Constructs a string buffer from a String. -
XMLStringBuffer
public XMLStringBuffer(char[] ch, int offset, int length) Constructs a string buffer from the specified character array. -
XMLStringBuffer
Constructs a string buffer from the specified XMLString.
-
-
Method Details
-
clear
public void clear()Clears the string buffer. -
append
public void append(char c) append- Parameters:
c
-
-
append
append- Parameters:
s
-
-
append
public void append(char[] ch, int offset, int length) append- Parameters:
ch
-offset
-length
-
-
append
append- Parameters:
s
-
-