Top Description Fields Constructors Methods
org.apache.poi.hssf.record

public final Class DVRecord

extends StandardRecord
Class Inheritance
Static Imports
org.apache.poi.util.GenericRecordUtil.getBitsAsString

This record stores data validation settings and a list of cell ranges which contain these settings. The data validation settings of a sheet are stored in a sequential list of DV records. This list is followed by DVAL record(s)

Field Summary

Modifier and TypeField and Description
private final UnicodeString
_errorText

Text of the error box, cannot be longer than 255 chars

private final UnicodeString
_errorTitle

Title of the error box, cannot be longer than 32 chars

private final Formula
_formula1

Formula data for first condition (RPN token array without size field)

private final Formula
_formula2

Formula data for second condition (RPN token array without size field)

private short
_not_used_1

Not used - Excel seems to always write 0x3FE0

private short
_not_used_2

Not used - Excel seems to always write 0x0000

private int
_option_flags

Option flags

private final UnicodeString
_promptText

Text of the prompt box, cannot be longer than 255 chars

private final UnicodeString
_promptTitle

Title of the prompt box, cannot be longer than 32 chars

private final CellRangeAddressList
_regions

Cell range address list with all affected ranges

private static final int[]
private static final String[]
private static final UnicodeString
NULL_TEXT_STRING

the unicode string used for error/prompt title/text when not present

private static final BitField
private static final BitField
opt_data_type

Option flags field

private static final BitField
private static final BitField
private static final BitField
private static final BitField
private static final BitField
private static final BitField
public static final short

Constructor Summary

AccessConstructor and Description
public
public
DVRecord(int validationType, int operator, int errorStyle, boolean emptyCellAllowed, boolean suppressDropDownArrow, boolean isExplicitList, boolean showPromptBox, String promptTitle, String promptText, boolean showErrorBox, String errorTitle, String errorText, Ptg[] formula1, Ptg[] formula2, CellRangeAddressList regions)

public

Method Summary

Modifier and TypeMethod and Description
public DVRecord
public CellRangeAddressList
public int

Returns:

the condition operator
getConditionOperator
()

get the condition operator

protected int
public int

Returns:

the condition data type
getDataType
()

public boolean

Returns:

true if empty values are allowed in cells, false otherwise
getEmptyCellAllowed
()

public int

Returns:

the condition error style
getErrorStyle
()

public String
public String
public Ptg[]
public Ptg[]
public Map<String, Supplier<?>>
public HSSFRecordTypes
public boolean

Returns:

true if in list validations the string list is explicitly given in the formula, false otherwise
getListExplicitFormula
()

public String
public String
public boolean

Returns:

true if an error window should appear when an invalid value is entered in the cell, false otherwise
getShowErrorOnInvalidValue
()

public boolean

Returns:

true if a prompt window should appear when cell is selected, false otherwise
getShowPromptOnCellSelected
()

public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public boolean

Returns:

true if drop down arrow should be suppressed when list validation is used, false otherwise
getSuppressDropdownArrow
()

private static int
private static UnicodeString
private static String
private static UnicodeString
resolveTitleText(String str)

When entered via the UI, Excel translates empty string into "\0" While it is possible to encode the title/text as empty string (Excel doesn't exactly crash), the resulting tool-tip text / message box looks wrong.

public void
serialize(LittleEndianOutput
the output object
out
)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record.

private static void
Inherited from org.apache.poi.hssf.record.StandardRecord:
getRecordSizeserialize

Field Detail

_errorTextback to summary
private final UnicodeString _errorText

Text of the error box, cannot be longer than 255 chars

_errorTitleback to summary
private final UnicodeString _errorTitle

Title of the error box, cannot be longer than 32 chars

_formula1back to summary
private final Formula _formula1

Formula data for first condition (RPN token array without size field)

_formula2back to summary
private final Formula _formula2

Formula data for second condition (RPN token array without size field)

_not_used_1back to summary
private short _not_used_1

Not used - Excel seems to always write 0x3FE0

_not_used_2back to summary
private short _not_used_2

Not used - Excel seems to always write 0x0000

Annotations
@SuppressWarnings:RedundantFieldInitialization
_option_flagsback to summary
private int _option_flags

Option flags

_promptTextback to summary
private final UnicodeString _promptText

Text of the prompt box, cannot be longer than 255 chars

_promptTitleback to summary
private final UnicodeString _promptTitle

Title of the prompt box, cannot be longer than 32 chars

_regionsback to summary
private final CellRangeAddressList _regions

Cell range address list with all affected ranges

FLAG_MASKSback to summary
private static final int[] FLAG_MASKS
FLAG_NAMESback to summary
private static final String[] FLAG_NAMES
NULL_TEXT_STRINGback to summary
private static final UnicodeString NULL_TEXT_STRING

the unicode string used for error/prompt title/text when not present

opt_condition_operatorback to summary
private static final BitField opt_condition_operator
opt_data_typeback to summary
private static final BitField opt_data_type

Option flags field

See Also
utility class
opt_empty_cell_allowedback to summary
private static final BitField opt_empty_cell_allowed
opt_error_styleback to summary
private static final BitField opt_error_style
opt_show_error_on_invalid_valueback to summary
private static final BitField opt_show_error_on_invalid_value
opt_show_prompt_on_cell_selectedback to summary
private static final BitField opt_show_prompt_on_cell_selected
opt_string_list_formulaback to summary
private static final BitField opt_string_list_formula
opt_suppress_dropdown_arrowback to summary
private static final BitField opt_suppress_dropdown_arrow
sidback to summary
public static final short sid

Constructor Detail

DVRecordback to summary
public DVRecord(DVRecord other)
DVRecordback to summary
public DVRecord(int validationType, int operator, int errorStyle, boolean emptyCellAllowed, boolean suppressDropDownArrow, boolean isExplicitList, boolean showPromptBox, String promptTitle, String promptText, boolean showErrorBox, String errorTitle, String errorText, Ptg[] formula1, Ptg[] formula2, CellRangeAddressList regions)
DVRecordback to summary
public DVRecord(RecordInputStream in)

Method Detail

copyback to summary
public DVRecord copy()

Implements abstract org.apache.poi.hssf.record.StandardRecord.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Clones the object.

Returns:DVRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getCellRangeAddressback to summary
public CellRangeAddressList getCellRangeAddress()
getConditionOperatorback to summary
public int getConditionOperator()

get the condition operator

Returns:int

the condition operator

See Also
utility class
getDataSizeback to summary
protected int getDataSize()

Implements abstract org.apache.poi.hssf.record.StandardRecord.getDataSize.

getDataTypeback to summary
public int getDataType()
Returns:int

the condition data type

See Also
org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType
getEmptyCellAllowedback to summary
public boolean getEmptyCellAllowed()
Returns:boolean

true if empty values are allowed in cells, false otherwise

getErrorStyleback to summary
public int getErrorStyle()
Returns:int

the condition error style

See Also
org.apache.poi.ss.usermodel.DataValidation.ErrorStyle
getErrorTextback to summary
public String getErrorText()
getErrorTitleback to summary
public String getErrorTitle()
getFormula1back to summary
public Ptg[] getFormula1()
getFormula2back to summary
public Ptg[] getFormula2()
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getListExplicitFormulaback to summary
public boolean getListExplicitFormula()
Returns:boolean

true if in list validations the string list is explicitly given in the formula, false otherwise

getPromptTextback to summary
public String getPromptText()
getPromptTitleback to summary
public String getPromptTitle()
getShowErrorOnInvalidValueback to summary
public boolean getShowErrorOnInvalidValue()
Returns:boolean

true if an error window should appear when an invalid value is entered in the cell, false otherwise

getShowPromptOnCellSelectedback to summary
public boolean getShowPromptOnCellSelected()
Returns:boolean

true if a prompt window should appear when cell is selected, false otherwise

getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

getSuppressDropdownArrowback to summary
public boolean getSuppressDropdownArrow()
Returns:boolean

true if drop down arrow should be suppressed when list validation is used, false otherwise

getUnicodeStringSizeback to summary
private static int getUnicodeStringSize(UnicodeString us)
readUnicodeStringback to summary
private static UnicodeString readUnicodeString(RecordInputStream in)
resolveTitleStringback to summary
private static String resolveTitleString(UnicodeString us)
resolveTitleTextback to summary
private static UnicodeString resolveTitleText(String str)

When entered via the UI, Excel translates empty string into "\0" While it is possible to encode the title/text as empty string (Excel doesn't exactly crash), the resulting tool-tip text / message box looks wrong. It is best to do the same as the Excel UI and encode 'not present' as "\0".

serializeback to summary
public void serialize(LittleEndianOutput out)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Doc from org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields have already been written by the superclass.

The number of bytes written must equal the record size reported by org.apache.poi.hssf.record.Record#getRecordSize()} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).

Parameters
out:LittleEndianOutput

the output object

serializeUnicodeStringback to summary
private static void serializeUnicodeString(UnicodeString us, LittleEndianOutput out)