|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.renderer.RenderContext
public class RenderContext
Encapsulates the context in which some piece of content is being rendered. The RenderContext is initialised by the renderer, and passed through every RendererComponent.
Components may manipulate the RenderContext - for example to change the render mode before passing the context to some sub-component, but all components must ensure that they return the context to its original state before passing control back to the Renderer.
The RenderContext also holds a reference to the RenderedContentStore
that is to be used throughout
the rendering process.
RenderedContentStore
Field Summary |
---|
Fields inherited from interface com.atlassian.renderer.RenderContextOutputType |
---|
DISPLAY, EMAIL, FEED, HTML_EXPORT, PDF, PREVIEW, WORD |
Constructor Summary | |
---|---|
|
RenderContext()
Construct a new render context in a default state. |
protected |
RenderContext(RenderedContentStore store)
The Confluence PageContext needs this so that sub-rendered pages can inherit the RenderedContentStore of their parents. |
Method Summary | |
---|---|
void |
addExternalReference(Link link)
|
void |
addParam(Object key,
Object value)
|
String |
addRenderedContent(Object content)
Convenience method so people don't have to keep retrieving the renderedcontentstore. |
String |
addRenderedContent(Object content,
RenderedContentStore.TokenType type)
Convenience method so people don't have to keep retrieving the renderedcontentstore, but can still report whether their content is a block or inline fragment. |
boolean |
equals(Object o)
|
String |
getAttachmentsPath()
|
String |
getBaseUrl()
Retrieve the confluence instances base url, useful when generating absolute references. |
String |
getCharacterEncoding()
|
EmbeddedResourceRenderer |
getEmbeddedResourceRenderer()
Retrieve the embedded resource renderer for this rendering run. |
List<Link> |
getExternalReferences()
|
String |
getImagePath()
Get the URL path to the image directory for this rendering. |
LinkRenderer |
getLinkRenderer()
Retrieve the link renderer for this rendering run |
String |
getOutputType()
Returns the output type that is configured for the PageContext |
Object |
getParam(Object key)
|
Map<Object,Object> |
getParams()
|
RenderedContentStore |
getRenderedContentStore()
Get this rendering's RenderedContentStore |
RenderMode |
getRenderMode()
Get the current render mode. |
String |
getSiteRoot()
Get the root URL of the site on which the rendering is occurring |
int |
hashCode()
|
boolean |
isRenderingForWysiwyg()
|
RenderMode |
popRenderMode()
Return to the render mode that was current before pushRenderMode(com.atlassian.renderer.v2.RenderMode) was last called |
void |
pushRenderMode(RenderMode renderMode)
Push a new RenderMode onto the stack. |
void |
setAttachmentsPath(String attachmentsPath)
|
void |
setBaseUrl(String baseUrl)
|
void |
setCharacterEncoding(String characterEncoding)
|
void |
setEmbeddedResourceRenderer(EmbeddedResourceRenderer renderer)
Set the embedded resource renderer for this rendering run. |
void |
setImagePath(String imagePath)
Set the URL path to the image directory for this rendering. |
void |
setLinkRenderer(LinkRenderer linkRenderer)
Set the link renderer for this rendering run (exports might need different link rendering behaviour, for example); |
void |
setOutputType(String outputType)
|
void |
setRenderingForWysiwyg(boolean renderingForWysiwyg)
|
void |
setSiteRoot(String siteRoot)
Set the root URL of the site on which the rendering is occurring. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RenderContext()
protected RenderContext(RenderedContentStore store)
Method Detail |
---|
public RenderMode getRenderMode()
public void pushRenderMode(RenderMode renderMode)
getRenderMode()
. If you call this method, you must also call
popRenderMode()
once you have completed the operation that requires the new mode.
renderMode
- the new current render modepublic RenderMode popRenderMode()
pushRenderMode(com.atlassian.renderer.v2.RenderMode)
was last called
public RenderedContentStore getRenderedContentStore()
public String addRenderedContent(Object content)
content
- the content to store
public String addRenderedContent(Object content, RenderedContentStore.TokenType type)
content
- the content to storetype
- should be RenderedContentStore.TokenType.INLINE
if the content is an inline fragment of markup,
or RenderedContentStore.TokenType.BLOCK
if it is a block level fragment such as a paragraph.
element such as a paragraph.
public String getImagePath()
public void setImagePath(String imagePath)
imagePath
- the URL path to the root of the image directory. No trailing "/".public void setSiteRoot(String siteRoot)
siteRoot
- the root URL of the site on which the rendering is occurringpublic String getSiteRoot()
public void setLinkRenderer(LinkRenderer linkRenderer)
linkRenderer
- the link renderer to use for this runpublic LinkRenderer getLinkRenderer()
public void setEmbeddedResourceRenderer(EmbeddedResourceRenderer renderer)
public EmbeddedResourceRenderer getEmbeddedResourceRenderer()
public String getAttachmentsPath()
public void setAttachmentsPath(String attachmentsPath)
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void setBaseUrl(String baseUrl)
public String getBaseUrl()
public boolean isRenderingForWysiwyg()
public void setRenderingForWysiwyg(boolean renderingForWysiwyg)
public void addExternalReference(Link link)
public List<Link> getExternalReferences()
public String getCharacterEncoding()
public void setCharacterEncoding(String characterEncoding)
public Map<Object,Object> getParams()
public void addParam(Object key, Object value)
public Object getParam(Object key)
public String getOutputType()
RenderContextOutputType
public void setOutputType(String outputType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |