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

io.legaldocml.akn.element.QuotedStructureV3 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.For;
import io.legaldocml.akn.attribute.Quote;
import io.legaldocml.akn.type.EidRef;
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.END_QUOTE;
import static io.legaldocml.akn.AknAttributes.FOR;
import static io.legaldocml.akn.AknAttributes.INLINE_QUOTE;
import static io.legaldocml.akn.AknAttributes.START_QUOTE;
import static io.legaldocml.akn.AknElements.QUOTED_STRUCTURE;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4EidRef;
import static io.legaldocml.akn.element.Attributes.attributeGetterSetter4String;
import static io.legaldocml.akn.util.XmlWriterHelper.writeFor;
import static io.legaldocml.akn.util.XmlWriterHelper.writeQuote;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;

/**
 * the element quotedStructure is a subFlow element containing a full structure proposed as an insertion or a
 * replacement. Attribute quote is used to specify the quote character used in the original; no quote attribute implies
 * that the quote is left in the text; quote="" implies that there is no quote character. Attribute for is used in a
 * mmod or rmod to point to the eId of the corresponding ref element.
 * 

*

 *   
 *     
 *       
 *         
 *           
 *           
 *         
 *       
 *     
 *   
 * 
* * @author Jacques Militello */ public final class QuotedStructureV3 extends SubFlowStructure implements QuotedStructure, For, Quote { /** * Memory address. */ private static final long ADDRESS_QUOTED_STRUCTURE = Buffers.address(QUOTED_STRUCTURE); private static final ImmutableMap> ATTRIBUTES; static { ATTRIBUTES = ImmutableMap.>builder() .putAll(SubFlowStructure.ATTRIBUTES) .put(FOR, attributeGetterSetter4EidRef(FOR, getFieldOffset(QuotedStructureV3.class, "_for"))) .put(START_QUOTE, attributeGetterSetter4String(START_QUOTE, getFieldOffset(QuotedStructureV3.class, "startQuote"))) .put(END_QUOTE, attributeGetterSetter4String(END_QUOTE, getFieldOffset(QuotedStructureV3.class, "endQuote"))) .put(INLINE_QUOTE, attributeGetterSetter4String(INLINE_QUOTE, getFieldOffset(QuotedStructureV3.class, "inlineQuote"))) .build(); } private EidRef _for; private String startQuote; private String endQuote; private String inlineQuote; /** * {@inheritDoc} */ @Override public EidRef getFor() { return this._for; } /** * {@inheritDoc} */ @Override public void setFor(EidRef _for) { this._for = _for; } /** * {@inheritDoc} */ @Override public String getStartQuote() { return startQuote; } /** * {@inheritDoc} */ @Override public void setStartQuote(String startQuote) { this.startQuote = startQuote; } /** * {@inheritDoc} */ @Override public String getEndQuote() { return endQuote; } /** * {@inheritDoc} */ @Override public void setEndQuote(String endQuote) { this.endQuote = endQuote; } /** * {@inheritDoc} */ @Override public String getInlineQuote() { return inlineQuote; } /** * {@inheritDoc} */ @Override public void setInlineQuote(String inlineQuote) { this.inlineQuote = inlineQuote; } /** * {@inheritDoc} */ @Override public void write(XmlWriter writer) throws IOException { writer.writeStart(ADDRESS_QUOTED_STRUCTURE, 15); writeFor(writer, this); writeQuote(writer, this); super.write(writer); writer.writeEnd(ADDRESS_QUOTED_STRUCTURE, 15); } /** * {@inheritDoc} */ @Override public ImmutableMap> attributes() { return ATTRIBUTES; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy