001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package dev.metaschema.core.model;
007
008import dev.metaschema.core.model.util.ModuleUtils;
009import edu.umd.cs.findbugs.annotations.NonNull;
010
011/**
012 * A base class for a field definition defined globally within a Metaschema
013 * module.
014 *
015 * @param <MODULE>
016 *          the Java type of the containing module
017 * @param <INSTANCE>
018 *          the expected Java type of an instance of this definition
019 * @param <FLAG>
020 *          the expected Java type of flag children
021 */
022public abstract class AbstractGlobalFieldDefinition<
023    MODULE extends IModule,
024    INSTANCE extends IFieldInstance,
025    FLAG extends IFlagInstance>
026    extends AbstractGlobalDefinition<MODULE, INSTANCE>
027    implements IFieldDefinition, IFeatureContainerFlag<FLAG> {
028
029  /**
030   * Construct a new global field definition.
031   *
032   * @param module
033   *          the parent module containing this definition
034   */
035  protected AbstractGlobalFieldDefinition(@NonNull MODULE module) {
036    super(module, name -> ModuleUtils.parseModelName(module, name));
037  }
038}