io.legaldocml.akn.element.FRBRalias Maven / Gradle / Ivy
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.io.impl.Buffers;
import io.legaldocml.io.CharArray;
import io.legaldocml.io.XmlWriter;
import java.io.IOException;
import java.util.function.BiConsumer;
import static io.legaldocml.akn.element.Attributes.biConsumerString;
import static io.legaldocml.akn.util.XmlWriterHelper.writeName;
import static io.legaldocml.unsafe.UnsafeHelper.getFieldOffset;
/**
* The element FRBRalias is the metadata property containing additional well-known names of the document in the
* respective level of the FRBR hierarchy
*
*
* <xsd:element name="FRBRalias" type="valueType"/>
*
*
* @author Jacques Militello
*/
public final class FRBRalias extends ValueType implements Name {
/**
* XML Tag element name.
*/
public static final String ELEMENT = "FRBRalias";
/**
* Memory address.
*/
private static final long ADDRESS = Buffers.address(ELEMENT);
private static final ImmutableMap> ATTRIBUTES;
static {
ATTRIBUTES = ImmutableMap.>builder()
.putAll(ValueType.ATTRIBUTES)
.put(Name.ATTRIBUTE, biConsumerString(getFieldOffset(FRBRalias.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, 9);
if (writer.getVersion() >= 3) {
writeName(writer, this);
}
super.write(writer);
writer.writeEnd(ADDRESS, 9);
}
/**
* {@inheritDoc}
*/
@Override
public String name() {
return ELEMENT;
}
/**
* {@inheritDoc}
*/
@Override
public ImmutableMap> attributes() {
return ATTRIBUTES;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy