Class ProductionTimeEnricher
java.lang.Object
tools.pantheum.gaia.gs1.interpretation.enricher.ProductionTimeEnricher
- All Implemented Interfaces:
InterpretationEnricherInterface
Enriches AI 8008 (PROD TIME — Date and time of production) with a complete
set of date, time and date-time interpretations.
AI 8008 uses two components with formats not handled by the generic
DateEnricher or TimeEnricher:
- Component 0 (
N8, yymmddhh) — mandatory: date and hour encoded asYYMMDDHH, e.g."25061514"= 15 Jun 2025, 14:xx - Component 1 (
N..4, mmoptss) — optional: minutes with optional seconds encoded asMMorMMSS, e.g."30"= :30,"3045"= :30:45
This enricher is declared with no component or start/end
in ai-content.json and reads the component values directly from the
element rather than from the baseValue parameter.
Produced interpretations
Date formatting (order and separator) is controlled by the
ParseConfig passed to the pipeline.
The examples below use the default configuration (little-endian, slash).
DATE_VALUE— formatted date string, e.g."15/06/2025"DATE_FORMAT— date pattern string, e.g."dd/mm/yyyy"TIME_VALUE—"HH:mm"or"HH:mm:ss", e.g."14:30"or"14:30:45"TIME_FORMAT—"HH:mm"or"HH:mm:ss"DATETIME_VALUE— combined date and time, e.g."15/06/2025 14:30:45"DATETIME_FORMAT— combined pattern, e.g."dd/mm/yyyy HH:mm"or"dd/mm/yyyy HH:mm:ss"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionenrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element) Produces additional interpretations frombaseValue.enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element, ParseConfig config) Produces additional interpretations frombaseValue, applying caller-supplied formatting preferences fromconfig.
-
Constructor Details
-
ProductionTimeEnricher
public ProductionTimeEnricher()Creates a newProductionTimeEnricher.
-
-
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
-
enrich
public List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element, ParseConfig config) Description copied from interface:InterpretationEnricherInterfaceProduces additional interpretations frombaseValue, applying caller-supplied formatting preferences fromconfig.Enrichers that do not use
configinherit this default, which delegates toInterpretationEnricherInterface.enrich(String, AiDefinition, GS1AIObjectElement). Enrichers that format dates (e.g.DateEnricher,ProductionTimeEnricher) override this method.- Specified by:
enrichin interfaceInterpretationEnricherInterface- 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
-