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

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

The newest version!
package io.legaldocml.akn.element;

import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknObject;
import io.legaldocml.akn.group.ANheaderInline;
import io.legaldocml.akn.type.RoleRef;
import io.legaldocml.io.AttributeGetterSetter;
import io.legaldocml.io.XmlWriter;
import io.legaldocml.io.impl.Buffers;

import java.io.IOException;

import static io.legaldocml.akn.AknAttributes.AS;
import static io.legaldocml.akn.AknElements.PARTY;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4RoleRef;
import static io.legaldocml.akn.util.XmlWriterHelper.writeRole;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;

/**
 * The element party is an inline element within judgments to identify where the document defines one of the parties.
 * 

*

 * 	 
 * 	   
 *       
 *         
 *           
 *         
 *       
 *     
 *   
 * 
* * @author Jacques Militello */ public final class Party extends InlineReqReqType implements io.legaldocml.akn.attribute.Role, ANheaderInline { /** * Memory address. */ private static final long ADDRESS_PARTY = Buffers.address(PARTY); private static final ImmutableMap> ATTRIBUTES; static { ATTRIBUTES = ImmutableMap.>builder() .putAll(InlineReqReqType.ATTRIBUTES) .put(AS, attributeGetterSetter4RoleRef(AS, getFieldOffset(Party.class, "as"))) .build(); } private RoleRef as; /** * {@inheritDoc} */ @Override public RoleRef getAs() { return this.as; } /** * {@inheritDoc} */ @Override public void setAs(RoleRef as) { this.as = as; } /** * {@inheritDoc} */ @Override public void write(XmlWriter writer) throws IOException { writer.writeStart(ADDRESS_PARTY, 5); writeRole(writer, this); super.write(writer); writer.writeEnd(ADDRESS_PARTY, 5); } /** * {@inheritDoc} */ @Override public String name() { return PARTY; } /** * {@inheritDoc} */ @Override public ImmutableMap> attributes() { return ATTRIBUTES; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy