Package com.opensymphony.module.sitemesh
Class SitemeshBufferFragment
java.lang.Object
com.opensymphony.module.sitemesh.SitemeshBufferFragment
A fragment of a sitemesh buffer. This includes a start and a length, and may contain a list of deleted sections of
the buffer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for fragments. -
Constructor Summary
ConstructorsConstructorDescriptionSitemeshBufferFragment(SitemeshBuffer buffer, int start, int length) Instantiates a new sitemesh buffer fragment.SitemeshBufferFragment(SitemeshBuffer buffer, int start, int length, TreeMap<Integer, Integer> deletions) Create a sitemesh buffer fragment. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Builder.builder(SitemeshBufferFragment fragment) Builder.intGets the length.intgetStart()Gets the start.Gets the string content.intGet the total length of the fragment, taking deletions and chained buffers of the buffer.toString()voidWrite the fragment to the given writer.
-
Constructor Details
-
SitemeshBufferFragment
Instantiates a new sitemesh buffer fragment.- Parameters:
buffer- the bufferstart- the startlength- the length
-
SitemeshBufferFragment
public SitemeshBufferFragment(SitemeshBuffer buffer, int start, int length, TreeMap<Integer, Integer> deletions) Create a sitemesh buffer fragment.- Parameters:
buffer- The buffer that this is a fragment ofstart- The start of the fragmentlength- The length of the fragmentdeletions- Deleted parts of the fragment, as a map of positions to the length to be deleted.
-
-
Method Details
-
writeTo
Write the fragment to the given writer.- Parameters:
writer- The writer to write the fragment to- Throws:
IOException- If an error occured
-
getTotalLength
public int getTotalLength()Get the total length of the fragment, taking deletions and chained buffers of the buffer.- Returns:
- The total length of the fragment
-
getStringContent
Gets the string content.- Returns:
- the string content
-
toString
-
getStart
public int getStart()Gets the start.- Returns:
- the start
-
getLength
public int getLength()Gets the length.- Returns:
- the length
-
builder
Builder.- Returns:
- the builder
-
builder
Builder.- Parameters:
fragment- the fragment- Returns:
- the builder
-