io.legaldocml.business.builder.CoverPageBuilder Maven / Gradle / Ivy
The newest version!
package io.legaldocml.business.builder;
import io.legaldocml.akn.HasCoverPage;
import io.legaldocml.akn.element.CoverPage;
import io.legaldocml.business.builder.support.PSupport;
/**
* @author Jacques Militello
*/
public class CoverPageBuilder extends AbstractBusinessPartBuilder implements PSupport {
public CoverPageBuilder(BusinessBuilder builder) {
super(builder, new CoverPage());
if (!(builder.getAkomaNtoso().getDocumentType() instanceof HasCoverPage)) {
throw new BusinessBuilderException("DocumentType [" + builder.getAkomaNtoso().getDocumentType().getClass().getSimpleName() + "] has no CoverPage");
}
((HasCoverPage) builder.getAkomaNtoso().getDocumentType()).setCoverPage(parent());
}
}