org.xwiki.rendering.internal.parser.wikimodel
Class AbstractWikiModelParser
java.lang.Object
org.xwiki.component.logging.AbstractLogEnabled
org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser
- All Implemented Interfaces:
- org.xwiki.component.phase.LogEnabled, WikiModelStreamParser, Parser, StreamParser
- Direct Known Subclasses:
- WikiModelConfluenceParser, WikiModelCreoleParser, WikiModelJspWikiParser, WikiModelMediaWikiParser, WikiModelXHTMLParser, WikiModelXWiki20Parser, WikiModelXWiki21Parser
public abstract class AbstractWikiModelParser
- extends org.xwiki.component.logging.AbstractLogEnabled
- implements Parser, WikiModelStreamParser
Common code for all WikiModel-based parsers.
- Since:
- 1.5M2
- Version:
- $Id$
Methods inherited from class org.xwiki.component.logging.AbstractLogEnabled |
enableLogging, getLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xwiki.rendering.parser.Parser |
getSyntax |
plainRendererFactory
@Requirement(value="plain/1.0")
protected PrintRendererFactory plainRendererFactory
- Used by the XWiki Generator Listener to generate unique header ids.
AbstractWikiModelParser
public AbstractWikiModelParser()
createWikiModelParser
public abstract org.wikimodel.wem.IWikiParser createWikiModelParser()
throws ParseException
- Returns:
- the WikiModel parser instance to use to parse input content.
- Throws:
ParseException
- when there's a problem creating an instance of the parser to use
getLinkReferenceParser
public abstract ResourceReferenceParser getLinkReferenceParser()
- Returns:
- the parser to use when parsing link references. We need to parse link references to transform them from
a string representation coming from WikiModel into a
ResourceReference
object. - Since:
- 2.5RC1
getImageReferenceParser
public abstract ResourceReferenceParser getImageReferenceParser()
- Returns:
- the parser to use when parsing image references. We need to parse image references to transform them from
a string representation coming from WikiModel into a
ResourceReference
object. - Since:
- 2.5RC1
getLinkLabelParser
protected StreamParser getLinkLabelParser()
- Returns:
- the syntax parser to use for parsing link labels, since wikimodel does not support wiki syntax in links
and they need to be handled in the
XWikiGeneratorListener
. By default, the link label parser is
the same one as the source parser (this), but you should overwrite this method if you need to use a
special parser. - Since:
- 2.1RC1
- See Also:
XDOMGeneratorListener
,
wikimodel issue 87
parse
public XDOM parse(java.io.Reader source)
throws ParseException
-
- Specified by:
parse
in interface Parser
- Throws:
ParseException
- See Also:
Parser.parse(Reader)
parse
public void parse(java.io.Reader source,
Listener listener)
throws ParseException
-
- Specified by:
parse
in interface StreamParser
- Throws:
ParseException
- See Also:
StreamParser.parse(java.io.Reader, org.xwiki.rendering.listener.Listener)
createXWikiGeneratorListener
public XWikiGeneratorListener createXWikiGeneratorListener(Listener listener,
IdGenerator idGenerator)
-
- Specified by:
createXWikiGeneratorListener
in interface WikiModelStreamParser
- Parameters:
listener
- the XWiki listener to which to forward WikiModel eventsidGenerator
- unique id tool generator
- Returns:
- the XWiki Generator Listener instance corresponding to the parser (they need to be in sync)
- See Also:
WikiModelStreamParser.createXWikiGeneratorListener(Listener, IdGenerator)
Copyright © 2004-2011 XWiki. All Rights Reserved.