1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.rendering.internal.parser.xwiki21

File XWiki21Parser.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
5
5
1
103
51
5
1
1
5
1

Classes

Class Line # Actions
XWiki21Parser 45 5 0% 5 0
1.0100%
 

Contributing tests

This file is covered by 122 tests. .

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.internal.parser.xwiki21;
21   
22    import javax.inject.Inject;
23    import javax.inject.Named;
24    import javax.inject.Singleton;
25   
26    import org.xwiki.component.annotation.Component;
27    import org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser;
28    import org.xwiki.rendering.internal.parser.wikimodel.XWikiGeneratorListener;
29    import org.xwiki.rendering.listener.Listener;
30    import org.xwiki.rendering.parser.ResourceReferenceParser;
31    import org.xwiki.rendering.syntax.Syntax;
32    import org.xwiki.rendering.util.IdGenerator;
33    import org.xwiki.rendering.wikimodel.IWikiParser;
34    import org.xwiki.rendering.wikimodel.xwiki.xwiki21.XWikiParser;
35   
36    /**
37    * Parses XWiki Syntax 2.1.
38    *
39    * @version $Id: 878c0099a83192620419a68cdc7ddfbdbc330cac $
40    * @since 2.5M2
41    */
42    @Component
43    @Named("xwiki/2.1")
44    @Singleton
 
45    public class XWiki21Parser extends AbstractWikiModelParser
46    {
47    /**
48    * @see #getLinkReferenceParser()
49    */
50    @Inject
51    @Named("link")
52    private ResourceReferenceParser linkReferenceParser;
53   
54    /**
55    * @see #getImageReferenceParser()
56    */
57    @Inject
58    @Named("image")
59    private ResourceReferenceParser imageReferenceParser;
60   
 
61  272988 toggle @Override
62    public Syntax getSyntax()
63    {
64  272997 return Syntax.XWIKI_2_1;
65    }
66   
 
67  272397 toggle @Override
68    public IWikiParser createWikiModelParser()
69    {
70  272406 return new XWikiParser();
71    }
72   
73    /**
74    * {@inheritDoc}
75    *
76    * @see org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser#getLinkReferenceParser()
77    * @since 2.5RC1
78    */
 
79  272396 toggle @Override
80    public ResourceReferenceParser getLinkReferenceParser()
81    {
82  272409 return this.linkReferenceParser;
83    }
84   
85    /**
86    * {@inheritDoc}
87    *
88    * @see org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser#getImageReferenceParser()
89    * @since 2.5RC1
90    */
 
91  272398 toggle @Override
92    public ResourceReferenceParser getImageReferenceParser()
93    {
94  272407 return this.imageReferenceParser;
95    }
96   
 
97  272405 toggle @Override
98    public XWikiGeneratorListener createXWikiGeneratorListener(Listener listener, IdGenerator idGenerator)
99    {
100  272402 return new XWiki21XWikiGeneratorListener(getLinkLabelParser(), listener, getLinkReferenceParser(),
101    getImageReferenceParser(), this.plainRendererFactory, idGenerator, getSyntax());
102    }
103    }