org.apache.poi.hssf.record
Class DVRecord

java.lang.Object
  extended by org.apache.poi.hssf.record.Record
      extended by org.apache.poi.hssf.record.DVRecord

public final class DVRecord
extends Record

Title: DATAVALIDATION Record (0x01BE)

Description: 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)

Version:
2.0-pre
Author:
Dragos Buleandra (dragos.buleandra@trade2b.ro)

Field Summary
static short sid
           
static java.lang.Integer STRING_ERROR_TEXT
           
static java.lang.Integer STRING_ERROR_TITLE
           
static java.lang.Integer STRING_PROMPT_TEXT
           
static java.lang.Integer STRING_PROMPT_TITLE
           
 
Constructor Summary
DVRecord()
           
DVRecord(RecordInputStream in)
          Constructs a DV record and sets its fields appropriately.
 
Method Summary
 java.lang.Object clone()
          Clones the object.
protected  void fillFields(RecordInputStream in)
          called by the constructor, should set class level fields.
 HSSFCellRangeAddress getCellRangeAddress()
           
 int getConditionOperator()
          get the condition operator
 int getDataType()
          get the condition data type
 boolean getEmptyCellAllowed()
          return true if empty values are allowed in cells, false otherwise
 int getErrorStyle()
          get the condition error style
 boolean getListExplicitFormula()
          return true if in list validations the string list is explicitly given in the formula, false otherwise
 int getOptionFlags()
          gets the option flags field.
 int getRecordSize()
          gives the current serialized size of the record.
 boolean getShowErrorOnInvalidValue()
          return true if an error window should appear when an invalid value is entered in the cell, false otherwise
 boolean getShowPromptOnCellSelected()
          return true if a prompt window should appear when cell is selected, false otherwise
 short getSid()
          return the non static version of the id for this record.
 java.lang.String getStringField(java.lang.Integer type)
           
 boolean getSurppresDropdownArrow()
          return true if drop down arrow should be surppressed when list validation is used, false otherwise
 int serialize(int offset, byte[] data)
          called by the class that is responsible for writing this sucker.
 void setCellRangeAddress(HSSFCellRangeAddress range)
           
 void setConditionOperator(int operator)
          set the condition operator
 void setDataType(int type)
          set the condition data type
 void setEmptyCellAllowed(boolean allowed)
          set if empty values are allowed in cells
 void setErrorStyle(int style)
          set the condition error style
 void setFirstFormulaRPN(java.util.Stack rpn)
           
 void setFirstFormulaSize(short size)
           
 void setListExplicitFormula(boolean explicit)
          set if in list validations the string list is explicitly given in the formula
 void setSecFormulaRPN(java.util.Stack rpn)
           
 void setSecFormulaSize(short size)
           
 void setShowErrorOnInvalidValue(boolean show)
          set if an error window should appear when an invalid value is entered in the cell
 void setShowPromptOnCellSelected(boolean show)
          set if a prompt window should appear when cell is selected
 void setStringField(java.lang.Integer type, java.lang.String str_data)
           
 void setSurppresDropdownArrow(boolean surppress)
          set if drop down arrow should be surppressed when list validation is used
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
protected  void validateSid(short id)
          called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
 
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, isInValueSection, isValue, serialize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final short sid
See Also:
Constant Field Values

STRING_PROMPT_TITLE

public static final java.lang.Integer STRING_PROMPT_TITLE

STRING_ERROR_TITLE

public static final java.lang.Integer STRING_ERROR_TITLE

STRING_PROMPT_TEXT

public static final java.lang.Integer STRING_PROMPT_TEXT

STRING_ERROR_TEXT

public static final java.lang.Integer STRING_ERROR_TEXT
Constructor Detail

DVRecord

public DVRecord()

DVRecord

public DVRecord(RecordInputStream in)
Constructs a DV record and sets its fields appropriately.

Parameters:
in - the RecordInputstream to read the record from
Method Detail

validateSid

protected void validateSid(short id)
Description copied from class: Record
called by constructor, should throw runtime exception in the event of a record passed with a differing ID.

Specified by:
validateSid in class Record
Parameters:
id - alleged id for this record

fillFields

protected void fillFields(RecordInputStream in)
Description copied from class: Record
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

Specified by:
fillFields in class Record
Parameters:
in - the RecordInputstream to read the record from

setDataType

public void setDataType(int type)
set the condition data type

Parameters:
type - - condition data type
See Also:
utility class

getDataType

public int getDataType()
get the condition data type

Returns:
the condition data type
See Also:
utility class

setErrorStyle

public void setErrorStyle(int style)
set the condition error style

Parameters:
type - - condition error style
See Also:
utility class

getErrorStyle

public int getErrorStyle()
get the condition error style

Returns:
the condition error style
See Also:
utility class

setListExplicitFormula

public void setListExplicitFormula(boolean explicit)
set if in list validations the string list is explicitly given in the formula

Parameters:
type - - true if in list validations the string list is explicitly given in the formula; false otherwise
See Also:
utility class

getListExplicitFormula

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

Returns:
true if in list validations the string list is explicitly given in the formula, false otherwise
See Also:
utility class

setEmptyCellAllowed

public void setEmptyCellAllowed(boolean allowed)
set if empty values are allowed in cells

Parameters:
type - - true if empty values are allowed in cells, false otherwise
See Also:
utility class

getEmptyCellAllowed

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

Returns:
if empty values are allowed in cells, false otherwise
See Also:
utility class

setSurppresDropdownArrow

public void setSurppresDropdownArrow(boolean surppress)
set if drop down arrow should be surppressed when list validation is used

Parameters:
type - - true if drop down arrow should be surppressed when list validation is used, false otherwise
See Also:
utility class

getSurppresDropdownArrow

public boolean getSurppresDropdownArrow()
return true if drop down arrow should be surppressed when list validation is used, false otherwise

Returns:
if drop down arrow should be surppressed when list validation is used, false otherwise
See Also:
utility class

setShowPromptOnCellSelected

public void setShowPromptOnCellSelected(boolean show)
set if a prompt window should appear when cell is selected

Parameters:
type - - true if a prompt window should appear when cell is selected, false otherwise
See Also:
utility class

getShowPromptOnCellSelected

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

Returns:
if a prompt window should appear when cell is selected, false otherwise
See Also:
utility class

setShowErrorOnInvalidValue

public void setShowErrorOnInvalidValue(boolean show)
set if an error window should appear when an invalid value is entered in the cell

Parameters:
type - - true if an error window should appear when an invalid value is entered in the cell, false otherwise
See Also:
utility class

getShowErrorOnInvalidValue

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

Returns:
if an error window should appear when an invalid value is entered in the cell, false otherwise
See Also:
utility class

setConditionOperator

public void setConditionOperator(int operator)
set the condition operator

Parameters:
type - - condition operator
See Also:
utility class

getConditionOperator

public int getConditionOperator()
get the condition operator

Returns:
the condition operator
See Also:
utility class

setFirstFormulaRPN

public void setFirstFormulaRPN(java.util.Stack rpn)

setFirstFormulaSize

public void setFirstFormulaSize(short size)

setSecFormulaRPN

public void setSecFormulaRPN(java.util.Stack rpn)

setSecFormulaSize

public void setSecFormulaSize(short size)

setStringField

public void setStringField(java.lang.Integer type,
                           java.lang.String str_data)

getStringField

public java.lang.String getStringField(java.lang.Integer type)

setCellRangeAddress

public void setCellRangeAddress(HSSFCellRangeAddress range)

getCellRangeAddress

public HSSFCellRangeAddress getCellRangeAddress()

getOptionFlags

public int getOptionFlags()
gets the option flags field.

Returns:
options - the option flags field

toString

public java.lang.String toString()
Description copied from class: Record
get a string representation of the record (for biffview/debugging)

Overrides:
toString in class Record

serialize

public int serialize(int offset,
                     byte[] data)
Description copied from class: Record
called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.

Specified by:
serialize in class Record
Parameters:
offset - to begin writing at
data - byte array containing instance data
Returns:
number of bytes written

getRecordSize

public int getRecordSize()
Description copied from class: Record
gives the current serialized size of the record. Should include the sid and reclength (4 bytes).

Overrides:
getRecordSize in class Record

getSid

public short getSid()
Description copied from class: Record
return the non static version of the id for this record.

Specified by:
getSid in class Record

clone

public java.lang.Object clone()
Clones the object. Uses serialisation, as the contents are somewhat complex

Overrides:
clone in class Record


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.