Interface InterpretationEnricherInterface
- All Known Implementing Classes:
AIDCMediaTypeEnricher, AquaticSpeciesEnricher, BirthSequenceEnricher, CertificationReferenceEnricher, CpidEnricher, DateEnricher, DateTimeEnricher, DecimalAmountEnricher, DecimalPercentageEnricher, DecimalPointEnricher, EidEnricher, GeoCoordinateEnricher, GMNEnricher, GS1PrefixEnricher, GTINEnricher, HarvestDateEnricher, HIDRIEnricher, IBANEnricher, IccidEnricher, ImeiEnricher, Iso3166Alpha2Enricher, Iso3166Enricher, Iso3166ListEnricher, Iso4217Enricher, Iso5218Enricher, ISOUnitEnricher, ItipEnricher, MonetaryAmountEnricher, NsnEnricher, PcEncEnricher, PieceOfTotalEnricher, ProductionMethodEnricher, ProductionTimeEnricher, RollDimensionsEnricher, SSCCEnricher, TemperatureCelsiusEnricher, TemperatureFahrenheitEnricher, TimeEnricher, UicEnricher, YesNoEnricher
public interface InterpretationEnricherInterface
Enriches a base value extracted from a GS1 AI element with additional
GS1AIInterpretation objects derived via a registry lookup or other logic.
Contract
- Implementations must be stateless and thread-safe.
- The returned list must never be
null; return an empty list when no enrichment is possible (e.g. lookup found no match). - Enricher output is always additive — it is appended to
any base
GS1AIInterpretationalready produced by the definition'stype/label. Enrichers must not attempt to replace or remove existing interpretations.
Registration
Enricher implementations live in thetools.pantheum.gaia.gs1.interpretation.enricher sub-package and
are referenced by their simple class name in ai-content.json.
They are instantiated once via reflection by
InterpretationRegistry
and cached for the lifetime of the registry.-
Method Summary
Modifier and TypeMethodDescriptionenrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element) Produces additional interpretations frombaseValue.default List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element, ParseConfig config) Produces additional interpretations frombaseValue, applying caller-supplied formatting preferences fromconfig.
-
Method Details
-
enrich
List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element) Produces additional interpretations frombaseValue.- 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
-
enrich
default List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element, ParseConfig config) Produces additional interpretations frombaseValue, applying caller-supplied formatting preferences fromconfig.Enrichers that do not use
configinherit this default, which delegates toenrich(String, AiDefinition, GS1AIObjectElement). Enrichers that format dates (e.g.DateEnricher,ProductionTimeEnricher) override this method.- Parameters:
baseValue- the extracted segment value (nevernullor empty)aiDefinition- the full AI definition for the element being interpretedelement- the parent elementconfig- caller-supplied parse configuration; nevernull- Returns:
- additional interpretations to append; never
null
-