io.legaldocml.akn.element.SubFlow 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.attribute.Name;
import io.legaldocml.akn.group.SubFlowElements;
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.NAME;
import static io.legaldocml.akn.AknElements.SUB_FLOW;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4String;
import static io.legaldocml.akn.util.XmlWriterHelper.writeName;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;
/**
* The element subFlow is a generic element for a subFlow.
*
*
*
*
*
*
*
*
*
*
*
*
*
* @author Jacques Militello
*/
public final class SubFlow extends SubFlowStructure implements SubFlowElements, Name {
/**
* Memory address.
*/
private static final long ADDRESS_SUB_FLOW = Buffers.address(SUB_FLOW);
private static final ImmutableMap> ATTRIBUTES;
static {
ATTRIBUTES = ImmutableMap.>builder()
.putAll(SubFlowStructure.ATTRIBUTES)
.put(NAME, attributeGetterSetter4String(NAME, getFieldOffset(SubFlow.class, "name")))
.build();
}
private String name;
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.name;
}
/**
* {@inheritDoc}
*/
@Override
public void setName(String name) {
this.name = name;
}
/**
* {@inheritDoc}
*/
@Override
public void write(XmlWriter writer) throws IOException {
writer.writeStart(ADDRESS_SUB_FLOW, 7);
writeName(writer, this);
super.write(writer);
writer.writeEnd(ADDRESS_SUB_FLOW, 7);
}
/**
* {@inheritDoc}
*/
@Override
public String name() {
return SUB_FLOW;
}
/**
* {@inheritDoc}
*/
@Override
public ImmutableMap> attributes() {
return ATTRIBUTES;
}
}