jxl
Class WorkbookSettings

java.lang.Object
  |
  +--jxl.WorkbookSettings

public final class WorkbookSettings
extends java.lang.Object

This is a bean which client applications may use to set various advanced workbook properties. Use of this bean is not mandatory, and its absence will merely result in workbooks being read/written using the default settings


Field Summary
private  int arrayGrowSize
          The amount of memory allocated to the array containing the workbook data when its current amount is exhausted.
private  boolean chartsDisabled
          Flag to indicate whether the chart feature is enabled or not Charts deactivated using -Djxl.nocharts=true on the JVM command line Activated by default or by using -Djxl.nocharts=false on the JVM command line
private static int defaultArrayGrowSize
           
private static int defaultInitialFileSize
           
private  java.lang.String encoding
          The character encoding used for reading non-unicode strings.
private  FunctionNames functionNames
          The locale specific function names for this workbook
private  boolean gcDisabled
          Flag to indicate whether the system hint garbage collection is enabled or not.
private  int initialFileSize
          The amount of memory allocated to store the workbook data when reading a worksheet.
private  java.util.Locale locale
          The locale.
private static java.util.HashMap localeFunctionNames
          A hash map of function names keyed on locale
private  boolean namesDisabled
          Flag to indicate whether the name feature is enabled or not Names deactivated using -Djxl.nonames=true on the JVM command line Activated by default or by using -Djxl.nonames=false on the JVM command line
private  boolean rationalizationDisabled
          Flag to indicate whether the rationalization of cell formats is disabled or not.
private  boolean suppressWarnings
          Flag to suppress the warnings written to stderr.
 
Constructor Summary
WorkbookSettings()
          Default constructor
 
Method Summary
 int getArrayGrowSize()
          Accessor for the array grow size property
 boolean getChartsDisabled()
          Gets the charts disabled flag
 java.lang.String getEncoding()
          Accessor for the character encoding
 FunctionNames getFunctionNames()
          Gets the function names.
 boolean getGCDisabled()
          Accessor for the disabling of garbage collection
 int getInitialFileSize()
          Accessor for the initial file size property
 java.util.Locale getLocale()
          Returns the locale used for the spreadsheet
 boolean getNamesDisabled()
          Accessor for the disabling of interpretation of named ranges
 boolean getRationalizationDisabled()
          Accessor to retrieve the rationalization flag
 boolean getSuppressWarnings()
          Accessor to retrieve the suppress warnings flag
 void setArrayGrowSize(int sz)
          Sets the amount of memory by which to increase the amount of memory allocated to storing the workbook data.
 void setEncoding(java.lang.String enc)
          Sets the encoding for this workbook
 void setInitialFileSize(int sz)
          Sets the initial amount of memory allocated to store the workbook data when reading a worksheet.
 void setLocale(java.util.Locale l)
          Sets the locale for this spreadsheet
 void setRationalization(boolean r)
          Sets whether or not to rationalize the cell formats before writing out the sheet.
 void setSuppressWarnings(boolean w)
          Accessor to set the suppress warnings flag
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

initialFileSize

private int initialFileSize
The amount of memory allocated to store the workbook data when reading a worksheet. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size

arrayGrowSize

private int arrayGrowSize
The amount of memory allocated to the array containing the workbook data when its current amount is exhausted.

chartsDisabled

private boolean chartsDisabled
Flag to indicate whether the chart feature is enabled or not Charts deactivated using -Djxl.nocharts=true on the JVM command line Activated by default or by using -Djxl.nocharts=false on the JVM command line

namesDisabled

private boolean namesDisabled
Flag to indicate whether the name feature is enabled or not Names deactivated using -Djxl.nonames=true on the JVM command line Activated by default or by using -Djxl.nonames=false on the JVM command line

gcDisabled

private boolean gcDisabled
Flag to indicate whether the system hint garbage collection is enabled or not. As a rule of thumb, it is desirable to enable garbage collection when reading large spreadsheets from a batch process or from the command line, but better to deactivate the feature when reading large spreadsheets within a WAS, as the calls to System.gc() not only garbage collect the junk in JExcelApi, but also in the webservers JVM and can cause significant slowdown GC deactivated using -Djxl.nogc=true on the JVM command line Activated by default or by using -Djxl.nogc=false on the JVM command line

rationalizationDisabled

private boolean rationalizationDisabled
Flag to indicate whether the rationalization of cell formats is disabled or not. Rationalization is enabled by default, but may be disabled for performance reasons. It can be deactivated using -Djxl.norat=true on the JVM command line

suppressWarnings

private boolean suppressWarnings
Flag to suppress the warnings written to stderr. This may also be set from the JVM command line using -Djxl.nowarnings=true

locale

private java.util.Locale locale
The locale. Normally this is the same as the system locale, but there may be cases (eg. where you are uploading many spreadsheets from foreign sources) where you may want to specify the locale on an individual worksheet basis The locale may also be specified on the command line using the lang and country System properties eg. -Djxl.lang=en -Djxl.country=UK for UK English

functionNames

private FunctionNames functionNames
The locale specific function names for this workbook

encoding

private java.lang.String encoding
The character encoding used for reading non-unicode strings. This can be different from the default platform encoding if processing spreadsheets from abroad. This may also be set using the system property jxl.encoding

localeFunctionNames

private static java.util.HashMap localeFunctionNames
A hash map of function names keyed on locale

defaultInitialFileSize

private static final int defaultInitialFileSize

defaultArrayGrowSize

private static final int defaultArrayGrowSize
Constructor Detail

WorkbookSettings

public WorkbookSettings()
Default constructor
Method Detail

setArrayGrowSize

public void setArrayGrowSize(int sz)
Sets the amount of memory by which to increase the amount of memory allocated to storing the workbook data. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size Default value is 1 megabyte
Parameters:
sz - the file size in bytes

getArrayGrowSize

public int getArrayGrowSize()
Accessor for the array grow size property
Returns:
the array grow size

setInitialFileSize

public void setInitialFileSize(int sz)
Sets the initial amount of memory allocated to store the workbook data when reading a worksheet. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size Default value is 5 megabytes
Parameters:
sz - the file size in bytes

getInitialFileSize

public int getInitialFileSize()
Accessor for the initial file size property
Returns:
the initial file size

getChartsDisabled

public boolean getChartsDisabled()
Gets the charts disabled flag
Returns:
TRUE if charts are disabled, FALSE otherwise

getGCDisabled

public boolean getGCDisabled()
Accessor for the disabling of garbage collection
Returns:
FALSE if JExcelApi hints for garbage collection, TRUE otherwise

getNamesDisabled

public boolean getNamesDisabled()
Accessor for the disabling of interpretation of named ranges
Returns:
FALSE if named cells are interpreted, TRUE otherwise

setRationalization

public void setRationalization(boolean r)
Sets whether or not to rationalize the cell formats before writing out the sheet. The default value is true
Parameters:
r - the rationalization flag

getRationalizationDisabled

public boolean getRationalizationDisabled()
Accessor to retrieve the rationalization flag
Returns:
TRUE if rationalization is off, FALSE if rationalization is on

setSuppressWarnings

public void setSuppressWarnings(boolean w)
Accessor to set the suppress warnings flag
Parameters:
w - the flag

getSuppressWarnings

public boolean getSuppressWarnings()
Accessor to retrieve the suppress warnings flag
Returns:
TRUE to suppress warnings written to standard error, FALSE otherwise

setLocale

public void setLocale(java.util.Locale l)
Sets the locale for this spreadsheet
Parameters:
l - the locale

getLocale

public java.util.Locale getLocale()
Returns the locale used for the spreadsheet
Returns:
the locale

getEncoding

public java.lang.String getEncoding()
Accessor for the character encoding
Returns:
the character encoding for this workbook

setEncoding

public void setEncoding(java.lang.String enc)
Sets the encoding for this workbook
Parameters:
enc - the encoding

getFunctionNames

public FunctionNames getFunctionNames()
Gets the function names. This is used by the formula parsing package in order to get the locale specific function names for this particular workbook