Class StringSitemeshBuffer
java.lang.Object
com.opensymphony.module.sitemesh.html.util.StringSitemeshBuffer
- All Implemented Interfaces:
SitemeshBuffer
SitemeshBuffer that is a string.
-
Constructor Summary
ConstructorsConstructorDescriptionStringSitemeshBuffer(String buffer) Instantiates a new string sitemesh buffer. -
Method Summary
Modifier and TypeMethodDescriptionstatic SitemeshBufferFragmentcreateBufferFragment(String buffer) Creates the buffer fragment.intGet the length of the buffered content.char[]Get the char array for this buffer.intGet the total length of the buffered content, including the length of any chained buffers.intgetTotalLength(int start, int length) Get the total length of the buffered content, including chained buffers from start to length.booleanWhether the buffer has fragments or not.voidWrite this buffer, and any chained sub buffers in the given range, out to the given writer.
-
Constructor Details
-
StringSitemeshBuffer
Instantiates a new string sitemesh buffer.- Parameters:
buffer- the buffer
-
-
Method Details
-
getCharArray
public char[] getCharArray()Description copied from interface:SitemeshBufferGet the char array for this buffer. This array may be longer than the length of the content, you must use getBufferLength() in combination with this method.- Specified by:
getCharArrayin interfaceSitemeshBuffer- Returns:
- The char array for this buffer
-
getBufferLength
public int getBufferLength()Description copied from interface:SitemeshBufferGet the length of the buffered content.- Specified by:
getBufferLengthin interfaceSitemeshBuffer- Returns:
- The length of the buffered content.
-
getTotalLength
public int getTotalLength()Description copied from interface:SitemeshBufferGet the total length of the buffered content, including the length of any chained buffers.- Specified by:
getTotalLengthin interfaceSitemeshBuffer- Returns:
- The total length.
-
getTotalLength
public int getTotalLength(int start, int length) Description copied from interface:SitemeshBufferGet the total length of the buffered content, including chained buffers from start to length.- Specified by:
getTotalLengthin interfaceSitemeshBuffer- Parameters:
start- Where to start counting the length fromlength- Where to finish- Returns:
- THe total length in the given range
-
writeTo
Description copied from interface:SitemeshBufferWrite this buffer, and any chained sub buffers in the given range, out to the given writer.- Specified by:
writeToin interfaceSitemeshBuffer- Parameters:
writer- The writer to write tostart- The position to start writing fromlength- The length to write- Throws:
IOException- If an error occurred
-
hasFragments
public boolean hasFragments()Description copied from interface:SitemeshBufferWhether the buffer has fragments or not.- Specified by:
hasFragmentsin interfaceSitemeshBuffer- Returns:
- True if it has fragments
-
createBufferFragment
Creates the buffer fragment.- Parameters:
buffer- the buffer- Returns:
- the sitemesh buffer fragment
-