org.xwiki.rendering.internal.parser.xhtml
Class XHTMLParser

java.lang.Object
  extended by org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser
      extended by org.xwiki.rendering.internal.parser.xhtml.XHTMLParser
All Implemented Interfaces:
WikiModelStreamParser, Parser, StreamParser
Direct Known Subclasses:
HTMLParser

@Component
@Named(value="xhtml/1.0")
@Singleton
public class XHTMLParser
extends AbstractWikiModelParser

Parses XHTML and generate a XDOM object.

Since:
1.5M2

Field Summary
 
Fields inherited from class org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser
plainRendererFactory
 
Constructor Summary
XHTMLParser()
           
 
Method Summary
 IWikiParser createWikiModelParser()
           
 XWikiGeneratorListener createXWikiGeneratorListener(Listener listener, IdGenerator idGenerator)
           
 ResourceReferenceParser getImageReferenceParser()
          
 StreamParser getLinkLabelParser()
           
 ResourceReferenceParser getLinkReferenceParser()
           
 Syntax getSyntax()
           
 
Methods inherited from class org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser
parse, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XHTMLParser

public XHTMLParser()
Method Detail

getSyntax

public Syntax getSyntax()
Returns:
the syntax the parser is implementing

getLinkLabelParser

public StreamParser getLinkLabelParser()
Overrides:
getLinkLabelParser in class AbstractWikiModelParser
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.
See Also:
XDOMGeneratorListener, wikimodel issue 87

createWikiModelParser

public IWikiParser createWikiModelParser()
                                  throws ParseException
Specified by:
createWikiModelParser in class AbstractWikiModelParser
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 ResourceReferenceParser getLinkReferenceParser()
Specified by:
getLinkReferenceParser in class AbstractWikiModelParser
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.

getImageReferenceParser

public ResourceReferenceParser getImageReferenceParser()

Specified by:
getImageReferenceParser in class AbstractWikiModelParser
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
See Also:
AbstractWikiModelParser.getImageReferenceParser()

createXWikiGeneratorListener

public XWikiGeneratorListener createXWikiGeneratorListener(Listener listener,
                                                           IdGenerator idGenerator)
Specified by:
createXWikiGeneratorListener in interface WikiModelStreamParser
Overrides:
createXWikiGeneratorListener in class AbstractWikiModelParser
Parameters:
listener - the XWiki listener to which to forward WikiModel events
idGenerator - unique id tool generator
Returns:
the XWiki Generator Listener instance corresponding to the parser (they need to be in sync)