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 voidcloseDelimiter(DelimiterEvent delimeterEvent)JFunctorImplgetCurrentBlock()FunctorHandlergetFunctorHandler()intgetHandlerType()Allows for determining the type of handler without resorting to a lot of java class operations.protected JFunctorgetjFunctor(String name)LogicBlockgetLogicBlock()Call this absolutely last since it has to have all the parts to assemble itself.voidgotComma(CommaEvent commaEvent)voidopenDelimiter(DelimiterEvent delimeterEvent)voidreset()voidsetFunctorHandler(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:AbstractHandlerAllows for determining the type of handler without resorting to a lot of java class operations.- Specified by:
getHandlerTypein 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:
openDelimiterin interfaceDelimiterListener- Overrides:
openDelimiterin classAbstractHandler
-
closeDelimiter
public void closeDelimiter(DelimiterEvent delimeterEvent)
- Specified by:
closeDelimiterin interfaceDelimiterListener- Overrides:
closeDelimiterin classAbstractHandler
-
gotComma
public void gotComma(CommaEvent commaEvent)
- Specified by:
gotCommain interfaceCommaListener
-
reset
public void reset()
- Specified by:
resetin interfaceDelimiterListener- Overrides:
resetin classAbstractHandler
-
-