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

com.alphasystem.docx4j.builder.wml.TblGridBaseBuilder Maven / Gradle / Ivy

There is a newer version: 0.5.5
Show newest version

package com.alphasystem.docx4j.builder.wml;

import java.util.List;
import com.alphasystem.docx4j.builder.OpenXmlBuilder;
import org.docx4j.wml.TblGridBase;
import org.docx4j.wml.TblGridCol;


/**
 * Fluent API builder for org.docx4j.wml.TblGridBase.
 * 
 */
public class TblGridBaseBuilder
    extends OpenXmlBuilder
{


    /**
     * Initialize the underlying object.
     * 
     */
    public TblGridBaseBuilder() {
        this(null);
    }

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public TblGridBaseBuilder(TblGridBase object) {
        super(object);
    }

    /**
     * Copies values fom src into target. Values of target will be overridden by the values from src.
     * 
     * @param src
     *     source object
     * @param target
     *     target object
     */
    public TblGridBaseBuilder(TblGridBase src, TblGridBase target) {
        this(target);
        if (src!= null) {
            List gridCol = src.getGridCol();
            for (TblGridCol o: gridCol) {
                addGridCol(new com.alphasystem.docx4j.builder.wml.TblGridColBuilder(o, null).getObject());
            }
        }
    }

    protected TblGridBase createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createTblGridBase();
    }

    public TblGridBaseBuilder addGridCol(TblGridCol... value) {
        addContent(object.getGridCol(), value);
        return this;
    }

    public TblGridBaseBuilder addGridCol(Long... w) {
        if (hasContent(w)) {
            for (Long o: w) {
                addGridCol(new com.alphasystem.docx4j.builder.wml.TblGridColBuilder().withW(o).getObject());
            }
        }
        return this;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy