Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
SplittingCriterion | 31 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.refactoring.splitter.criterion; | |
21 | ||
22 | import org.xwiki.refactoring.splitter.DocumentSplitter; | |
23 | import org.xwiki.rendering.block.Block; | |
24 | ||
25 | /** | |
26 | * An interface defining the office importer document splitting process. | |
27 | * | |
28 | * @version $Id: 8943594e2fd03dda36c4719492f539ac8d6d02e3 $ | |
29 | * @since 1.9M1 | |
30 | */ | |
31 | public interface SplittingCriterion | |
32 | { | |
33 | /** | |
34 | * Limits the recursive tree traversal performed by the {@link DocumentSplitter}. | |
35 | * | |
36 | * @param block current {@link Block} being traversed by the document splitter. | |
37 | * @param depth depth of this block w.r.t root of the main xdom being split. | |
38 | * @return true if the sub-tree rooted at this block should be traversed further. | |
39 | */ | |
40 | boolean shouldIterate(Block block, int depth); | |
41 | ||
42 | /** | |
43 | * Indicates if the sub-tree rooted at the given block should be split into a separate document. | |
44 | * | |
45 | * @param block current {@link Block} being traversed by the document splitter. | |
46 | * @param depth depth of this block w.r.t root of the main xdom being split. | |
47 | * @return true if the sub-tree rooted at this block should be split into a separate document. | |
48 | */ | |
49 | boolean shouldSplit(Block block, int depth); | |
50 | } |