Package org.jxls.command
Class IfCommand
java.lang.Object
org.jxls.command.AbstractCommand
org.jxls.command.IfCommand
- All Implemented Interfaces:
Command
Implements if-else logic
- Author:
- Leonid Vysochyn
-
Field Summary
FieldsFields inherited from class org.jxls.command.AbstractCommand
areaListFields inherited from interface org.jxls.command.Command
ADJACENT_SHIFT_MODE, INNER_SHIFT_MODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an area to this commandApplies a command at the given cell referenceGets test condition as JEXL expression stringGets an area to render when the condition is evaluated to 'false'Gets an area to render when the condition is evaluated to 'true'getName()voidsetCondition(String condition) Sets test condition as JEXL expression stringMethods inherited from class org.jxls.command.AbstractCommand
getAreaList, getLockRange, getLogger, getShiftMode, getTransformer, reset, setLockRange, setLockRange, setShiftMode, transformToIterableObject
-
Field Details
-
COMMAND_NAME
- See Also:
-
-
Constructor Details
-
IfCommand
public IfCommand() -
IfCommand
- Parameters:
condition- JEXL expression for boolean condition to evaluate
-
IfCommand
-
IfCommand
-
-
Method Details
-
getName
- Returns:
- command name
-
getCondition
Gets test condition as JEXL expression string- Returns:
- test condition
-
setCondition
Sets test condition as JEXL expression string- Parameters:
condition- condition to test
-
getIfArea
Gets an area to render when the condition is evaluated to 'true'- Returns:
- if Area
-
getElseArea
Gets an area to render when the condition is evaluated to 'false'- Returns:
- else Area
-
addArea
Description copied from interface:CommandAdds an area to this command- Specified by:
addAreain interfaceCommand- Overrides:
addAreain classAbstractCommand- Parameters:
area- to be added area- Returns:
- this command instance
-
applyAt
Description copied from interface:CommandApplies a command at the given cell reference- Parameters:
cellRef- cell reference where the command must be appliedcontext- bean context to use- Returns:
- size of enclosing command area after transformation
-