public static class SitemeshBufferFragment.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private DefaultSitemeshBuffer.Builder |
buffer |
private java.util.TreeMap<java.lang.Integer,java.lang.Integer> |
deletions |
private int |
length |
private int |
start |
private java.lang.Integer |
startDelete |
Modifier | Constructor and Description |
---|---|
private |
Builder() |
private |
Builder(SitemeshBufferFragment fragment) |
Modifier and Type | Method and Description |
---|---|
SitemeshBufferFragment |
build()
Build the fragment
|
SitemeshBufferFragment.Builder |
delete(int pos,
int length)
Delete length characters from pos in this buffer fragment
|
SitemeshBufferFragment.Builder |
end(int pos)
End the fragment
|
SitemeshBufferFragment.Builder |
endDelete(int pos)
End the current deletion
|
SitemeshBufferFragment.Builder |
insert(int position,
SitemeshBufferFragment fragment)
Insert the given fragment to the given position
|
SitemeshBufferFragment.Builder |
insert(int position,
java.lang.String fragment)
Insert the given string fragment to the given position
|
SitemeshBufferFragment.Builder |
markStart(int pos)
Mark the start of the fragment
|
SitemeshBufferFragment.Builder |
markStartDelete(int pos)
Mark the start of a deletion.
|
SitemeshBufferFragment.Builder |
setBuffer(SitemeshBuffer sitemeshBuffer)
Set the buffer.
|
SitemeshBufferFragment.Builder |
setLength(int length) |
SitemeshBufferFragment.Builder |
setStart(int start) |
private DefaultSitemeshBuffer.Builder buffer
private int start
private int length
private final java.util.TreeMap<java.lang.Integer,java.lang.Integer> deletions
private java.lang.Integer startDelete
private Builder()
private Builder(SitemeshBufferFragment fragment)
public SitemeshBufferFragment.Builder setStart(int start)
public SitemeshBufferFragment.Builder setLength(int length)
public SitemeshBufferFragment.Builder delete(int pos, int length)
pos
- The position to delete fromlength
- The number of characters to deletepublic SitemeshBufferFragment.Builder markStart(int pos)
pos
- The start of the fragmentpublic SitemeshBufferFragment.Builder end(int pos)
pos
- The position of the end of the fragmentpublic SitemeshBufferFragment.Builder markStartDelete(int pos)
pos
- The position to start deleting fromjava.lang.IllegalStateException
- If markStartDelete() has already been called and endDelete() hasn't been calledpublic SitemeshBufferFragment.Builder endDelete(int pos)
pos
- The position to delete tojava.lang.IllegalStateException
- If markStartDelete() hasn't been calledpublic SitemeshBufferFragment.Builder insert(int position, SitemeshBufferFragment fragment)
position
- The position to insert the fragment tofragment
- The fragment to insertpublic SitemeshBufferFragment.Builder insert(int position, java.lang.String fragment)
position
- The position to insert atfragment
- The fragment to insertpublic SitemeshBufferFragment.Builder setBuffer(SitemeshBuffer sitemeshBuffer)
sitemeshBuffer
- The buffer to set.public SitemeshBufferFragment build()