Package org.xwiki.rendering.block
Interface CompatibilityBlock
-
public interface CompatibilityBlock
Add a backward compatibility layer to theBlock
class.- Since:
- 4.1M1
- Version:
- $Id: f4030390fadc9b6a41fcc89804ea52781c0584c2 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T extends Block>
List<T>getChildrenByType(Class<T> blockClass, boolean recurse)
Deprecated.since 3.0M3 useBlock#getBlocks(new ClassBlockMatcher(blockClass), Axes.DESCENDANT)
instead ifrecurse
was true andBlock#getBlocks(new ClassBlockMatcher(blockClass), Axes.CHILD)
otherwise<T extends Block>
TgetParentBlockByType(Class<T> blockClass)
Deprecated.since 3.0M3 useBlock.getBlocks(BlockMatcher, Axes)
instead<T extends Block>
TgetPreviousBlockByType(Class<T> blockClass, boolean recurse)
Deprecated.since 3.0M3 useBlock.getBlocks(BlockMatcher, Axes)
instead
-
-
-
Method Detail
-
getParentBlockByType
@Deprecated <T extends Block> T getParentBlockByType(Class<T> blockClass)
Deprecated.since 3.0M3 useBlock.getBlocks(BlockMatcher, Axes)
insteadRecursively look at parents to find a block which inherits or is provided type.The difference with
getPreviousBlockByType(Class, boolean)
is that this one only look at parent whengetPreviousBlockByType(Class, boolean)
look at previous block in the same parent.- Type Parameters:
T
- the class of the Blocks to return- Parameters:
blockClass
- the block class to look for- Returns:
- the found block, null if nothing is found
- Since:
- 1.9.1
-
getPreviousBlockByType
@Deprecated <T extends Block> T getPreviousBlockByType(Class<T> blockClass, boolean recurse)
Deprecated.since 3.0M3 useBlock.getBlocks(BlockMatcher, Axes)
insteadLook upward to find a block which inherit or is provided type.The difference with
getParentBlockByType(Class)
is that this one look also at previous block in the same parent whengetParentBlockByType(Class)
only look at parents.- Type Parameters:
T
- the class of the Blocks to return- Parameters:
blockClass
- the block class to look forrecurse
- if true also search in parents levels- Returns:
- the found block, null if nothing is found
- Since:
- 1.6M1
-
getChildrenByType
@Deprecated <T extends Block> List<T> getChildrenByType(Class<T> blockClass, boolean recurse)
Deprecated.since 3.0M3 useBlock#getBlocks(new ClassBlockMatcher(blockClass), Axes.DESCENDANT)
instead ifrecurse
was true andBlock#getBlocks(new ClassBlockMatcher(blockClass), Axes.CHILD)
otherwiseGets all the Blocks in the tree which are of the passed Block class.- Type Parameters:
T
- the class of the Blocks to return- Parameters:
blockClass
- the block class to look forrecurse
- if true also search recursively children- Returns:
- all the matching blocks
- Since:
- 1.6M1
-
-