Class EventDrivenParser
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.functor.parser.event.EventDrivenParser
-
public class EventDrivenParser extends Object
An event driven parser for functors. Note that this does allow for escape characters. Any single character preceeded by a backslash will be passed along unaltered.Created by Jeff Gaynor
on 7/16/18 at 11:27 AM
-
-
Field Summary
Fields Modifier and Type Field Description boolean
debugOn
static char
escapeChar
-
Constructor Summary
Constructors Constructor Description EventDrivenParser()
EventDrivenParser(JFunctorFactory functorFactory)
Create and initialize this parser.
-
Method Summary
-
-
-
Field Detail
-
escapeChar
public static final char escapeChar
- See Also:
- Constant Field Values
-
debugOn
public boolean debugOn
-
-
Constructor Detail
-
EventDrivenParser
public EventDrivenParser()
-
EventDrivenParser
public EventDrivenParser(JFunctorFactory functorFactory)
Create and initialize this parser.- Parameters:
functorFactory
-
-
-
Method Detail
-
reset
public void reset()
Completely reset the internal state of this parser.
-
addBraceListener
public void addBraceListener(DelimiterListener d)
-
addCommaListener
public void addCommaListener(CommaListener c)
-
removeCommaListener
public void removeCommaListener(CommaListener c)
-
removeDQListener
public void removeDQListener(DoubleQuoteListener d)
-
removeBracketListener
public void removeBracketListener(DelimiterListener d)
-
removeBraceListener
public void removeBraceListener(DelimiterListener d)
-
removeParenthesisListener
public void removeParenthesisListener(DelimiterListener d)
-
addDoubleQuoteListener
public void addDoubleQuoteListener(DoubleQuoteListener d)
-
addBracketListener
public void addBracketListener(DelimiterListener d)
-
addParenthesisListener
public void addParenthesisListener(DelimiterListener d)
-
notifyOpenListeners
protected void notifyOpenListeners(LinkedList<DelimiterListener> listeners, DelimiterEvent event)
-
notifyCloseListeners
protected void notifyCloseListeners(LinkedList<DelimiterListener> listeners, DelimiterEvent event)
-
notifyCommaListeners
protected void notifyCommaListeners(LinkedList<CommaListener> listeners, CommaEvent event)
-
notifyDQListeners
protected void notifyDQListeners(LinkedList<DoubleQuoteListener> listeners, DoubleQuoteEvent event)
-
getSwitchHandler
public SwitchHandler getSwitchHandler()
-
getFunctorHandler
public FunctorHandler getFunctorHandler()
-
getConditionalHandler
public ConditionalHandler getConditionalHandler()
-
execute
protected void execute()
-
getFunctor
public JFunctor getFunctor()
-
init
public void init(String raw)
If you prefer to create theSwitchHandler
yourself, pass it in. You can always get it back after parsing viagetSwitchHandler()
.- Parameters:
raw
-
-
getType
protected int getType(String raw)
The parser is rather stupid on purpose. It can evolve but for now, the strict format is all that is allowed. This method is a very simple-minded way to turn a simple functor or even simple conditional into something the parser understands. It should be amended, improved and replaced as time goes on.- Parameters:
raw
-- Returns:
-
parse
public AbstractHandler parse(String input)
-
parse
public AbstractHandler parse(String input, Map<String,String> replacements)
Parse a single line. If you supply a map of replacements with key-value pairs, then every occurance of the form ${key} will be replaced by its value. E.g. if
key = vo value = voPersonExternalID
then the following transformation on the input lineget("${vo}");
would result in the execution ofget("voPersonExternalID");
You may set these values with thejsetEnv
function in your script.- Parameters:
input
-replacements
-- Returns:
-
hasSwitch
public boolean hasSwitch()
-
hasConditional
public boolean hasConditional()
-
hasFunctor
public boolean hasFunctor()
-
-