LoadFilter
Inheritance: java.lang.Object
public class LoadFilter
Represents the filter that provides options for loading data when loading workbook from template.
Remarks
User may specify the filter options or implement their own LoadFilter to specify how to load data.
Example
The following example shows how to determine the filter options according to worksheet’s properties.
class LoadFilterSheet extends LoadFilter
{
public /*override*/ void startSheet(Worksheet sheet)
{
if ("Sheet1".equals(sheet.getName()))
{
setLoadDataFilterOptions(LoadDataFilterOptions.ALL);
}
else
{
setLoadDataFilterOptions(LoadDataFilterOptions.STRUCTURE);
}
}
}
LoadOptions opts = new LoadOptions();
opts.setLoadFilter(new LoadFilterSheet());
Workbook wb = new Workbook("template.xlsx", opts);
//Custom LoadFilter implementation
Constructors
Constructor | Description |
---|---|
LoadFilter() | Constructs one LoadFilter with default filter options LoadDataFilterOptions.All. |
LoadFilter(int opts) | Constructs one LoadFilter with given filter options. |
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getClass() | |
getLoadDataFilterOptions() | The filter options to denote what data should be loaded. |
getSheetsInLoadingOrder() | Specifies the sheets(indices) and order to be loaded. |
hashCode() | |
notify() | |
notifyAll() | |
setLoadDataFilterOptions(int value) | The filter options to denote what data should be loaded. |
startSheet(Worksheet sheet) | Prepares filter options before loading given worksheet. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
LoadFilter()
public LoadFilter()
Constructs one LoadFilter with default filter options LoadDataFilterOptions.All.
LoadFilter(int opts)
public LoadFilter(int opts)
Constructs one LoadFilter with given filter options.
Parameters:
Parameter | Type | Description |
---|---|---|
opts | int | LoadDataFilterOptions. the default filter options |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getLoadDataFilterOptions()
public int getLoadDataFilterOptions()
The filter options to denote what data should be loaded.
Returns: int
getSheetsInLoadingOrder()
public int[] getSheetsInLoadingOrder()
Specifies the sheets(indices) and order to be loaded. Default is null, that denotes to load all sheets in the default order in template file. If not null and some sheet’s index is not in the returned array, then the sheet will not be loaded.
Returns: int[]
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setLoadDataFilterOptions(int value)
public void setLoadDataFilterOptions(int value)
The filter options to denote what data should be loaded.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
startSheet(Worksheet sheet)
public void startSheet(Worksheet sheet)
Prepares filter options before loading given worksheet. User’s implementation of LoadFilter can change the LoadDataFilterOptions here to denote how to load data for this worksheet.
Parameters:
Parameter | Type | Description |
---|---|---|
sheet | Worksheet | The worksheet to be loaded. There are only few properties can be used for the given worksheet object here because most data and properties have not been loaded. The available properties are: Name, Index, VisibilityType |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |