Class ZssContext


  • public class ZssContext
    extends Object
    Keikai Spreadsheet context for cell evaluation, etc. for Locale and Two Digit Year interpretation.
    Author:
    henrichen@zkoss.org
    • Constructor Detail

      • ZssContext

        public ZssContext​(Locale locale,
                          int twoDigitYearUpperBound)
      • ZssContext

        public ZssContext​(Locale locale,
                          int twoDigitYearUpperBound,
                          double maxChange,
                          int maxCount)
    • Method Detail

      • getLocale

        public Locale getLocale()
      • getTwoDigitYearUpperBound

        public int getTwoDigitYearUpperBound()
      • getMaxCount

        public int getMaxCount()
        Returns the maximum iteration count on circular evaluation.
        Returns:
      • getMaxChange

        public double getMaxChange()
        Returns the maximum changes between two circular evaluation.
        Returns:
      • getCurrent

        public static final ZssContext getCurrent()
        Returns the current Keikai Spreadsheet Context; never null. This is the Keikai Spreadsheet Context that every other objects shall use, unless they have special consideration.

        Default: If setThreadLocal(org.apache.poi.ss.usermodel.ZssContext) was called with non-null, the value is returned. Otherwise, a default context is created and returned,

      • setThreadLocal

        public static final ZssContext setThreadLocal​(ZssContext ctx)
        Sets the locale for the current thread only.

        Each thread could have an independent ZssContext, called the thread locale.

        When Invoking this method under a thread that serves requests, remember to clean up the setting upon completing each request.

        ZssContext old = ZssContext.setThreadLocal(newValue);
        try { 
          ...
        } finally {
          ZssContext.setThreadLocal(old);
        }
        Parameters:
        ctx - the thread ZssContext; null to denote no thread zssContext
        Returns:
        the previous thread locale