1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.macro

File MacroContentParser.java

 

Code metrics

0
0
0
1
74
15
0
-
-
0
-

Classes

Class Line # Actions
MacroContentParser 35 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

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 org.xwiki.component.annotation.Role;
23    import org.xwiki.rendering.block.XDOM;
24    import org.xwiki.rendering.listener.MetaData;
25    import org.xwiki.rendering.syntax.Syntax;
26    import org.xwiki.rendering.transformation.MacroTransformationContext;
27   
28    /**
29    * Parses content of a macro field (parameter, macro content) in a given syntax.
30    *
31    * @version $Id: c0299272c20a2db1fa973492e2d0f3bff51725b8 $
32    * @since 3.3M1
33    */
34    @Role
 
35    public interface MacroContentParser
36    {
37    /**
38    * Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level
39    * paragraph.
40    *
41    * @param content the content to parse
42    * @param macroContext the executing Macro context (from which to get the current syntax, etc)
43    * @param transform if true then executes transformations
44    * @param inline whether the content should be parsed as inline content (not top level paragraph, etc)
45    * @return the result as a {@link org.xwiki.rendering.block.Block}s
46    * @throws MacroExecutionException in case of a parsing error
47    */
48    XDOM parse(String content, MacroTransformationContext macroContext, boolean transform, boolean inline)
49    throws MacroExecutionException;
50   
51    /**
52    * Parses content of a macro field (parameter, macro content) in a given syntax and optionally remove the top level
53    * paragraph.
54    *
55    * @param content the content to parse
56    * @param macroContext the executing Macro context (from which to get the current syntax, etc)
57    * @param transform if true then executes transformations
58    * @param metadata the metadata to add to the XDOM before executing transformations
59    * @param inline whether the content should be parsed as inline content (not top level paragraph, etc)
60    * @return the result as a {@link org.xwiki.rendering.block.Block}s
61    * @throws MacroExecutionException in case of a parsing error
62    * @since 6.4
63    */
64    XDOM parse(String content, MacroTransformationContext macroContext, boolean transform, MetaData metadata,
65    boolean inline) throws MacroExecutionException;
66   
67    /**
68    * Find the current syntax to use for macro supporting wiki content/parameters/whatever.
69    *
70    * @param context the macro execution context containing the default syntax and the current macro block
71    * @return the current syntax
72    */
73    Syntax getCurrentSyntax(MacroTransformationContext context);
74    }