public class RenderedContentStore extends Object
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.
| Modifier and Type | Field and Description |
|---|---|
static String |
BLOCK_TOKEN
Deprecated.
|
static String |
INLINE_TOKEN
Deprecated.
|
static String |
MAP_KEY
The key under which the store is placed in the render context
|
| Constructor and Description |
|---|
RenderedContentStore() |
| Modifier and Type | Method and Description |
|---|---|
String |
addBlock(Object content)
Put some content block into the store.
|
String |
addContent(Object content,
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) |
public static final String BLOCK_TOKEN
TokenType.BLOCK.getTokenMarker()public static final String INLINE_TOKEN
TokenType.INLINE.getTokenMarker()public static final String MAP_KEY
public static RenderedContentStore getFromRenderContext(RenderContext renderContext)
renderContext - the render context to retrieve the store frompublic String addContent(Object content, TokenType type)
content - the content to add to the storetype - whether the content is TokenType.INLINE or TokenType.BLOCK. The token returned will
reflect this type.public String addBlock(Object content)
content - the content to add to the storepublic String addInline(Object content)
content - the content to add to the storepublic Object get(String token)
token - a token that was returned from a previous addCopyright © 2019 Atlassian. All rights reserved.