com.atlassian.confluence.macro
Class StreamableMacroAdapter

java.lang.Object
  extended by com.atlassian.confluence.macro.StreamableMacroAdapter
All Implemented Interfaces:
Macro, StreamableMacro

public abstract class StreamableMacroAdapter
extends java.lang.Object
implements 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
StreamableMacroAdapter()
           
 
Method Summary
 java.lang.String execute(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String body, ConversionContext context)
           
static java.lang.String executeFromStream(StreamableMacro macro, java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.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.StreamableMacro
executeToStream
 
Methods inherited from interface com.atlassian.confluence.macro.Macro
getBodyType, getOutputType
 

Constructor Detail

StreamableMacroAdapter

public StreamableMacroAdapter()
Method Detail

executeFromStream

public static java.lang.String executeFromStream(StreamableMacro macro,
                                                 java.util.Map<java.lang.String,java.lang.String> parameters,
                                                 java.lang.String body,
                                                 ConversionContext context)
                                          throws MacroExecutionException
Helper method to provide a default execute method for a StreamableMacro that can not inherit from this adapter class.

Parameters:
macro - the macro to execute
parameters - the macro parameters
body - the body of the macro
context - the execution context of the rendering pipeline
Returns:
the result of executing the macro
Throws:
MacroExecutionException - some error occurred executing the macro

execute

public java.lang.String execute(java.util.Map<java.lang.String,java.lang.String> parameters,
                                java.lang.String body,
                                ConversionContext context)
                         throws MacroExecutionException
Specified by:
execute in interface Macro
Throws:
MacroExecutionException


Copyright © 2003-2013 Atlassian. All Rights Reserved.