001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.core.model;
007
008/**
009 * Represents a field instance within an assembly definition.
010 * <p>
011 * A field instance references a field definition and specifies how that field
012 * is used within its containing assembly, including XML wrapping behavior.
013 */
014public interface IFieldInstance extends IField, INamedModelInstance, IValuedInstance {
015  /**
016   * The default value for whether a field is wrapped in XML.
017   */
018  boolean DEFAULT_FIELD_IN_XML_WRAPPED = true;
019
020  /**
021   * Retrieves the field definition referenced by this instance.
022   *
023   * @return the field definition
024   */
025  @Override
026  IFieldDefinition getDefinition();
027
028  /**
029   * Determines if the field is configured to have a wrapper in XML.
030   *
031   * @return {@code true} if an XML wrapper is required, or {@code false}
032   *         otherwise
033   * @see #DEFAULT_FIELD_IN_XML_WRAPPED
034   */
035  default boolean isInXmlWrapped() {
036    return DEFAULT_FIELD_IN_XML_WRAPPED;
037  }
038}