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.AknObject;
import io.legaldocml.akn.attribute.Source;
import io.legaldocml.akn.type.AgentRef;
import io.legaldocml.io.impl.Buffers;
import io.legaldocml.io.CharArray;
import io.legaldocml.io.XmlWriter;

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

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.
 *
 * 
 *   <xsd:element name="presentation">
 *     <xsd:complexType>
 *       <xsd:complexContent>
 *         <xsd:extension base="anyOtherType">
 *           <xsd:attributeGroup ref="source"/>
 *         <xsd:extension>
 *       <xsd:complexContent>
 *     <xsd:complexType>
 *   <xsd:element>
 * 
* * @author Jacques Militello */ public final class Presentation extends AnyOtherType implements Source { /** * XML tag element name. */ public static final String ELEMENT = "presentation"; /** * Memory address. */ private static final long ADDRESS = Buffers.address(ELEMENT); private static final ImmutableMap> ATTRIBUTES; static { ATTRIBUTES = ImmutableMap.>builder() .put(Source.ATTRIBUTE, 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, 12); super.write(writer); writer.writeEnd(ADDRESS, 12); } /** * {@inheritDoc} */ @Override public String name() { return ELEMENT; } /** * {@inheritDoc} */ @Override public ImmutableMap> attributes() { return ATTRIBUTES; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy