Class GaiaError

java.lang.Object
tools.pantheum.gaia.error.GaiaError

public class GaiaError extends Object
An immutable validation error or advisory warning produced during GS1 element string parsing.

Each error carries a catalogue identifier (getId()), a severity GaiaConstants.ErrorLevel, a pipeline GaiaConstants.ErrorStage, a machine-readable getCode(), the Application Identifier that caused it (getAi(), may be null), a human-readable interpolated getMessage(), and the zero-based character getPosition() within the original input.

Instances are created by ErrorRegistry, which interpolates the localized message from the catalogue. The constructor is public only because the registry lives in a sub-package; prefer ErrorRegistry.INSTANCE.create(...) over constructing directly, or the error will bypass the catalogue and carry unlocalized text.

  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Returns the id.
      Returns:
      the id.
    • getLevel

      public GaiaConstants.ErrorLevel getLevel()
      Returns the level.
      Returns:
      the level.
    • getStage

      public GaiaConstants.ErrorStage getStage()
      Returns the stage.
      Returns:
      the stage.
    • getCode

      public String getCode()
      Returns the code.
      Returns:
      the code.
    • getAi

      public String getAi()
      Returns the AI.
      Returns:
      the AI.
    • getMessage

      public String getMessage()
      Returns the message.
      Returns:
      the message.
    • getPosition

      public int getPosition()
      Returns the position.
      Returns:
      the position.
    • toString

      public String toString()
      Overrides:
      toString in class Object