Class CounterBlockMatcher

java.lang.Object
org.xwiki.rendering.block.match.CounterBlockMatcher
All Implemented Interfaces:
BlockMatcher

public class CounterBlockMatcher extends Object implements BlockMatcher
Implementation of BlockMatcher which match any Block with the provided class.
Since:
10.10RC1
Version:
$Id: 00e8c5819c658c08bb5a3604984468cc9b06b3d5 $
  • Constructor Details

    • CounterBlockMatcher

      public CounterBlockMatcher()
      Count all blocks.
    • CounterBlockMatcher

      public CounterBlockMatcher(Block stopBlock)
      Find the index of the passed block.
      Parameters:
      stopBlock - the block where to stop counting
  • Method Details

    • match

      public boolean match(Block block)
      Description copied from interface: BlockMatcher
      True if the provided block is matched.
      Specified by:
      match in interface BlockMatcher
      Parameters:
      block - the block to match
      Returns:
      true if the provided block is matched, false otherwise
    • getCount

      public long getCount()
      Returns:
      the count