public final class IgnoredError extends Object
A cell is considered to have an error condition when it meets one of the conditions specified in the getErrorTypes()
member.
For example, if a cell is formatted as text but contains a numeric value, this is considered to be a potential error because the number won't be treated as a number, for example, in calculations.
Note that this is simply a guess by the implementing application, and a recommendation to the user.
Cells with the errors specified in IgnoredErrorTypes
may have perfectly valid reasons for being in such a state, for example a cell formatted as text which contains numeric Postal Codes or Order numbers.
It is useful to format these cells as text so that leading zeros remain as part of the value instead of being removed.
Following example shows that cells A1 and B1 both contain numbers stored as text, and this error has been reviewed and specifically flagged to be no longer surfaced as an error to the user.
ExcelFile workbook = new ExcelFile();
ExcelWorksheet worksheet = workbook.addWorksheet("Sheet1");
worksheet.getCell("A1").setValue("00385");
worksheet.getCell("B1").setValue("00387");
worksheet.getIgnoredErrors().add("A1 B1", EnumSet.of(IgnoredErrorTypes.NUMBER_STORED_AS_TEXT));
Modifier and Type | Method and Description |
---|---|
String |
getAppliesTo()
Gets the sequence of references to cell ranges over which this ignored error is applied.
|
EnumSet<IgnoredErrorTypes> |
getErrorTypes()
Gets the ignored error types.
|
void |
setAppliesTo(String appliesTo)
Sets the sequence of references to cell ranges over which this ignored error is applied.
|
void |
setErrorTypes(EnumSet<IgnoredErrorTypes> ignoredErrorTypes)
Sets the ignored error types.
|
String |
toString()
Returns a
String that represents this IgnoredError instance. |
public String getAppliesTo()
IllegalArgumentException
- Parameter is null
or empty string.public EnumSet<IgnoredErrorTypes> getErrorTypes()
public void setAppliesTo(String appliesTo)
appliesTo
- The sequence of references to cell ranges over which this ignored error is applied.IllegalArgumentException
- Parameter is null
or empty string.public void setErrorTypes(EnumSet<IgnoredErrorTypes> ignoredErrorTypes)
ignoredErrorTypes
- The ignored error types.public String toString()
String
that represents this IgnoredError
instance.
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
toString
in class Object
String
that represents this IgnoredError
instance.© GemBox d.o.o. — All rights reserved.