com.alphasystem.docbook.builder.impl.inline.LinkSupportBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docbook-2-docx Show documentation
Show all versions of docbook-2-docx Show documentation
Alpha system commons library
The newest version!
package com.alphasystem.docbook.builder.impl.inline;
import com.alphasystem.commons.util.AppUtil;
import com.alphasystem.docbook.ApplicationController;
import com.alphasystem.docbook.builder.Builder;
import com.alphasystem.docbook.builder.impl.InlineBuilder;
import com.alphasystem.docbook.util.Utils;
import com.alphasystem.docx4j.builder.wml.WmlAdapter;
import com.alphasystem.docx4j.builder.wml.WmlBuilderFactory;
import org.apache.commons.lang3.StringUtils;
import org.docx4j.wml.R;
import java.util.Collections;
import java.util.List;
import static com.alphasystem.docbook.handler.InlineHandlerFactory.HYPERLINK;
public abstract class LinkSupportBuilder extends InlineBuilder {
protected boolean external = false;
protected String href;
protected LinkSupportBuilder(String childContentMethodName, S source, Builder> parent) {
super(childContentMethodName, HYPERLINK, source, parent);
}
protected void initHref() {
href = (String) AppUtil.invokeMethod(source, "getLinkend");
if (StringUtils.isBlank(href)) {
href = (String) AppUtil.invokeMethod(source, "getHref");
external = StringUtils.isNotBlank(href) && !href.startsWith("#");
if (!external) {
href = href.substring(1);
}
}
}
protected R getLinkLabel(List