Class HeadingLevelSplittingCriterion
- java.lang.Object
-
- org.xwiki.refactoring.splitter.criterion.HeadingLevelSplittingCriterion
-
- All Implemented Interfaces:
SplittingCriterion
public class HeadingLevelSplittingCriterion extends Object implements SplittingCriterion
ASplittingCriterion
based on the heading levels present in an xwiki document.- Since:
- 1.9M1
- Version:
- $Id: fd2e13e199969aa237ebc3a9c2befab2e3e74b7d $
-
-
Constructor Summary
Constructors Constructor Description HeadingLevelSplittingCriterion(int[] headingLevels)
Constructs a newHeadingLevelSplittingCriterion
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldIterate(org.xwiki.rendering.block.Block block, int depth)
Limits the recursive tree traversal performed by theDocumentSplitter
.boolean
shouldSplit(org.xwiki.rendering.block.Block block, int depth)
Indicates if the sub-tree rooted at the given block should be split into a separate document.
-
-
-
Constructor Detail
-
HeadingLevelSplittingCriterion
public HeadingLevelSplittingCriterion(int[] headingLevels)
Constructs a newHeadingLevelSplittingCriterion
.- Parameters:
headingLevels
- sorted array of heading levels (ascending)
-
-
Method Detail
-
shouldIterate
public boolean shouldIterate(org.xwiki.rendering.block.Block block, int depth)
Description copied from interface:SplittingCriterion
Limits the recursive tree traversal performed by theDocumentSplitter
.- Specified by:
shouldIterate
in interfaceSplittingCriterion
- Parameters:
block
- currentBlock
being traversed by the document splitter.depth
- depth of this block w.r.t root of the main xdom being split.- Returns:
- true if the sub-tree rooted at this block should be traversed further.
-
shouldSplit
public boolean shouldSplit(org.xwiki.rendering.block.Block block, int depth)
Description copied from interface:SplittingCriterion
Indicates if the sub-tree rooted at the given block should be split into a separate document.- Specified by:
shouldSplit
in interfaceSplittingCriterion
- Parameters:
block
- currentBlock
being traversed by the document splitter.depth
- depth of this block w.r.t root of the main xdom being split.- Returns:
- true if the sub-tree rooted at this block should be split into a separate document.
-
-