Class MatcherAction
java.lang.Object
nl.basjes.parse.useragent.analyze.MatcherAction
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MatcherExtractAction,MatcherFailIfFoundAction,MatcherRequireAction,MatcherVariableAction
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voidFor each key that this action wants to be notified for this method is called.protected abstract voidinform(String key, WalkList.WalkResult foundValue) longabstract booleanCalled after all nodes have been notified.protected abstract org.antlr.v4.runtime.ParserRuleContextvoidreset()protected abstract voidsetFixedValue(String newFixedValue) voidsetVerbose(boolean newVerbose, boolean temporary) toString()
-
Field Details
-
matcher
-
mustHaveMatches
protected boolean mustHaveMatches
-
-
Constructor Details
-
MatcherAction
public MatcherAction()
-
-
Method Details
-
destroy
public void destroy() -
setVerbose
public void setVerbose(boolean newVerbose, boolean temporary) -
getMatchExpression
-
initialize
public long initialize() -
parseWalkerExpression
protected abstract org.antlr.v4.runtime.ParserRuleContext parseWalkerExpression(UserAgentTreeWalkerParser parser) -
setFixedValue
-
inform
For each key that this action wants to be notified for this method is called. Note that on a single parse event the same name CAN be called multiple times!!- Parameters:
key- The key of the nodevalue- The value that was foundresult- The node in the parser tree where the match occurred
-
inform
-
obtainResult
public abstract boolean obtainResult()Called after all nodes have been notified.- Returns:
- true if the obtainResult result was valid. False will fail the entire matcher this belongs to.
-
reset
public void reset() -
getMatches
-
toString
-