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 an assembly 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 * @param <MODEL>
022 *          the expected Java type of model children
023 * @param <NAMED_MODEL>
024 *          the expected Java type of named model children
025 * @param <FIELD>
026 *          the expected Java type of field children
027 * @param <ASSEMBLY>
028 *          the expected Java type of assembly children
029 * @param <CHOICE>
030 *          the expected Java type of choice children
031 * @param <CHOICE_GROUP>
032 *          the expected Java type of choice group children
033 */
034public abstract class AbstractGlobalAssemblyDefinition<
035    MODULE extends IModule,
036    INSTANCE extends IAssemblyInstance,
037    FLAG extends IFlagInstance,
038    MODEL extends IModelInstanceAbsolute,
039    NAMED_MODEL extends INamedModelInstanceAbsolute,
040    FIELD extends IFieldInstanceAbsolute,
041    ASSEMBLY extends IAssemblyInstanceAbsolute,
042    CHOICE extends IChoiceInstance,
043    CHOICE_GROUP extends IChoiceGroupInstance>
044    extends AbstractGlobalDefinition<MODULE, INSTANCE>
045    implements IAssemblyDefinition, IFeatureContainerFlag<FLAG>, IFeatureContainerModelAssembly<
046        MODEL,
047        NAMED_MODEL,
048        FIELD,
049        ASSEMBLY,
050        CHOICE,
051        CHOICE_GROUP> {
052
053  /**
054   * Construct a new global assembly definition.
055   *
056   * @param module
057   *          the parent module containing this definition
058   */
059  protected AbstractGlobalAssemblyDefinition(@NonNull MODULE module) {
060    super(module, name -> ModuleUtils.parseModelName(module, name));
061  }
062}