org.xwiki.rendering.block
Interface CompatibilityBlock


public interface CompatibilityBlock

Add a backward compatibility layer to the Block class.

Since:
4.1M1
Version:
$Id: e7812f715e4ce3be411f0d3e889d42ad683595ff $

Method Summary
<T extends Block>
List<T>
getChildrenByType(Class<T> blockClass, boolean recurse)
          Deprecated. since 3.0M3 use #getBlocks(new ClassBlockMatcher(blockClass), Axes.DESCENDANT) instead if recurse was true and #getBlocks(new ClassBlockMatcher(blockClass), Axes.CHILD) otherwise
<T extends Block>
T
getParentBlockByType(Class<T> blockClass)
          Deprecated. since 3.0M3 use #getBlocks(BlockMatcher, Axes) instead
<T extends Block>
T
getPreviousBlockByType(Class<T> blockClass, boolean recurse)
          Deprecated. since 3.0M3 use #getBlocks(BlockMatcher, Axes) instead
 

Method Detail

getParentBlockByType

@Deprecated
<T extends Block> T getParentBlockByType(Class<T> blockClass)
Deprecated. since 3.0M3 use #getBlocks(BlockMatcher, Axes) instead

Recursively 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 when getPreviousBlockByType(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 use #getBlocks(BlockMatcher, Axes) instead

Look 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 when #getParentBlockByType(Class) only look at parents.

Type Parameters:
T - the class of the Blocks to return
Parameters:
blockClass - the block class to look for
recurse - 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 use #getBlocks(new ClassBlockMatcher(blockClass), Axes.DESCENDANT) instead if recurse was true and #getBlocks(new ClassBlockMatcher(blockClass), Axes.CHILD) otherwise

Gets 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 for
recurse - if true also search recursively children
Returns:
all the matching blocks
Since:
1.6M1


Copyright © 2004–2014 XWiki. All rights reserved.