All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alphasystem.docbook.builder.impl.block.ExampleBuilder Maven / Gradle / Ivy

The newest version!
package com.alphasystem.docbook.builder.impl.block;

import com.alphasystem.docbook.builder.Builder;
import com.alphasystem.docbook.builder.impl.JavaScriptBasedBuilder;
import com.alphasystem.docbook.model.FunctionInput;
import com.alphasystem.xml.UnmarshallerConstants;
import org.docbook.model.Example;
import org.docbook.model.Title;
import org.docx4j.wml.Tbl;

import java.util.List;

public class ExampleBuilder extends JavaScriptBasedBuilder {

    public ExampleBuilder(Example source, Builder parent) {
        super(source, parent);
    }

    @Override
    protected Title getTitle() {
        return (Title) source.getTitleContent().stream().filter(UnmarshallerConstants::isTitleType)
                .findFirst().orElse(null);
    }

    @Override
    protected FunctionInput initFunctionInputs(List processedChildContent) {
        return new FunctionInput<>(configurationUtils.getExampleFunctionName(), Tbl.class, new Object[]{processedChildContent});
    }
}