![JAR search and dependency download from the Maven repository](/logo.png)
io.legaldocml.akn.element.Proprietary Maven / Gradle / Ivy
package io.legaldocml.akn.element;
import com.google.common.collect.ImmutableMap;
import io.legaldocml.akn.AknAttributes;
import io.legaldocml.akn.attribute.Source;
import io.legaldocml.akn.type.AgentRef;
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.PROPRIETARY;
import static io.legaldocml.akn.element.Attributes.biConsumerAgentRef;
import static io.legaldocml.akn.util.XmlWriterHelper.writeSource;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;
/**
* The element proprietary is a metadata container of any additional metadata property that does not belong to the Akoma
* Ntoso properties. Anything can be placed in this element.
*
*
*
*
*
*
*
*
*
*
*
*
*
* @author Jacques Militello
*/
public final class Proprietary extends AnyOtherType implements Source {
/**
* Memory address.
*/
private static final long ADDRESS_PROPRIETARY = Buffers.address(PROPRIETARY);
private static final ImmutableMap> ATTRIBUTES;
static {
ATTRIBUTES = ImmutableMap.>builder()
.putAll(AnyOtherType.ATTRIBUTES)
.put(AknAttributes.SOURCE, biConsumerAgentRef(getFieldOffset(Proprietary.class, "source")))
.build();
}
private AgentRef source;
/**
* {@inheritDoc}
*/
public AgentRef getSource() {
return this.source;
}
/**
* {@inheritDoc}
*/
public void setSource(AgentRef source) {
this.source = source;
}
/**
* {@inheritDoc}
*/
@Override
public void write(XmlWriter writer) throws IOException {
writer.writeStart(ADDRESS_PROPRIETARY, 11);
writeSource(writer, this);
super.write(writer);
writer.writeEnd(ADDRESS_PROPRIETARY, 11);
}
/**
* {@inheritDoc}
*/
@Override
public String name() {
return PROPRIETARY;
}
/**
* {@inheritDoc}
*/
@Override
public ImmutableMap> attributes() {
return ATTRIBUTES;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy