Package com.opensymphony.module.sitemesh
Class SitemeshBufferFragment.Builder
java.lang.Object
com.opensymphony.module.sitemesh.SitemeshBufferFragment.Builder
- Enclosing class:
SitemeshBufferFragment
A builder for fragments.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the fragment.delete(int pos, int length) Delete length characters from pos in this buffer fragment.end(int pos) End the fragment.endDelete(int pos) End the current deletion.insert(int position, SitemeshBufferFragment fragment) Insert the given fragment to the given position.Insert the given string fragment to the given position.markStart(int pos) Mark the start of the fragment.markStartDelete(int pos) Mark the start of a deletion.setBuffer(SitemeshBuffer sitemeshBuffer) Set the buffer.setLength(int length) Sets the length.setStart(int start) Sets the start.
-
Method Details
-
setStart
Sets the start.- Parameters:
start- the start- Returns:
- the builder
-
setLength
Sets the length.- Parameters:
length- the length- Returns:
- the builder
-
delete
Delete length characters from pos in this buffer fragment.- Parameters:
pos- The position to delete fromlength- The number of characters to delete- Returns:
- The builder
-
markStart
Mark the start of the fragment.- Parameters:
pos- The start of the fragment- Returns:
- The builder
-
end
End the fragment.- Parameters:
pos- The position of the end of the fragment- Returns:
- The builder
-
markStartDelete
Mark the start of a deletion.- Parameters:
pos- The position to start deleting from- Returns:
- The builder
- Throws:
IllegalStateException- If markStartDelete() has already been called and endDelete() hasn't been called
-
endDelete
End the current deletion.- Parameters:
pos- The position to delete to- Returns:
- The builder
- Throws:
IllegalStateException- If markStartDelete() hasn't been called
-
insert
Insert the given fragment to the given position.- Parameters:
position- The position to insert the fragment tofragment- The fragment to insert- Returns:
- The builder
-
insert
Insert the given string fragment to the given position.- Parameters:
position- The position to insert atfragment- The fragment to insert- Returns:
- The builder
-
setBuffer
Set the buffer. This resets both start and length to be that of the buffer.- Parameters:
sitemeshBuffer- The buffer to set.- Returns:
- The builder
-
build
Build the fragment.- Returns:
- The built fragment
-