io.legaldocml.akn.element.AuthorialNote Maven / Gradle / Ivy
The newest version!
package io.legaldocml.akn.element;
import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknAttributes;
import io.legaldocml.akn.AknObject;
import io.legaldocml.akn.attribute.Notes;
import io.legaldocml.akn.group.ANsubFlow;
import io.legaldocml.akn.type.EidRef;
import io.legaldocml.akn.type.PlacementType;
import io.legaldocml.akn.visitor.AknVisitor;
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.AknElements.AUTHORIAL_NOTE;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4EidRef;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4Enum;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4String;
import static io.legaldocml.akn.util.XmlWriterHelper.writeNotes;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;
/**
* the element authorialNote is a subFlow element containing an authorial (non-editorial) note in the main flow of the
* text.
*
*
*
*
*
*
*
*
*
*
*
*
*/
public final class AuthorialNote extends SubFlowStructure implements Notes, ANsubFlow {
/**
* Memory address.
*/
private static final long ADDRESS = Buffers.address(AUTHORIAL_NOTE);
private static final ImmutableMap> ATTRIBUTES;
static {
ATTRIBUTES = ImmutableMap.>builder()
.putAll(SubFlowStructure.ATTRIBUTES)
.put(AknAttributes.MARKER, attributeGetterSetter4String(AknAttributes.MARKER, getFieldOffset(AuthorialNote.class, "marker")))
.put(AknAttributes.PLACEMENT_BASE, attributeGetterSetter4EidRef(AknAttributes.PLACEMENT_BASE, getFieldOffset(AuthorialNote.class, "placementBase")))
.put(AknAttributes.PLACEMENT, attributeGetterSetter4Enum(AknAttributes.PLACEMENT, getFieldOffset(AuthorialNote.class, "placement"), PlacementType.class))
.build();
}
private String marker;
private PlacementType placement;
private EidRef placementBase;
/**
* {@inheritDoc}
*/
@Override
public String getMarker() {
return this.marker;
}
/**
* {@inheritDoc}
*/
@Override
public void setMarker(String marker) {
this.marker = marker;
}
/**
* {@inheritDoc}
*/
@Override
public PlacementType getPlacement() {
return this.placement;
}
/**
* {@inheritDoc}
*/
@Override
public void setPlacement(PlacementType placement) {
this.placement = placement;
}
/**
* {@inheritDoc}
*/
@Override
public EidRef getPlacementBase() {
return this.placementBase;
}
/**
* {@inheritDoc}
*/
@Override
public void setPlacementBase(EidRef placementBase) {
this.placementBase = placementBase;
}
/**
* {@inheritDoc}
*/
@Override
public void write(XmlWriter writer) throws IOException {
writer.writeStart(ADDRESS, 13);
writeNotes(writer, this);
super.write(writer);
writer.writeEnd(ADDRESS, 13);
}
/**
* {@inheritDoc}
*/
@Override
public String name() {
return AUTHORIAL_NOTE;
}
/**
* {@inheritDoc}
*/
@Override
public ImmutableMap> attributes() {
return ATTRIBUTES;
}
/**
* {@inheritDoc}
*/
@Override
public void accept(AknVisitor visitor) {
if (visitor.visitEnter(this)) {
super.accept(visitor);
visitor.visitLeave(this);
}
}
}