Class DLSyntaxParser
java.lang.Object
tools.pantheum.gaia.gs1.syntax.digitallink.DLSyntaxParser
Extracts GS1 Application Identifier elements from an uncompressed GS1 Digital
Link URI into a list of
GS1AIObjectElement objects.
Parsing rules (GS1 Digital Link Standard: URI Syntax, release 1.7.0):
- The input must be an absolute HTTP(S) URL (
GE-L001–GE-L003otherwise). - The path contains exactly one primary identification key as an
/ai/valuepair (§4.3); arbitrary custom path segments may precede it (§6.1.1). - Subsequent
/ai/valuepath pairs are key qualifiers, admitted and ordered per primary key (§4.9). - Query parameters with all-numeric keys are data attribute AIs
(§4.10); non-numeric keys are extension parameters and are ignored,
as are the reserved keywords
linkTypeandcontext. - Percent-encoded characters in values are decoded (§4.2).
Parsing is two-phase, mirroring AISyntaxParser:
- Phase 1 – Extract: walk the URL path and query, collecting
AI/value pairs and their
GS1Constants.DigitalLinkAITyperoles, raising a structural Digital Link error (GE-L001–GE-L012) per violation. - Phase 2 – Tokenise: render the pairs as a GS1 element string and
delegate to
AISyntaxParserso that elements carry the same component slices and value checks as element-string parsing; each element is then tagged with its Digital Link role.
All elements and errors collected before a structural error are still returned so that callers can report as much context as possible.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DLSyntaxParser
Creates a newDLSyntaxParser.- Parameters:
registry- the registry
-
-
Method Details
-
parse
Parse.- Parameters:
input- the inputconfig- the config- Returns:
- the parse.
-