/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.rendering.block;

import java.util.List;

/**
 * Add a backward compatibility layer to the {@link Block} class.
 *
 * @version $Id$
 * @since 4.1M1
 */
public interface CompatibilityBlock
{
    /**
     * Recursively look at parents to find a block which inherits or is provided type.
     * <p>
     * The difference with {@link #getPreviousBlockByType(Class, boolean)} is that this one only look at parent when
     * {@link #getPreviousBlockByType(Class, boolean)} look at previous block in the same parent.
     *
     * @param <T> the class of the Blocks to return
     * @param blockClass the block class to look for
     * @return the found block, null if nothing is found
     * @since 1.9.1
     * @deprecated since 3.0M3 use {@link #getBlocks(BlockMatcher, Axes)} instead
     */
    @Deprecated
    <T extends Block> T getParentBlockByType(Class<T> blockClass);

    /**
     * Look upward to find a block which inherit or is provided type.
     * <p>
     * The difference with {@code #getParentBlockByType(Class)} is that this one look also at previous block in the same
     * parent when {@code #getParentBlockByType(Class)} only look at parents.
     *
     * @param <T> the class of the Blocks to return
     * @param blockClass the block class to look for
     * @param recurse if true also search in parents levels
     * @return the found block, null if nothing is found
     * @since 1.6M1
     * @deprecated since 3.0M3 use {@link #getBlocks(BlockMatcher, Axes)} instead
     */
    @Deprecated
    <T extends Block> T getPreviousBlockByType(Class<T> blockClass, boolean recurse);

    /**
     * Gets all the Blocks in the tree which are of the passed Block class.
     *
     * @param <T> the class of the Blocks to return
     * @param blockClass the block class to look for
     * @param recurse if true also search recursively children
     * @return all the matching blocks
     * @since 1.6M1
     * @deprecated since 3.0M3 use {@code #getBlocks(new ClassBlockMatcher(blockClass), Axes.DESCENDANT)} instead if
     *             {@code recurse} was true and {@code #getBlocks(new ClassBlockMatcher(blockClass), Axes.CHILD)}
     *             otherwise
     */
    @Deprecated
    <T extends Block> List<T> getChildrenByType(Class<T> blockClass, boolean recurse);
}

@@ -1639,32 +1639,37 @@
 .0M3 use %7B@link 
+Block
 #getBlocks(Block
@@ -1684,32 +1684,32 @@
  Axes)%7D instead%0A
-
      */%0A    @Dep
@@ -1902,20 +1902,20 @@
  with %7B@
-code
+link
  #getPar
@@ -2015,20 +2015,20 @@
  when %7B@
-code
+link
  #getPar
@@ -2359,24 +2359,29 @@
  use %7B@link 
+Block
 #getBlocks(B
@@ -2871,32 +2871,37 @@
 .0M3 use %7B@code 
+Block
 #getBlocks(new C
@@ -2955,19 +2955,16 @@
  instead
- if
 %0A     * 
@@ -2975,16 +2975,19 @@
         
+if 
 %7B@code r
@@ -3006,24 +3006,43 @@
 true and
+%0A     *            
  %7B@code 
 #getBloc
@@ -3033,16 +3033,21 @@
  %7B@code 
+Block
 #getBloc
@@ -3096,35 +3096,16 @@
 .CHILD)%7D
-%0A     *            
  otherwi

Fix javadoc