io.legaldocml.akn.element.Session Maven / Gradle / Ivy
package io.legaldocml.akn.element;
import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknObject;
import io.legaldocml.akn.attribute.ValueOpt;
import io.legaldocml.akn.group.ANtitleInline;
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.writeOptValue;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;
/**
* The element session is an inline element within preface to identify the string used by the document for the session
* of the legislature relative to the document. Use #refersTo to a TLCEvent to refer to the event of the specific
* session.
*
*
* <xsd:element name="session">
* <xsd:complexType mixed="true">
* <xsd:complexContent>
* <xsd:extension base="inline">
* <xsd:attributeGroup ref="optvalue"/>
* <xsd:extension>
* <xsd:complexContent>
* <xsd:complexType>
* <xsd:element>
*
*
* @author Jacques Militello
*/
public final class Session extends InlineType implements ValueOpt, ANtitleInline {
/**
* XML tag element name.
*/
public static final String ELEMENT = "session";
/**
* Memory address.
*/
private static final long ADDRESS = Buffers.address(ELEMENT);
private static final ImmutableMap> ATTRIBUTES;
static {
ATTRIBUTES = ImmutableMap.>builder()
.putAll(InlineType.ATTRIBUTES)
.put("value", biConsumerString(getFieldOffset(Session.class, "value")))
.build();
}
private String value;
/**
* {@inheritDoc}
*/
@Override
public String getValue() {
return this.value;
}
/**
* {@inheritDoc}
*/
@Override
public void setValue(String value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public void write(XmlWriter writer) throws IOException {
writer.writeStart(ADDRESS, 7);
writeOptValue(writer, this);
super.write(writer);
writer.writeEnd(ADDRESS, 7);
}
/**
* {@inheritDoc}
*/
@Override
public String name() {
return ELEMENT;
}
/**
* {@inheritDoc}
*/
@Override
public ImmutableMap> attributes() {
return ATTRIBUTES;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy