|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.renderer.RenderedContentStore
public class RenderedContentStore
Hides content from the renderer so that it will not be processed any further.
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.
Nested Class Summary | |
---|---|
static class |
RenderedContentStore.TokenType
|
Field Summary | |
---|---|
static String |
BLOCK_TOKEN
An unlikely-to-appear-in-real-text token, for use in block-replacement |
static String |
INLINE_TOKEN
An unlikely-to-appear-in-real-text token, for use in inline content replacement |
static String |
MAP_KEY
The key under which the store is placed in the render context |
Constructor Summary | |
---|---|
RenderedContentStore()
|
Method Summary | |
---|---|
String |
addBlock(Object content)
Put some content block into the store. |
String |
addContent(Object content,
RenderedContentStore.TokenType type)
Add content to the store. |
String |
addInline(Object content)
Put some inline content into the store. |
boolean |
equals(Object o)
|
Object |
get(String token)
Get some content back, given the entire token that was returned from a previous 'add' |
static RenderedContentStore |
getFromRenderContext(RenderContext renderContext)
Retrieve the store from the render context. |
int |
hashCode()
|
static String |
stripTokens(String text)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BLOCK_TOKEN
public static final String INLINE_TOKEN
public static final String MAP_KEY
Constructor Detail |
---|
public RenderedContentStore()
Method Detail |
---|
public static RenderedContentStore getFromRenderContext(RenderContext renderContext)
renderContext
- the render context to retrieve the store from
public String addContent(Object content, RenderedContentStore.TokenType type)
content
- the content to add to the storetype
- whether the content is RenderedContentStore.TokenType.INLINE
or RenderedContentStore.TokenType.BLOCK
. The token returned will
reflect this type.
public String addBlock(Object content)
content
- the content to add to the store
public String addInline(Object content)
content
- the content to add to the store
public Object get(String token)
token
- a token that was returned from a previous add
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static String stripTokens(String text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |