org.xwiki.rendering.internal.block
Class ProtectedBlockFilter
java.lang.Object
org.xwiki.rendering.internal.block.ProtectedBlockFilter
- All Implemented Interfaces:
- BlockFilter
public class ProtectedBlockFilter
- extends Object
- implements BlockFilter
Used to manipulate Blocks but by filtering out protected blocks.
Note: This API is a work in progress and currently a protected block is a code macro marker block. In the future we
need to make this more generic and since we also need to review Transformations to make them more performant this
class may go away which is why it's currently located in an internal package.
- Since:
- 2.6
- Version:
- $Id$
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProtectedBlockFilter
public ProtectedBlockFilter()
filter
public List<Block> filter(Block block)
- Filter provided block into zero or more block.
- Specified by:
filter in interface BlockFilter
- Parameters:
block - the block to filter.
- Returns:
- should never be null. The filtered blocks or empty list.
- See Also:
BlockFilter.filter(org.xwiki.rendering.block.Block)
filter
public List<Block> filter(List<Block> blocks)
- Parameters:
blocks - the blocks to filter
- Returns:
- the filtered blocks
getNextSibling
public Block getNextSibling(Block block)
- Parameters:
block - the block to filter out
- Returns:
- the next sibling that is not a protected block or null if not found
getChildrenByType
public <T extends Block> List<T> getChildrenByType(Block block,
Class<T> blockClass,
boolean recurse)
- Type Parameters:
T - the class of the Blocks to return- Parameters:
block - the block to filter outblockClass - the type of Blocks to look forrecurse - if true also search recursively children
- Returns:
- the filtered blocks matching the passed Block class
Copyright © 2004-2011 XWiki. All Rights Reserved.