Codota Logo
XDOM.traverse
Code IndexAdd Codota to your IDE (free)

How to use
traverse
method
in
org.xwiki.rendering.block.XDOM

Best Java code snippets using org.xwiki.rendering.block.XDOM.traverse (Showing top 3 results out of 315)

  • Common ways to obtain XDOM
private void myMethod () {
XDOM x =
  • Codota IconParser parser;String s;parser.parse(new StringReader(s))
  • Codota IconXDOMGeneratorListener xDOMGeneratorListener;xDOMGeneratorListener.getXDOM()
  • Smart code suggestions by Codota
}
origin: org.xwiki.rendering/xwiki-rendering-test

/**
 * @param blocks the Blocks to assert
 * @param factory the Renderer Factory to use to serialize the passed Block
 * @return The serialized block.
 * @since 4.2M1
 */
private static String render(List<Block> blocks, PrintRendererFactory factory)
{
  // Assert the result by parsing it through the EventsRenderer to generate easily
  // assertable events.
  XDOM dom = new XDOM(blocks);
  WikiPrinter printer = new DefaultWikiPrinter();
  PrintRenderer eventRenderer = factory.createRenderer(printer);
  dom.traverse(eventRenderer);
  return printer.toString();
}
origin: org.xwiki.platform/xwiki-platform-annotation-core

@Override
public String getAnnotatedRenderedContent(String sourceReference, String sourceSyntax, String outputSyntax,
  Collection<Annotation> annotations) throws AnnotationServiceException
{
  try {
    XDOM xdom = targetIoService.getXDOM(sourceReference, sourceSyntax);
    // build the annotations renderer hint for the specified output syntax
    String outputSyntaxId = "annotations-" + outputSyntax;
    AnnotationPrintRenderer annotationsRenderer =
      componentManager.getInstance(AnnotationPrintRenderer.class, outputSyntaxId);
    WikiPrinter printer = new DefaultWikiPrinter();
    annotationsRenderer.setPrinter(printer);
    // set the annotations for this renderer
    annotationsRenderer.setAnnotations(annotations);
    xdom.traverse(annotationsRenderer);
    return printer.toString();
  } catch (Exception exc) {
    throw new AnnotationServiceException(exc);
  }
}
origin: org.xwiki.platform/xwiki-platform-annotation-maintainer

/**
 * Helper method to render the plain text version of the passed content.
 *
 * @param content the content to render in plain text
 * @param syntaxId the source syntax of the content to render
 * @throws Exception if anything goes wrong while rendering the content
 * @return the normalized plain text rendered content
 */
private String renderPlainText(String content, String syntaxId) throws Exception
{
  PrintRenderer renderer = componentManager.getInstance(PrintRenderer.class, "normalizer-plain/1.0");
  // parse
  Parser parser = componentManager.getInstance(Parser.class, syntaxId);
  XDOM xdom = parser.parse(new StringReader(content));
  // run transformations -> although it's going to be at least strange to handle rendered content since there
  // is no context
  Syntax sourceSyntax = Syntax.valueOf(syntaxId);
  TransformationManager transformationManager = componentManager.getInstance(TransformationManager.class);
  transformationManager.performTransformations(xdom, sourceSyntax);
  // render
  WikiPrinter printer = new DefaultWikiPrinter();
  renderer.setPrinter(printer);
  xdom.traverse(renderer);
  return printer.toString();
}
org.xwiki.rendering.blockXDOMtraverse

Popular methods of XDOM

  • getChildren
  • <init>
  • getMetaData
  • getBlocks
  • clone
  • getChildrenByType
  • setIdGenerator
  • addChild
  • getFirstBlock
  • getParameters
  • indexOf
  • replaceChild
  • indexOf,
  • replaceChild,
  • setChildren

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • IsNull (org.hamcrest.core)
    Is the value null?
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now