Class GMNEnricher

java.lang.Object
tools.pantheum.gaia.gs1.interpretation.enricher.GMNEnricher
All Implemented Interfaces:
InterpretationEnricherInterface

public final class GMNEnricher extends Object implements InterpretationEnricherInterface
Enriches AI 8013 (GMN — Global Model Number) by decomposing the value into its model reference and check character pair.

The GMN is structured as:

  [ GS1 Company Prefix (numeric) ][ Model Reference (alphanumeric) ][ Check Pair (2 chars) ]
The GS1PrefixEnricher handles the company prefix and member organisation lookup. This enricher adds the remaining fields.

This enricher must run after GS1PrefixEnricher in ai-content.json.

Example

GMN "1987654Ad4X4bL5ttr2310c2K":
  • GS1 company prefix: "1987654"
  • Model reference: "Ad4X4bL5ttr2310c"
  • Check pair: "2K"

Produced interpretations

  • GMN_MODEL_REFERENCE — the model reference portion of the GMN, e.g. "Ad4X4bL5ttr2310c"
  • GMN_CHECK_PAIR — the two-character MOD 1021,32 check pair, e.g. "2K"
Returns an empty list if the prefix cannot be matched or the value is too short to contain a model reference after the prefix and check pair.
  • Constructor Details

    • GMNEnricher

      public GMNEnricher()
      Creates a new GMNEnricher.
  • Method Details

    • enrich

      public List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element)
      Description copied from interface: InterpretationEnricherInterface
      Produces additional interpretations from baseValue.
      Specified by:
      enrich in interface InterpretationEnricherInterface
      Parameters:
      baseValue - the extracted segment value (never null or empty)
      aiDefinition - the full AI definition for the element being interpreted
      element - the parent element, providing access to all component values and any interpretations already added in this pass
      Returns:
      additional interpretations to append; never null