|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.renderer.v2.macro.BaseMacro
com.atlassian.renderer.v2.macro.ResourceAwareMacroDecorator
public class ResourceAwareMacroDecorator
Field Summary |
---|
Fields inherited from interface com.atlassian.renderer.v2.macro.Macro |
---|
RAW_PARAMS_KEY |
Constructor Summary | |
---|---|
ResourceAwareMacroDecorator(Macro macro)
|
Method Summary | |
---|---|
String |
execute(Map parameters,
String body,
RenderContext renderContext)
Execute the macro. |
RenderMode |
getBodyRenderMode()
If the macro has a body, return the mode in which the body of the macro should be rendered. |
Macro |
getMacro()
|
String |
getResourcePath()
|
boolean |
hasBody()
Determine if the macro is a one-shot macro, or one that takes a body. |
boolean |
isInline()
Determine if the macro is an "inline" element in the resulting HTML. |
void |
setResourcePath(String resourcePath)
|
boolean |
suppressMacroRenderingDuringWysiwyg()
Suppress the rendering of the macro -- the macro's body may still be rendered (depending on the render mode of the macro), but the HTML the macro adds will not be created. |
boolean |
suppressSurroundingTagDuringWysiwygRendering()
Suppress surrounding div/span during Wysiwyg rendering. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResourceAwareMacroDecorator(Macro macro)
Method Detail |
---|
public String getResourcePath()
getResourcePath
in interface ResourceAware
public void setResourcePath(String resourcePath)
setResourcePath
in interface ResourceAware
public boolean isInline()
Macro
Most macros will want to return false here.
isInline
in interface Macro
public boolean hasBody()
Macro
hasBody
in interface Macro
public RenderMode getBodyRenderMode()
Macro
If this method returns null, it causes the macro processor to treat the macro as one that returns wiki-text rather than HTML. The body of the macro will be passed in un-rendered, and the macro's output will be inserted back into the page for further normal processing by the wiki-engine.
getBodyRenderMode
in interface Macro
public String execute(Map parameters, String body, RenderContext renderContext) throws MacroException
Macro
Macro.getBodyRenderMode()
).
Macros are expected to output HTML. The output of macros will not be subjected to any
further processing by the wiki-engine. If your macro produces wiki-text, you are responsible
for rendering that text to HTML yourself using a SubRenderer
or WikiStyleRenderer
. If your macro returns pure wiki-text, you
can force further processing in the normal chain by returning null from Macro.getBodyRenderMode()
execute
in interface Macro
parameters
- the parameters included in the macrobody
- the content of the body of the macrorenderContext
- the rendering context in which the macro was executed
MacroException
- if the macro fails in some unremarkable way. If the
macro fails in a way that is important to the server maintainer
(i.e. something is badly wrong), throw a RuntimeException instead.public Macro getMacro()
public boolean suppressSurroundingTagDuringWysiwygRendering()
Macro
suppressSurroundingTagDuringWysiwygRendering
in interface Macro
suppressSurroundingTagDuringWysiwygRendering
in class BaseMacro
public boolean suppressMacroRenderingDuringWysiwyg()
Macro
suppressMacroRenderingDuringWysiwyg
in interface Macro
suppressMacroRenderingDuringWysiwyg
in class BaseMacro
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |