Package com.atlassian.confluence.macro
Class StreamableMacroAdapter
java.lang.Object
com.atlassian.confluence.macro.StreamableMacroAdapter
- All Implemented Interfaces:
Macro
,StreamableMacro
Adapter for the
StreamableMacro
interface that provides a default implementation of the redundant
execute method. Also provides a static helper method for macros that are unable to extend the adapter due
to some other class constraints.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.confluence.macro.Macro
Macro.BodyType, Macro.OutputType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
executeFromStream
(StreamableMacro macro, Map<String, String> parameters, String body, ConversionContext context) Helper method to provide a default execute method for a StreamableMacro that can not inherit from this adapter class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.macro.Macro
getBodyType, getOutputType
Methods inherited from interface com.atlassian.confluence.macro.StreamableMacro
executeToStream
-
Constructor Details
-
StreamableMacroAdapter
public StreamableMacroAdapter()
-
-
Method Details
-
executeFromStream
public static String executeFromStream(StreamableMacro macro, Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionExceptionHelper method to provide a default execute method for a StreamableMacro that can not inherit from this adapter class.- Parameters:
macro
- the macro to executeparameters
- the macro parametersbody
- the body of the macrocontext
- the execution context of the rendering pipeline- Returns:
- the result of executing the macro
- Throws:
MacroExecutionException
- some error occurred executing the macro
-
execute
public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException- Specified by:
execute
in interfaceMacro
- Throws:
MacroExecutionException
-