Package com.atlassian.confluence.macro
Interface StreamableMacro
-
- All Superinterfaces:
Macro
- All Known Implementing Classes:
StreamableMacroAdapter
public interface StreamableMacro extends Macro
Macro that consumes and produces Streamables instead of Strings. Streamable macros should be more efficient than a regular macro, especially in situations where the body of the macro is likely to be large, and processing on the body is either unnecessary or can be delayed until write time.Error handling: MacroExecutionExceptions thrown from
execute()
will be handled normally, and the macro output will be replaced with the appropriate error message. This service is not available to the streamable'swriteTo()
method. If an error is likely to occur during streaming of the output, the macro must handle processing and displaying the error itself.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.confluence.macro.Macro
Macro.BodyType, Macro.OutputType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Streamable
executeToStream(Map<String,String> parameters, Streamable body, ConversionContext context)
Execute the macro, and produce a streamable that represents its output.-
Methods inherited from interface com.atlassian.confluence.macro.Macro
execute, getBodyType, getOutputType
-
-
-
-
Method Detail
-
executeToStream
Streamable executeToStream(Map<String,String> parameters, Streamable body, ConversionContext context) throws MacroExecutionException
Execute the macro, and produce a streamable that represents its output.- Parameters:
parameters
- the parameters with which to execute the macrobody
- the body of the macro provided as a streamable, processed according toMacro.getBodyType()
context
- the conversion context of the current rendering pipeline- Returns:
- a streamable representing the macro output
- Throws:
MacroExecutionException
- if a processing, parsing or parameter validation error occurs during parsing- See Also:
Macro.execute(java.util.Map, String, com.atlassian.confluence.content.render.xhtml.ConversionContext)
-
-