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

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

There is a newer version: 0.5.5
Show newest version

package com.alphasystem.docx4j.builder.wml;

import java.math.BigInteger;
import java.util.List;
import org.docx4j.wml.DocDefaults;
import org.docx4j.wml.Style;
import org.docx4j.wml.Styles;


/**
 * Fluent API builder for org.docx4j.wml.Styles.
 * 
 */
public class StylesBuilder
    extends com.alphasystem.docx4j.builder.OpenXmlBuilder
{

    private StylesBuilder.LatentStylesBuilder latentStylesBuilder;

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

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public StylesBuilder(Styles object) {
        super(object);
        latentStylesBuilder = new StylesBuilder.LatentStylesBuilder(this.object.getLatentStyles());
    }

    /**
     * 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 StylesBuilder(Styles src, Styles target) {
        this(target);
        if (src!= null) {
            DocDefaults docDefaults = src.getDocDefaults();
            if (docDefaults!= null) {
                docDefaults = new DocDefaultsBuilder(docDefaults, object.getDocDefaults()).getObject();
            }
            Styles.LatentStyles latentStyles = src.getLatentStyles();
            if (latentStyles!= null) {
                latentStyles = new StylesBuilder.LatentStylesBuilder(latentStyles, object.getLatentStyles()).getObject();
            }
            List