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

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


package com.alphasystem.docx4j.builder.wml;

import java.util.List;
import com.alphasystem.docx4j.builder.OpenXmlBuilder;


/**
 * Fluent API builder for org.docx4j.wml.P$Hyperlink.
 * 
 */
public class PHyperlinkBuilder
    extends OpenXmlBuilder
{


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

    /**
     * Initialize the builder with given object.
     * 
     * @param object
     *     the given object
     */
    public PHyperlinkBuilder(org.docx4j.wml.P.Hyperlink 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 PHyperlinkBuilder(org.docx4j.wml.P.Hyperlink src, org.docx4j.wml.P.Hyperlink target) {
        this(target);
        if (src!= null) {
            List content = src.getContent();
            for (Object o: content) {
                addContent(WmlBuilderFactory.cloneObject(o));
            }
            withTgtFrame(src.getTgtFrame()).withTooltip(src.getTooltip()).withDocLocation(src.getDocLocation()).withHistory(WmlBuilderFactory.cloneBoolean(src, "history")).withAnchor(src.getAnchor()).withId(src.getId());
        }
    }

    protected org.docx4j.wml.P.Hyperlink createObject() {
        return WmlBuilderFactory.OBJECT_FACTORY.createPHyperlink();
    }

    public PHyperlinkBuilder addContent(Object... value) {
        addContent(object.getContent(), value);
        return this;
    }

    public PHyperlinkBuilder withTgtFrame(String value) {
        if (value!= null) {
            object.setTgtFrame(value);
        }
        return this;
    }

    public PHyperlinkBuilder withTooltip(String value) {
        if (value!= null) {
            object.setTooltip(value);
        }
        return this;
    }

    public PHyperlinkBuilder withDocLocation(String value) {
        if (value!= null) {
            object.setDocLocation(value);
        }
        return this;
    }

    public PHyperlinkBuilder withHistory(Boolean value) {
        if (value!= null) {
            object.setHistory(value);
        }
        return this;
    }

    public PHyperlinkBuilder withAnchor(String value) {
        if (value!= null) {
            object.setAnchor(value);
        }
        return this;
    }

    public PHyperlinkBuilder withId(String value) {
        if (value!= null) {
            object.setId(value);
        }
        return this;
    }

}