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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
For each key that this action wants to be notified for this method is called.protected abstract void
inform
(String key, WalkList.WalkResult foundValue) long
abstract boolean
Called after all nodes have been notified.protected abstract org.antlr.v4.runtime.ParserRuleContext
void
reset()
protected abstract void
setFixedValue
(String newFixedValue) void
setVerbose
(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
-