org.asciidoctor.ast.Document Java Examples

The following examples show how to use org.asciidoctor.ast.Document. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WhenJavaExtensionIsRegistered.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Test
public void an_inline_macro_as_instance_extension_should_be_executed_when_regexp_is_set_as_option_inline_macro_is_detected() {

    JavaExtensionRegistry javaExtensionRegistry = this.asciidoctor.javaExtensionRegistry();

    Map<String, Object> options = new HashMap<>();
    options.put(InlineMacroProcessor.REGEXP, "man(?:page)?:(\\S+?)\\[(.*?)\\]");

    ManpageMacro inlineMacroProcessor = new ManpageMacro("man", options);
    javaExtensionRegistry.inlineMacro(inlineMacroProcessor);

    String content = asciidoctor.convertFile(
            classpath.getResource("sample-with-man-link.ad"),
            options().toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
    Element link = doc.getElementsByTag("a").first();
    assertNotNull(link);
    assertThat(link.attr("href"), is("gittutorial.html"));

    final List<LogRecord> logRecords = TestLogHandlerService.getLogRecords();
    assertThat(logRecords, hasSize(0));
}
 
Example #2
Source File: ObjectWrapper.java    From helidon-build-tools with Apache License 2.0 6 votes vote down vote up
@Override
public TemplateModel wrap(Object obj) throws TemplateModelException {
    if (obj == null) {
        return super.wrap(obj);
    }
    if (obj instanceof ContentNode) {
        return new ContentNodeHashModel(this, (ContentNode) obj);
    }
    if (obj instanceof RubyAttributesMapDecorator) {
        return new ContentNodeAttributesModel(this,
                (RubyAttributesMapDecorator) obj);
    }
    if (obj instanceof Document){
        return new SimpleObjectModel(obj);
    }
    return super.wrap(obj);
}
 
Example #3
Source File: TextConverter.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Override
public String convert(
        ContentNode node, String transform, Map<Object, Object> o) {  // <3>

    if (transform == null) {                                          // <4>
        transform = node.getNodeName();
    }

    if (node instanceof Document) {
        Document document = (Document) node;
        return document.getContent().toString();                      // <5>
    } else if (node instanceof Section) {
        Section section = (Section) node;
        return new StringBuilder()
                .append("== ").append(section.getTitle()).append(" ==")
                .append(LINE_SEPARATOR).append(LINE_SEPARATOR)
                .append(section.getContent()).toString();             // <5>
    } else if (transform.equals("paragraph")) {
        StructuralNode block = (StructuralNode) node;
        String content = (String) block.getContent();
        return new StringBuilder(content.replaceAll(LINE_SEPARATOR, " "))
                .append(LINE_SEPARATOR).toString();                   // <5>
    }
    return null;
}
 
Example #4
Source File: WhenJavaExtensionGroupIsRegistered.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Test
public void an_inline_macro_as_instance_extension_should_not_be_executed_when_regexp_is_set_and_does_not_match() {

    Map<String, Object> options = new HashMap<String, Object>();
    options.put(InlineMacroProcessor.REGEXP, "man(?:page)?:(ThisDoesNotMatch)\\[(.*?)\\]");

    ManpageMacro inlineMacroProcessor = new ManpageMacro("man", options);
    this.asciidoctor.createGroup()
        .inlineMacro(inlineMacroProcessor)
        .register();

    String content = asciidoctor.convertFile(
            classpath.getResource("sample-with-man-link.ad"),
            options().toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
    Element link = doc.getElementsByTag("a").first();
    assertNull(link);

    final List<LogRecord> logRecords = TestLogHandlerService.getLogRecords();
    assertThat(logRecords, hasSize(0));
}
 
Example #5
Source File: WhenJavaExtensionGroupIsRegistered.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Test
public void an_inline_macro_as_instance_extension_should_be_executed_when_regexp_is_set_as_option_inline_macro_is_detected() {

    Map<String, Object> options = new HashMap<String, Object>();
    options.put(InlineMacroProcessor.REGEXP, "man(?:page)?:(\\S+?)\\[(.*?)\\]");

    ManpageMacro inlineMacroProcessor = new ManpageMacro("man", options);
    this.asciidoctor.createGroup()
        .inlineMacro(inlineMacroProcessor)
        .register();

    String content = asciidoctor.convertFile(
            classpath.getResource("sample-with-man-link.ad"),
            options().toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
    Element link = doc.getElementsByTag("a").first();
    assertNotNull(link);
    assertThat(link.attr("href"), is("gittutorial.html"));

    final List<LogRecord> logRecords = TestLogHandlerService.getLogRecords();
    assertThat(logRecords, hasSize(0));
}
 
Example #6
Source File: WhenJavaExtensionIsRegistered.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Test
public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() {
    JavaExtensionRegistry javaExtensionRegistry = this.asciidoctor.javaExtensionRegistry();

    Map<String, Object> options = new HashMap<>();
    options.put("location", ":footer");
    MetaRobotsDocinfoProcessor metaRobotsDocinfoProcessor = new MetaRobotsDocinfoProcessor(options);

    javaExtensionRegistry.docinfoProcessor(metaRobotsDocinfoProcessor);

    String content = asciidoctor.convertFile(
            classpath.getResource("simple.adoc"),
            options().headerFooter(true).safe(SafeMode.SERVER).toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");

    Element footer = doc.getElementById("footer");
    // Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element
    assertTrue("robots".equals(footer.nextElementSibling().attr("name")));
}
 
Example #7
Source File: WhenJavaExtensionGroupIsRegistered.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Test
public void a_block_processor_should_be_executed_when_registered_block_is_found_in_document() throws IOException {

    this.asciidoctor.createGroup()
        .block("yell", YellStaticBlock.class)
        .register();
    String content = asciidoctor.convertFile(
            classpath.getResource("sample-with-yell-block.ad"),
            options().toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
    Elements elements = doc.getElementsByClass("paragraph");
    assertThat(elements.size(), is(1));
    assertThat(elements.get(0).text(), is("THE TIME IS NOW. GET A MOVE ON."));

}
 
Example #8
Source File: MediaContentComponent.java    From swagger2markup with Apache License 2.0 6 votes vote down vote up
@Override
public StructuralNode apply(StructuralNode node, MediaContentComponent.Parameters parameters) {
    Content content = parameters.content;
    if (content == null || content.isEmpty()) return node;

    DescriptionListImpl mediaContentList = new DescriptionListImpl(node);
    mediaContentList.setTitle(labels.getLabel(LABEL_CONTENT));

    content.forEach((type, mediaType) -> {
        DescriptionListEntryImpl tagEntry = new DescriptionListEntryImpl(mediaContentList, Collections.singletonList(new ListItemImpl(mediaContentList, type)));
        ListItemImpl tagDesc = new ListItemImpl(tagEntry, "");

        Document tagDescDocument = schemaComponent.apply(mediaContentList, mediaType.getSchema());
        mediaTypeExampleComponent.apply(tagDescDocument, mediaType.getExample());
        examplesComponent.apply(tagDescDocument, mediaType.getExamples());
        encodingComponent.apply(tagDescDocument, mediaType.getEncoding());
        tagDesc.append(tagDescDocument);

        tagEntry.setDescription(tagDesc);
        mediaContentList.addEntry(tagEntry);
    });
    node.append(mediaContentList);
    return node;
}
 
Example #9
Source File: WhenJavaExtensionGroupIsRegistered.java    From asciidoctorj with Apache License 2.0 6 votes vote down vote up
@Test
public void a_block_macro_extension_instance_should_be_executed_when_macro_is_detected() {

    this.asciidoctor.createGroup()
        .blockMacro(new GistMacro("gist", new HashMap<String, Object>()))
        .register();

    String content = asciidoctor.convertFile(
            classpath.getResource("sample-with-gist-macro.ad"),
            options().toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
    Element script = doc.getElementsByTag("script").first();

    assertThat(script.attr("src"), is("https://gist.github.com/123456.js"));
}
 
Example #10
Source File: CukedoctorFilterExtension.java    From cukedoctor with Apache License 2.0 6 votes vote down vote up
@Override
public String process(Document document, String output) {
    if (document.basebackend("html") && System.getProperty(FILTER_DISABLE_EXT_KEY) == null) {
        org.jsoup.nodes.Document doc = Jsoup.parse(output, "UTF-8");

        Elements sect1 = doc.getElementsByClass("sect1");
        if (!sect1.isEmpty()) {
            Element contentElement = doc.getElementsByClass("sect1").get(0);
            contentElement.before("<span style=\"float:right\">\n" +
                    "\t<input value=\"Filter...\" onclick=\"this.value=''\" title=\"Filter features by title\" onblur=\"searchFeature(this.value);\"/>\n" +
                    "</span>");
        }
        return doc.html();
    } else {
        return output;
    }
}
 
Example #11
Source File: CukedoctorScriptExtension.java    From cukedoctor with Apache License 2.0 6 votes vote down vote up
@Override
public String process(Document document, String output) {
    if (document.isBasebackend("html")) {
        org.jsoup.nodes.Document doc = Jsoup.parse(output, "UTF-8");

        Element contentElement = doc.getElementById("footer");
        if (contentElement == null) {
            return output;
        }
        if (System.getProperty(FILTER_DISABLE_EXT_KEY) == null) {
            addSearchScript(contentElement);
        }
        if (System.getProperty(MINMAX_DISABLE_EXT_KEY) == null) {
            addMinMaxScript(contentElement);
        }
        if (System.getProperty(THEME_DISABLE_EXT_KEY) == null) {
            addThemeScript(contentElement);
        }
        return doc.html();

    } else {
        return output;
    }
}
 
Example #12
Source File: BoldifyPostProcessor.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override public String process(Document document, String output) {
  if (document.isBasebackend("html")) {
    return output.replaceAll("bold", "<b>bold</b>");
  } else {
    return output;
  }
}
 
Example #13
Source File: WhenAsciiDocIsRenderedToDocument.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void should_return_options_from_document() {
    Map<String, Object> options = OptionsBuilder.options().compact(true).asMap();
    Document document = asciidoctor.load(DOCUMENT, options);

    Map<Object, Object> documentOptions = document.getOptions();

    assertThat((Boolean) documentOptions.get("compact"), is(true));
}
 
Example #14
Source File: LinkComponent.java    From swagger2markup with Apache License 2.0 5 votes vote down vote up
@Override
public Document apply(StructuralNode parent, LinkComponent.Parameters parameters) {
    DocumentImpl linksDocument = new DocumentImpl(parent);
    ParagraphBlockImpl linkParagraph = new ParagraphBlockImpl(linksDocument);

    Map<String, Link> links = parameters.links;
    if (null == links || links.isEmpty()) {
        linkParagraph.setSource(labels.getLabel(LABEL_NO_LINKS));
    } else {
        StringBuilder sb = new StringBuilder();
        links.forEach((name, link) -> {
            sb.append(name).append(" +").append(LINE_SEPARATOR);
            sb.append(italicUnconstrained(labels.getLabel(LABEL_OPERATION))).append(' ')
                    .append(italicUnconstrained(link.getOperationId())).append(" +").append(LINE_SEPARATOR);
            Map<String, String> linkParameters = link.getParameters();
            if (null != linkParameters && !linkParameters.isEmpty()) {
                sb.append(italicUnconstrained(labels.getLabel(LABEL_PARAMETERS))).append(" {").append(" +").append(LINE_SEPARATOR);
                linkParameters.forEach((param, value) ->
                        sb.append('"').append(param).append("\": \"").append(value).append('"').append(" +").append(LINE_SEPARATOR)
                );
                sb.append('}').append(" +").append(LINE_SEPARATOR);
            }
        });
        linkParagraph.setSource(sb.toString());
    }
    linksDocument.append(linkParagraph);
    return linksDocument;
}
 
Example #15
Source File: WhenAsciiDocIsRenderedToDocument.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void should_get_attributes() {

    final String documentWithAttributes = "= Document Title\n" +
        ":docattr: docvalue\n" +
        "\n" +
        "preamble\n" +
        "\n" +
        "== Section A\n" +
        "\n" +
        "paragraph\n" +
        "\n";

    Document document = asciidoctor.load(documentWithAttributes, new HashMap<String, Object>());
    List<StructuralNode> blocks = document.getBlocks();

    Section section = (Section) blocks.get(1);
    section.setAttribute("testattr", "testvalue", true);

    assertThat(document.hasAttribute("testattr"), is(false));

    assertThat(section.hasAttribute("testattr"), is(true));
    assertThat(section.hasAttribute("testattr", true), is(true));
    assertThat(section.hasAttribute("testattr", false), is(true));
    assertThat(section.isAttribute("testattr", "testvalue"), is(true));

    assertThat(section.hasAttribute("docattr", true), is(true));
    assertThat(section.hasAttribute("docattr", false), is(false));
}
 
Example #16
Source File: WhenAsciiDocIsRenderedToDocument.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void should_be_able_to_remove_role() {
    final String famousRole = "famous";
    Document document = asciidoctor.load(ROLE, new HashMap<String, Object>());
    StructuralNode abstractBlock = document.getBlocks().get(0);
    assertThat(abstractBlock.hasRole(famousRole), is(true));
    abstractBlock.removeRole(famousRole);
    assertThat(abstractBlock.hasRole(famousRole), is(false));
}
 
Example #17
Source File: HighlightJsWithOfflineStylesHighlighter.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public String getDocinfo(LocationType location, Document document, Map<String, Object> options) {
    if (document.hasAttribute("linkcss") && document.hasAttribute("copycss")) { // <2>
        return "<link rel=\"stylesheet\" href=\"github.min.css\">\n" +
            "<script src=\"highlight.min.js\"></script>\n" +
            "<script>hljs.initHighlighting()</script>";
    } else {
        return "<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/github.min.css\">\n" +
            "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js\"></script>\n" +
            "<script>hljs.initHighlighting()</script>";
    }
}
 
Example #18
Source File: RequireCheckerTreeprocessor.java    From asciidoctor-maven-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public Document process(Document document) {
  assertEquals("constant", JRubyRuntimeContext.get(document).evalScriptlet("defined? ::DateTime").toString());
  // Leave a trace in the converted document so that the test can check that I was called
  document.getBlocks().add(createBlock(document, "paragraph", RequireCheckerTreeprocessor.class.getSimpleName() + " was here"));
  return document;
}
 
Example #19
Source File: OpenAPI2MarkupConverter.java    From swagger2markup with Apache License 2.0 5 votes vote down vote up
private void writeToFile(Document document, Path path) {
    MarkupLanguage markupLanguage = openAPIContext.config.getMarkupLanguage();
    if (isMarkupLanguageSupported(markupLanguage)) {
        String fileExtension = markupLanguage.getFileNameExtensions().get(0);
        writeToFileWithoutExtension(document, path.resolveSibling(path.getFileName().toString() + fileExtension));
    } else {
        throw new RuntimeException("Given Markup language '"+markupLanguage+"' is not supported by "+getClass().getName());
    }
}
 
Example #20
Source File: WhenJavaExtensionGroupIsRegistered.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void a_docinfoprocessor_should_be_executed_and_add_meta_in_header_by_default() {
    asciidoctor.createGroup()
        .docinfoProcessor(MetaRobotsDocinfoProcessor.class.getCanonicalName())
        .register();

    String content = asciidoctor.convertFile(
            classpath.getResource("simple.adoc"),
            options().headerFooter(true).safe(SafeMode.SERVER).toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");

    Element metaRobots = doc.getElementsByAttributeValueContaining("name", "robots").first();
    assertThat(metaRobots, is(notNullValue()));
}
 
Example #21
Source File: WhenJavaExtensionIsRegistered.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void a_docinfoprocessor_should_be_executed_and_add_meta_in_header_by_default() {
    JavaExtensionRegistry javaExtensionRegistry = this.asciidoctor.javaExtensionRegistry();

    javaExtensionRegistry.docinfoProcessor(MetaRobotsDocinfoProcessor.class.getCanonicalName());

    String content = asciidoctor.convertFile(
            classpath.getResource("simple.adoc"),
            options().headerFooter(true).safe(SafeMode.SERVER).toFile(false).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");

    Element metaRobots = doc.getElementsByAttributeValueContaining("name", "robots").first();
    assertThat(metaRobots, is(notNullValue()));
}
 
Example #22
Source File: ComponentsDocument.java    From swagger2markup with Apache License 2.0 5 votes vote down vote up
private void appendComponentsSection(Document document, Components components) {
    if (null == components) return;

    Section componentsSection = new SectionImpl(document);
    componentsSection.setTitle(labels.getLabel(SECTION_TITLE_COMPONENTS));
    String componentSectionId = "_components";
    componentsSection.setId(componentSectionId);

    appendComponentsSchemasSection(componentsSection, componentSectionId, components.getSchemas());
    Map<String, Parameter> parameters = components.getParameters();
    if (null != parameters && !parameters.isEmpty()) {
        appendSubSection(componentsSection, componentSectionId, parametersComponent, SECTION_TITLE_PARAMETERS,
                new ParametersComponent.Parameters(parameters));
    }
    Map<String, ApiResponse> responses = components.getResponses();
    if (null != responses && !responses.isEmpty()) {
        appendSubSection(componentsSection, componentSectionId, responseComponent, SECTION_TITLE_RESPONSES,
                new ResponseComponent.Parameters(responses));
    }
    Map<String, Header> headers = components.getHeaders();
    if (null != headers && !headers.isEmpty()) {
        appendSubSection(componentsSection, componentSectionId, headersComponent, SECTION_TITLE_HEADERS,
                new HeadersComponent.Parameters(headers));
    }
    Map<String, Link> links = components.getLinks();
    if (null != links && !links.isEmpty()) {
        appendSubSection(componentsSection, componentSectionId, linkComponent, SECTION_TITLE_LINKS,
                new LinkComponent.Parameters(links));
    }
    document.append(componentsSection);
}
 
Example #23
Source File: ArrowsAndBoxesIncludesPostProcessor.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
public String process(Document doc, String output) {

        org.jsoup.nodes.Document document = Jsoup.parse(output);
        Element head = document.getElementsByTag("head").first();
        head.appendElement("link").attr("rel", "stylesheet").attr("type", "text/css").attr("href", "http://www.headjump.de/stylesheets/arrowsandboxes.css");
        head.appendElement("script").attr("type", "text/javascript").attr("src", "http://code.jquery.com/jquery-1.4.1.min.js");
        head.appendElement("script").attr("type", "text/javascript").attr("src", "http://www.headjump.de/javascripts/jquery_wz_jsgraphics.js");
        head.appendElement("script").attr("type", "text/javascript").attr("src", "http://www.headjump.de/javascripts/arrowsandboxes.js");
        
        return document.html();
    }
 
Example #24
Source File: SecurityDocument.java    From swagger2markup with Apache License 2.0 5 votes vote down vote up
@Override
public Document apply(Document document, SecurityDocument.Parameters parameters) {
    List<SecurityRequirement> securityRequirements = parameters.schema.getSecurity();
    if (null == securityRequirements || securityRequirements.isEmpty()) return document;

    Section securityRequirementsSection = new SectionImpl(document);
    securityRequirementsSection.setTitle(labels.getLabel(SECTION_TITLE_SECURITY));
    securityRequirementTableComponent.apply(securityRequirementsSection, securityRequirements, false);
    document.append(securityRequirementsSection);

    return document;
}
 
Example #25
Source File: CellImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public Document getInnerDocument() {
    IRubyObject innerDocument = getRubyProperty("inner_document");
    if (innerDocument.isNil()) {
        return null;
    }
    return (Document) NodeConverter.createASTNode(innerDocument);
}
 
Example #26
Source File: WhenAsciiDocIsRenderedToDocument.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void should_be_able_to_get_parent_from_document() {
    String s = "== A small Example\n" +
        "\n" +
        "Lorem ipsum dolor sit amet:\n";

    Document document = asciidoctor.load(s, new HashMap<String, Object>());
    assertNull(document.getParent());
}
 
Example #27
Source File: WhenJavaExtensionGroupIsRegistered.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void should_create_toc_with_treeprocessor() throws Exception {
    this.asciidoctor.createGroup()
        .treeprocessor(new Treeprocessor() {
            @Override
            public Document process(Document document) {
                List<StructuralNode> blocks=document.getBlocks();
                for (StructuralNode block : blocks) {
                    for (StructuralNode block2 : block.getBlocks()) {
                        if(block2 instanceof Section)
                            System.out.println(((Section) block2).getId());
                    }
                }
                return document;
            }
        })
        .register();

    String content = asciidoctor.convertFile(
            classpath.getResource("documentwithtoc.adoc"),
            options().headerFooter(true).toFile(false).safe(SafeMode.UNSAFE).get());

    org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");
    Element toc = doc.getElementById("toc");
    assertThat(toc, notNullValue());
    Elements elements = toc.getElementsByAttributeValue("href", "#TestId");
    assertThat(elements.size(), is(1));
}
 
Example #28
Source File: JRubyAsciidoctor.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public Document loadFile(File file, Map<String, Object> options) {
    RubyHash rubyHash = RubyHashUtil.convertMapToRubyHashWithSymbols(rubyRuntime, options);

    return (Document) NodeConverter.createASTNode(getAsciidoctorModule().callMethod("load_file",
            rubyRuntime.newString(file.getAbsolutePath()), rubyHash));
}
 
Example #29
Source File: WhenAsciiDocIsRenderedToDocument.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Test
public void should_be_able_to_get_reftext() {
    Document document = asciidoctor.load(REFTEXT, new HashMap<String, Object>());
    StructuralNode abstractBlock = document.getBlocks().get(0);
    assertThat(abstractBlock.getReftext(), is("the first section"));
    assertThat(abstractBlock.isReftext(), is(true));
}
 
Example #30
Source File: DummyPostprocessor.java    From asciidoctor-maven-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public String process(Document document, String output) {
    System.out.println("Processing "+ this.getClass().getSimpleName());
    System.out.println("Processing: blocks found: " + document.getBlocks().size());
    System.out.println("Processing: output size: " + output.length());
    return output;
}