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

io.legaldocml.akn.element.Presentation Maven / Gradle / Ivy

package io.legaldocml.akn.element;

import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknAttributes;
import io.legaldocml.akn.attribute.Source;
import io.legaldocml.akn.type.AgentRef;
import io.legaldocml.io.CharArray;
import io.legaldocml.io.Externalizable;
import io.legaldocml.io.XmlWriter;
import io.legaldocml.io.impl.Buffers;

import java.io.IOException;
import java.util.function.BiConsumer;

import static io.legaldocml.akn.AknElements.PRESENTATION;
import static io.legaldocml.akn.element.Attributes.biConsumerAgentRef;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;

/**
 * The element presentation is a metadata container of any presentation specification for the visual rendering of Akoam
 * Ntoso elements. Anything can be placed in this element.
 *
 * 
 *   
 *     
 *       
 *         
 *           
 *         
 *       
 *     
 *   
 * 
* * @author Jacques Militello */ public final class Presentation extends AnyOtherType implements Source { /** * Memory address. */ private static final long ADDRESS_PRESENTATION = Buffers.address(PRESENTATION); private static final ImmutableMap> ATTRIBUTES; static { ATTRIBUTES = ImmutableMap.>builder() .put(AknAttributes.SOURCE, biConsumerAgentRef(getFieldOffset(Presentation.class, "source"))) .build(); } private AgentRef source; /** * {@inheritDoc} */ @Override public AgentRef getSource() { return this.source; } /** * {@inheritDoc} */ @Override public void setSource(AgentRef source) { this.source = source; } /** * {@inheritDoc} */ @Override public void write(XmlWriter writer) throws IOException { writer.writeStart(ADDRESS_PRESENTATION, 12); super.write(writer); writer.writeEnd(ADDRESS_PRESENTATION, 12); } /** * {@inheritDoc} */ @Override public String name() { return PRESENTATION; } /** * {@inheritDoc} */ @Override public ImmutableMap> attributes() { return ATTRIBUTES; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy