public class ZssContext
extends java.lang.Object
Constructor and Description |
---|
ZssContext(java.util.Locale locale,
int twoDigitYearUpperBound) |
Modifier and Type | Method and Description |
---|---|
static ZssContext |
getCurrent()
Returns the current ZK Spreadsheet Context; never null.
|
java.util.Locale |
getLocale() |
static ZssContext |
getThreadLocal()
Returns the ZK 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(java.util.Locale locale, int twoDigitYearUpperBound)
public java.util.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 © 2005-2010 Potix Corporation. All Rights Reserved.