Clover Coverage Report - XWiki Rendering - Parent POM 4.0-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Mar 12 2012 18:03:13 CET
0   78   0   -
0   12   -   0
0     -  
1    
 
  MacroManager       Line # 42 0 - 0 0 - -1.0
 
No Tests
 
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.rendering.macro;
21   
22    import java.util.Set;
23   
24    import org.xwiki.component.annotation.ComponentRole;
25    import org.xwiki.rendering.syntax.Syntax;
26   
27    /**
28    * Allow retrieving and test the existence of macros. Macros can be available for all syntaxes or only available for
29    * a given syntax.
30    *
31    * <p>
32    * Indeed, a macro can be registered and thus made available for all syntaxes or only available for a given syntax.
33    * The latter is useful for example if we want to support copy pasting wiki content from another wiki and we want to
34    * support transparently the macros defined in that content; in this case we could implement these macros only for that
35    * syntax and in the implementation make the bridge with XWiki macros for example.
36    * </p>
37    *
38    * @version $Id$
39    * @since 1.9M1
40    */
41    @ComponentRole
 
42    public interface MacroManager
43    {
44    /**
45    * @return all the available macros whether they are registered for a given syntax or for all syntaxes
46    * @throws MacroLookupException error when lookup macros
47    * @since 2.03M
48    */
49    Set<MacroId> getMacroIds() throws MacroLookupException;
50   
51    /**
52    * @param syntax the desired syntax
53    * @return the available macro ids for the desired syntax (this includes macros registered for all syntaxes and
54    * macros registered only for a given syntax)
55    * @throws MacroLookupException error when lookup macros
56    * @since 2.03M
57    */
58    Set<MacroId> getMacroIds(Syntax syntax) throws MacroLookupException;
59   
60    /**
61    * @param macroId the id of the macro to lookup
62    * @return the macro, looked-up first as a macro for the desired syntax identifier (if any is specified in the
63    * MacroId) and then as a macro registered for all syntaxes if not found
64    * @throws MacroLookupException when no macro with such id was found in both the list of macro for the specified
65    * syntax identifier and for all syntaxes
66    * @since 2.03M
67    */
68    Macro< ? > getMacro(MacroId macroId) throws MacroLookupException;
69   
70    /**
71    * @param macroId the id of the macro to lookup
72    * @return true if a macro with the given id and for the given syntax can be found (if any is specified in the
73    * MacroId), false otherwise. Returns false if a macro with the given id exists but has been registered
74    * only for all syntaxes
75    * @since 2.03M
76    */
77    boolean exists(MacroId macroId);
78    }