Class GMNEnricher
java.lang.Object
tools.pantheum.gaia.gs1.interpretation.enricher.GMNEnricher
- All Implemented Interfaces:
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"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionenrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element) Produces additional interpretations frombaseValue.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface InterpretationEnricherInterface
enrichModifier and TypeMethodDescriptiondefault List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element, ParseConfig config) Produces additional interpretations frombaseValue, applying caller-supplied formatting preferences fromconfig.
-
Constructor Details
-
GMNEnricher
public GMNEnricher()Creates a newGMNEnricher.
-
-
Method Details
-
enrich
public List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element) Description copied from interface:InterpretationEnricherInterfaceProduces additional interpretations frombaseValue.- Specified by:
enrichin interfaceInterpretationEnricherInterface- Parameters:
baseValue- the extracted segment value (nevernullor empty)aiDefinition- the full AI definition for the element being interpretedelement- the parent element, providing access to all component values and any interpretations already added in this pass- Returns:
- additional interpretations to append; never
null
-