|
Jive Forums API (5.5.20.2-oracle) Core Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.renderer.RenderedTextStore
public class RenderedTextStore
A store for text snippets. This is mainly to be used by filters and macros as a way to hide content from the renderer so that it will not be further processed.
A filter or macro uses this class by calling the addText method which will return a token that will be used to retrieve the text snippet from the store once all rendering is complete. The token should be inserted into the text stream in place of the added snippet by the filter/macro The RenderedContentStore associates blocks of rendered content (or Renderable objects that can later be transformed into rendered content) with tokens. These tokens can then be substituted for the content blocks during the rendering process. At the end of the chain of renderers, all tokens are replaced once more with their associated content blocks. Using this technique, it is possible to 'hide' content from the renderer, making it unnecessary to perform nasty hacks to prevent the output of macros or renderer components from being broken by subsequent rendering steps.
Constructor Summary | |
---|---|
RenderedTextStore()
|
Method Summary | |
---|---|
java.lang.String |
addText(java.lang.String text)
Add a text snippet to the store receiving a token in return. |
int |
getSize()
Returns the number of items in the store. |
java.lang.String |
getText(java.lang.String token)
Retrieve a text snippet from the store. |
java.util.Set |
getTokens()
Returns a list of all the tokens in the store. |
java.lang.String |
replaceTokens(java.lang.String text)
This method will replace all tokens in the provided string with their original text snippets. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RenderedTextStore()
Method Detail |
---|
public java.lang.String addText(java.lang.String text)
text
- the text snippet to add to the store
public java.lang.String getText(java.lang.String token)
token
- the token received when adding the text to the store
public int getSize()
public java.util.Set getTokens()
public java.lang.String replaceTokens(java.lang.String text)
text
- the string to replace all tokens within
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |