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

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

package io.legaldocml.akn.element;

import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknObject;
import io.legaldocml.akn.attribute.Name;
import io.legaldocml.akn.group.SpeechSection;
import io.legaldocml.akn.visitor.AknVisitor;
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.biConsumerString;
import static io.legaldocml.akn.util.XmlWriterHelper.writeName;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;

/**
 * This element is a generic structural container for all other parts of a debates that are not explicitly supported
 * with a named element.
 *
 * 
 *   <xsd:element name="debateSection">
 * 	   <xsd:complexType>
 * 	     <xsd:complexContent>
 * 		   <xsd:extension base="althierarchy">
 * 		     <xsd:attributeGroup ref="name"/>
 * 		   <xsd:extension>
 * 		 <xsd:complexContent>
 * 	   <xsd:complexType>
 *   <xsd:element>
 * 
* * @author Jacques Militello */ public final class DebateSection extends AltHierarchy implements Name, SpeechSection { /** * XML Tag element name. */ public static final String ELEMENT = "debateSection"; /** * Memory address. */ private static final long ADDRESS = Buffers.address(ELEMENT); private static final ImmutableMap> ATTRIBUTES; static { ATTRIBUTES = ImmutableMap.>builder() .putAll(AltHierarchy.ATTRIBUTES) .put(Name.ATTRIBUTE, biConsumerString(getFieldOffset(DebateSection.class, "name"))) .build(); } private String name; /** * {@inheritDoc} */ public String getName() { return this.name; } /** * {@inheritDoc} */ public void setName(String name) { this.name = name; } /** * {@inheritDoc} */ @Override public void write(XmlWriter writer) throws IOException { writer.writeStart(ADDRESS, 13); writeName(writer, this); super.write(writer); writer.writeEnd(ADDRESS, 13); } /** * {@inheritDoc} */ @Override public String name() { return ELEMENT; } /** * {@inheritDoc} */ @Override public ImmutableMap> attributes() { return ATTRIBUTES; } /** * {@inheritDoc} */ @Override public void accept(AknVisitor visitor) { if (visitor.visitEnter(this)) { super.accept(visitor); visitor.visitLeave(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy