Class ConditionalHandler
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.functor.parser.AbstractHandler
-
- edu.uiuc.ncsa.security.util.functor.parser.event.ConditionalHandler
-
- All Implemented Interfaces:
CommaListener
,DelimiterListener
,Serializable
,EventListener
public class ConditionalHandler extends AbstractHandler implements DelimiterListener, CommaListener
This handles a logic block of the form if[A]then[B}else[C]. Each of if, then, else are conditionals and a stack of which is doing what is kept. The final result i thegetLogicBlock()
call that returns the whole thing.
If this is invoked and there is no conditional stack (so against a sinple functor) then the functor handler will have that in it and you can access it that way.Created by Jeff Gaynor
on 7/16/18 at 12:00 PM- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.uiuc.ncsa.security.util.functor.parser.AbstractHandler
closeDelimiterCount, CONDITIONAL_TYPE, FUNCTOR_TYPE, openDelimiterCount, SWITCH_TYPE, used
-
-
Constructor Summary
Constructors Constructor Description ConditionalHandler(FunctorHandler functorHandler, JFunctorFactory functorFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeDelimiter(DelimiterEvent delimeterEvent)
JFunctorImpl
getCurrentBlock()
FunctorHandler
getFunctorHandler()
int
getHandlerType()
Allows for determining the type of handler without resorting to a lot of java class operations.protected JFunctor
getjFunctor(String name)
LogicBlock
getLogicBlock()
Call this absolutely last since it has to have all the parts to assemble itself.void
gotComma(CommaEvent commaEvent)
void
openDelimiter(DelimiterEvent delimeterEvent)
void
reset()
void
setFunctorHandler(FunctorHandler functorHandler)
-
Methods inherited from class edu.uiuc.ncsa.security.util.functor.parser.AbstractHandler
areDelimitersBalanced, convertType, equals, getFunctorFactory, isUsed, toString
-
-
-
-
Constructor Detail
-
ConditionalHandler
public ConditionalHandler(FunctorHandler functorHandler, JFunctorFactory functorFactory)
-
-
Method Detail
-
getFunctorHandler
public FunctorHandler getFunctorHandler()
-
setFunctorHandler
public void setFunctorHandler(FunctorHandler functorHandler)
-
getHandlerType
public int getHandlerType()
Description copied from class:AbstractHandler
Allows for determining the type of handler without resorting to a lot of java class operations.- Specified by:
getHandlerType
in classAbstractHandler
- Returns:
-
getLogicBlock
public LogicBlock getLogicBlock()
Call this absolutely last since it has to have all the parts to assemble itself.- Returns:
-
getCurrentBlock
public JFunctorImpl getCurrentBlock()
-
openDelimiter
public void openDelimiter(DelimiterEvent delimeterEvent)
- Specified by:
openDelimiter
in interfaceDelimiterListener
- Overrides:
openDelimiter
in classAbstractHandler
-
closeDelimiter
public void closeDelimiter(DelimiterEvent delimeterEvent)
- Specified by:
closeDelimiter
in interfaceDelimiterListener
- Overrides:
closeDelimiter
in classAbstractHandler
-
gotComma
public void gotComma(CommaEvent commaEvent)
- Specified by:
gotComma
in interfaceCommaListener
-
reset
public void reset()
- Specified by:
reset
in interfaceDelimiterListener
- Overrides:
reset
in classAbstractHandler
-
-