com.alphasystem.docx4j.builder.wml.FldCharBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of open-xml-builder Show documentation
Show all versions of open-xml-builder Show documentation
Alpha system commons library
package com.alphasystem.docx4j.builder.wml;
import com.alphasystem.docx4j.builder.OpenXmlBuilder;
import org.docx4j.wml.CTFFData;
import org.docx4j.wml.CTTrackChangeNumbering;
import org.docx4j.wml.FldChar;
import org.docx4j.wml.STFldCharType;
import org.docx4j.wml.Text;
/**
* Fluent API builder for org.docx4j.wml.FldChar
.
*
*/
public class FldCharBuilder
extends OpenXmlBuilder
{
/**
* Initialize the underlying object.
*
*/
public FldCharBuilder() {
this(null);
}
/**
* Initialize the builder with given object.
*
* @param object
* the given object
*/
public FldCharBuilder(FldChar 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 FldCharBuilder(FldChar src, FldChar target) {
this(target);
if (src!= null) {
Text fldData = src.getFldData();
if (fldData!= null) {
fldData = new TextBuilder(fldData, object.getFldData()).getObject();
}
CTFFData ffData = src.getFfData();
if (ffData!= null) {
ffData = new CTFFDataBuilder(ffData, object.getFfData()).getObject();
}
CTTrackChangeNumbering numberingChange = src.getNumberingChange();
if (numberingChange!= null) {
numberingChange = new CTTrackChangeNumberingBuilder(numberingChange, object.getNumberingChange()).getObject();
}
withFldData(fldData).withFfData(ffData).withNumberingChange(numberingChange).withFldCharType(src.getFldCharType()).withFldLock(WmlBuilderFactory.cloneBoolean(src, "fldLock")).withDirty(WmlBuilderFactory.cloneBoolean(src, "dirty"));
}
}
protected FldChar createObject() {
return WmlBuilderFactory.OBJECT_FACTORY.createFldChar();
}
public FldCharBuilder withFldData(Text value) {
if (value!= null) {
object.setFldData(value);
}
return this;
}
public FldCharBuilder withFfData(CTFFData value) {
if (value!= null) {
object.setFfData(value);
}
return this;
}
public FldCharBuilder withNumberingChange(CTTrackChangeNumbering value) {
if (value!= null) {
object.setNumberingChange(value);
}
return this;
}
public FldCharBuilder withFldCharType(STFldCharType value) {
if (value!= null) {
object.setFldCharType(value);
}
return this;
}
public FldCharBuilder withFldLock(Boolean value) {
if (value!= null) {
object.setFldLock(value);
}
return this;
}
public FldCharBuilder withDirty(Boolean value) {
if (value!= null) {
object.setDirty(value);
}
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy