Interface AdjacentCellAssertion
- All Superinterfaces:
CellAssertion
,Serializable
A
CellAssertion
that succeeds if the value in another cell with a position defined relative
to the CellValue.location()
is within a set of allowed values.
When extracting data from a form-style Excel, this assertion type is useful to ensure that value locations, as
identified by their "labels," are consistent across input files, and if the assertion is violated, the parser
definition can then be modified appropriately.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Builder for creating an instance ofAdjacentCellAssertion
. -
Method Summary
Modifier and TypeMethodDescriptionstatic AdjacentCellAssertion
The set of acceptable values for the cell with locationrowOffset()
,columnOffset()
relative to theCellValue.location()
.builder()
Create anAdjacentCellAssertion.Builder
for constructing an instance of this class.default void
check()
Ensure that the instance of this class is valid at construction time.default AssertionResult
check
(WorkbookWithMetadata workbook, org.apache.poi.ss.usermodel.Sheet sheet, Location location) default Integer
Column offset from theCellValue.location()
.static AdjacentCellAssertion
default Integer
Row offset from theCellValue.location()
.
-
Method Details
-
rowOffset
Row offset from theCellValue.location()
. Can be negative for above, positive for below, or 0 for same-row. Default value is 0. -
columnOffset
Column offset from theCellValue.location()
. Can be negative for left, positive for right, or 0 for same-column. Default value is 0. -
allowedValues
The set of acceptable values for the cell with locationrowOffset()
,columnOffset()
relative to theCellValue.location()
. -
builder
Create anAdjacentCellAssertion.Builder
for constructing an instance of this class. -
left
-
above
-
check
@Check default void check()Ensure that the instance of this class is valid at construction time.allowedValues()
must be non-empty, and at least one ofrowOffset()
/columnOffset()
must be non-zero. -
check
default AssertionResult check(WorkbookWithMetadata workbook, org.apache.poi.ss.usermodel.Sheet sheet, Location location) - Specified by:
check
in interfaceCellAssertion
-