public class ZssContext extends Object
Constructor and Description |
---|
ZssContext(Locale locale,
int twoDigitYearUpperBound) |
Modifier and Type | Method and Description |
---|---|
static ZssContext |
getCurrent()
Returns the current Keikai Spreadsheet Context; never null.
|
Locale |
getLocale() |
static ZssContext |
getThreadLocal()
Returns the Keikai Spreadsheet Contextdefined by
setThreadLocal(org.zkoss.poi.ss.usermodel.ZssContext) . |
int |
getTwoDigitYearUpperBound() |
static ZssContext |
setThreadLocal(ZssContext ctx)
Sets the locale for the current thread only.
|
public ZssContext(Locale locale, int twoDigitYearUpperBound)
public Locale getLocale()
public int getTwoDigitYearUpperBound()
public static final ZssContext getCurrent()
Default: If setThreadLocal(org.zkoss.poi.ss.usermodel.ZssContext)
was called with non-null,
the value is returned. Otherwise, a default context is created and returned,
public static final ZssContext setThreadLocal(ZssContext ctx)
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);
}
ctx
- the thread ZssContext; null to denote no thread zssContextpublic static final ZssContext getThreadLocal()
setThreadLocal(org.zkoss.poi.ss.usermodel.ZssContext)
.getCurrent()
Copyright © 2020. All rights reserved.