Package org.xwiki.rendering.block
Class MacroBlock
- java.lang.Object
-
- org.xwiki.rendering.block.AbstractBlock
-
- org.xwiki.rendering.block.AbstractMacroBlock
-
- org.xwiki.rendering.block.MacroBlock
-
public class MacroBlock extends AbstractMacroBlock
Represents a Macro (standalone or inline) defined in a page.Note: You can get macro parameters using
AbstractBlock.getParameters()
for example. Macro block is reusing Block standard custom parameters API since macro by definition already have parameters and don't need also block parameters. So in this case MacroBlock parameters and Block parameters are the same thing.- Since:
- 1.8M2
- Version:
- $Id: 7d323433124ae72fd49076eb0e96b057bed18e09 $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.xwiki.rendering.block.Block
Block.Axes
-
-
Field Summary
-
Fields inherited from interface org.xwiki.rendering.block.Block
LIST_BLOCK_TYPE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
traverse(Listener listener)
Let the block sendListener
events corresponding to its content.-
Methods inherited from class org.xwiki.rendering.block.AbstractMacroBlock
equals, getContent, getId, hashCode, isInline
-
Methods inherited from class org.xwiki.rendering.block.AbstractBlock
addChild, addChildren, after, before, clone, clone, getBlocks, getChildren, getFirstBlock, getNextSibling, getParameter, getParameters, getParent, getPreviousSibling, getRoot, indexOf, insertChildAfter, insertChildBefore, removeBlock, replaceChild, replaceChild, setChildren, setNextSiblingBlock, setParameter, setParameters, setParent, setPreviousSiblingBlock
-
-
-
-
Constructor Detail
-
MacroBlock
public MacroBlock(String id, Map<String,String> parameters, boolean isInline)
- Parameters:
id
- the id of the macroparameters
- the parameters of the macroisInline
- indicate if the macro is located in a inline content (like paragraph, etc.)
-
MacroBlock
public MacroBlock(String id, Map<String,String> parameters, String content, boolean isInline)
- Parameters:
id
- the id of the macroparameters
- the parameters of the macrocontent
- the content of the macro. Null if the macro does not have contentisInline
- indicate if the macro is located in a inline content (like paragraph, etc.)
-
-
Method Detail
-
traverse
public void traverse(Listener listener)
Description copied from interface:Block
Let the block sendListener
events corresponding to its content. For example a Paragraph block will send theListener.beginParagraph(java.util.Map<java.lang.String, java.lang.String>)
andListener.endParagraph(java.util.Map<java.lang.String, java.lang.String>)
events when this method is called.- Specified by:
traverse
in interfaceBlock
- Overrides:
traverse
in classAbstractBlock
- Parameters:
listener
- the listener to which to send the events to.
-
-