Class StatementContext


  • public final class StatementContext
    extends java.lang.Object
    Singleton context holder for the current billing Statement. Manages the lifecycle of the active statement, including initialization from the database and reinitialization on full reset.

    Must be initialized via init() before current() is called. Calling init() again creates a fresh statement, replacing any existing one.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Statement current()
      Returns the current active Statement.
      static void init()
      Initializes a new Statement, loading all catalog data from the database and applying the configured sales tax rate from AppConfig.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • init

        public static void init()
        Initializes a new Statement, loading all catalog data from the database and applying the configured sales tax rate from AppConfig. Safe to call multiple times; each call replaces the previous statement.
      • current

        public static Statement current()
        Returns the current active Statement.
        Returns:
        the current statement
        Throws:
        java.lang.IllegalStateException - if init() has not been called