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

io.legaldocml.business.builder.element.InlineCMContainerBuilder Maven / Gradle / Ivy

The newest version!
package io.legaldocml.business.builder.element;

import io.legaldocml.akn.container.InlineCMContainer;
import io.legaldocml.akn.element.Inline;
import io.legaldocml.akn.element.StringInlineCM;
import io.legaldocml.akn.element.Sup;
import io.legaldocml.business.builder.AbstractBusinessPartBuilder;
import io.legaldocml.business.builder.BusinessBuilder;
import io.legaldocml.business.builder.BusinessPartBuilder;
import io.legaldocml.business.builder.group.ANinlineBuilder;
import io.legaldocml.business.builder.group.ANtitleInlineBuilder;
import io.legaldocml.business.builder.group.HTMLInlineBuilder;
import io.legaldocml.business.builder.group.MarkerElementsBuilder;
import io.legaldocml.business.builder.support.OrganizationSupport;
import io.legaldocml.business.util.AknReference;
import io.legaldocml.business.util.AknReferences;

/**
 * @author Jacques Militello
 */
public abstract class InlineCMContainerBuilder> extends AbstractBusinessPartBuilder
        implements ANtitleInlineBuilder, ANinlineBuilder, HTMLInlineBuilder, OrganizationSupport, MarkerElementsBuilder {

    private final T container;

    public InlineCMContainerBuilder(BusinessBuilder businessBuilder, T container) {
        super(businessBuilder, container);
        this.container = container;
    }

    @SuppressWarnings("unchecked")
    public U text(String text) {
        this.container.add(new StringInlineCM(text));
        return (U) this;
    }

    @SuppressWarnings("unchecked")
    public U sup() {
        Sup sup = new Sup();
        this.container.add(sup);
        return (U) this;
    }


    @SuppressWarnings("unchecked")
    public U inline(String name, AknReference... refs) {
        Inline inline = new Inline();
        this.container.add(inline);
        inline.setName(name);
        AknReferences.apply(getBusinessBuilder().getAkomaNtoso(), inline, refs);
        return (U) this;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy