org.xwiki.rendering.listener.WrappingListener.setWrappedListener()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.xwiki.rendering.listener.WrappingListener.setWrappedListener()方法的一些代码示例,展示了WrappingListener.setWrappedListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WrappingListener.setWrappedListener()方法的具体详情如下:
包路径:org.xwiki.rendering.listener.WrappingListener
类名称:WrappingListener
方法名:setWrappedListener

WrappingListener.setWrappedListener介绍

暂无

代码示例

代码示例来源:origin: org.xwiki.platform/xwiki-platform-wikistream-instance-oldcore

@Override
public void endWikiDocumentRevision(String version, FilterEventParameters parameters) throws WikiStreamException
{
  // Set content
  if (this.currentWikiPrinter != null) {
    this.document.setContent(this.currentWikiPrinter.getBuffer().toString());
    this.contentListener.setWrappedListener(null);
    this.currentWikiPrinter = null;
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-syntax-wikimodel

inlineFilterListener.setWrappedListener(listener);

代码示例来源:origin: org.xwiki.rendering/xwiki-rendering-syntax-wikimodel

/**
   * @since 6.0RC1
   * @since 5.4.5
   */
  public void parseInline(StreamParser parser, String content, Listener listener, boolean prefix)
    throws ParseException
  {
    if (prefix) {
      WrappingListener inlineFilterListener = new PrefixIgnoredInlineFilterListener();
      inlineFilterListener.setWrappedListener(listener);
      
      parser.parse(new StringReader("wikimarker " + content), inlineFilterListener);
    } else {
      WrappingListener inlineFilterListener = new InlineFilterListener();
      inlineFilterListener.setWrappedListener(listener);
      
      parser.parse(new StringReader(content), inlineFilterListener);
    }
  }
}

代码示例来源:origin: org.xwiki.rendering/xwiki-rendering-syntax-doxia

@Override
public void text(String text, SinkEventAttributes attributes)
{
  flushEmptyLines();
  if (this.isInVerbatim) {
    this.accumulatedText.append(text);
    return;
  }
  // TODO Handle parameters
  // Since Doxia doesn't generate events at the word level we need to reparse the
  // text to extract spaces, special symbols and words.
  // TODO: Use an inline parser. See https://jira.xwiki.org/browse/XWIKI-2748
  WrappingListener inlineFilterListener = new InlineFilterListener();
  inlineFilterListener.setWrappedListener(getListener());
  // Parse the text using the plain text parser
  try {
    this.plainParser.parse(new StringReader(text), inlineFilterListener);
  } catch (ParseException e) {
    // Shouldn't happen since we use a StringReader which shouldn't generate any IO.
    throw new RuntimeException("Failed to parse raw text [" + text + "]", e);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-annotation-core

inlineFilterListener.setWrappedListener(getListenerChain().getNextListener(getClass()));

代码示例来源:origin: org.xwiki.rendering/xwiki-rendering-tests

private void runTestInternal() throws Throwable
{
  WikiPrinter printer = new DefaultWikiPrinter();
  if (!this.streaming) {
    Parser parser = getComponentManager().lookup(Parser.class, this.parserId);
    XDOM xdom = parser.parse(new StringReader(this.input));
    if (this.runTransformations) {
      SyntaxFactory syntaxFactory = getComponentManager().lookup(SyntaxFactory.class);
      TransformationManager transformationManager = getComponentManager().lookup(TransformationManager.class);
      TransformationContext txContext =
        new TransformationContext(xdom, syntaxFactory.createSyntaxFromIdString(this.parserId));
      transformationManager.performTransformations(xdom, txContext);
    }
    BlockRenderer renderer = getComponentManager().lookup(BlockRenderer.class, this.targetSyntaxId);
    // remove source syntax from XDOM metadata
    Map<String, Object> metadataMap = new HashMap<String, Object>(xdom.getMetaData().getMetaData());
    metadataMap.remove(MetaData.SYNTAX);
    xdom = new XDOM(xdom.getChildren(), new MetaData(metadataMap));
    renderer.render(xdom, printer);
  } else {
    StreamParser parser = getComponentManager().lookup(StreamParser.class, this.parserId);
    PrintRendererFactory printRendererFactory =
      getComponentManager().lookup(PrintRendererFactory.class, this.targetSyntaxId);
    // remove source syntax from begin/endDocument metadata
    WrappingListener listener = new SyntaxWrappingListener();
    listener.setWrappedListener(printRendererFactory.createRenderer(printer));
    parser.parse(new StringReader(this.input), listener);
  }
  assertEquals(this.expected, printer.toString());
}

代码示例来源:origin: org.xwiki.rendering/xwiki-rendering-test

listener.setWrappedListener(streamRendererFactory.createRenderer(printer));

代码示例来源:origin: org.xwiki.platform/xwiki-platform-wikistream-instance-oldcore

this.contentListener.setWrappedListener(rendererFactory.createRenderer(this.currentWikiPrinter));

相关文章