![JAR search and dependency download from the Maven repository](/logo.png)
io.legaldocml.akn.element.Legislature Maven / Gradle / Ivy
package io.legaldocml.akn.element;
import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.attribute.ValueOpt;
import io.legaldocml.akn.group.ANtitleInline;
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.LEGISLATURE;
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 legislature is an inline element within preface to identify the string used by the document for the
* legislature relative to the document. Use #refersTo to a TLCEvent to refer to the event of the specific legislature.
*
*
*
*
*
*
*
*
*
*
*
*
*
* @author Jacques Militello
*/
public final class Legislature extends InlineType implements ValueOpt, ANtitleInline {
/**
* Memory address.
*/
private static final long ADDRESS_LEGISLATURE = Buffers.address(LEGISLATURE);
private static final ImmutableMap> ATTRIBUTES;
static {
ATTRIBUTES = ImmutableMap.>builder()
.putAll(InlineType.ATTRIBUTES)
.put("value", biConsumerString(getFieldOffset(Legislature.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_LEGISLATURE, 11);
writeOptValue(writer, this);
super.write(writer);
writer.writeEnd(ADDRESS_LEGISLATURE, 11);
}
/**
* {@inheritDoc}
*/
@Override
public String name() {
return LEGISLATURE;
}
/**
* {@inheritDoc}
*/
@Override
public ImmutableMap> attributes() {
return ATTRIBUTES;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy