Interface TextExtractor


  • @Role
    public interface TextExtractor
    Component responsible for extracting plain text from inside a given String depending on the syntax associated with it. For example, the plain text could be extracted from inside an HTML content.

    Note that from an architecture POV, it's not possible to use XWiki Rendering's parsers and Plain Text Renderers since for example not all HTML content can be expressed into XDOM Block (e.g. FORM tags cannot) and thus we would lose content and not be able to annotate it.

    Since:
    13.10RC1
    Version:
    $Id: c39c2dacad59573db0958ab2d0dc87f9c44c63e6 $
    • Method Detail

      • extractText

        String extractText​(String content,
                           org.xwiki.rendering.syntax.Syntax syntax)
        Extract text from content considering the associated syntax.
        Parameters:
        content - the content from where to extract the text
        syntax - content specific syntax
        Returns:
        the plain text