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

com.alphasystem.docbook.builder.impl.JavaScriptBasedBuilder Maven / Gradle / Ivy

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

import com.alphasystem.docbook.ScriptHandler;
import com.alphasystem.docbook.builder.Builder;
import com.alphasystem.docbook.model.FunctionInput;

import java.util.Collections;
import java.util.List;

public abstract class JavaScriptBasedBuilder extends BlockBuilder implements ScriptHandler {


    protected JavaScriptBasedBuilder(S source, Builder parent) {
        this("getContent", source, parent);
    }

    protected JavaScriptBasedBuilder(String childContentMethodName, S source, Builder parent) {
        super(childContentMethodName, source, parent);
    }

    protected abstract FunctionInput initFunctionInputs(List processedChildContent);

    protected T initTarget(List processedChildContent) {
        return execute(initFunctionInputs(processedChildContent));
    }

    @Override
    protected List doProcess(List processedChildContent) {
        return Collections.singletonList(initTarget(processedChildContent));
    }

}