Class MatcherAction
- java.lang.Object
-
- nl.basjes.parse.useragent.analyze.MatcherAction
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MatcherExtractAction
,MatcherFailIfFoundAction
,MatcherRequireAction
,MatcherVariableAction
public abstract class MatcherAction extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Matcher
matcher
protected boolean
mustHaveMatches
-
Constructor Summary
Constructors Constructor Description MatcherAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
destroy()
MatchesList
getMatches()
String
getMatchExpression()
void
inform(String key, String value, org.antlr.v4.runtime.tree.ParseTree result)
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
initialize()
abstract boolean
obtainResult()
Called after all nodes have been notified.protected abstract org.antlr.v4.runtime.ParserRuleContext
parseWalkerExpression(UserAgentTreeWalkerParser parser)
void
reset()
protected abstract void
setFixedValue(String newFixedValue)
void
setVerbose(boolean newVerbose, boolean temporary)
String
toString()
-
-
-
Field Detail
-
matcher
protected Matcher matcher
-
mustHaveMatches
protected boolean mustHaveMatches
-
-
Method Detail
-
destroy
public void destroy()
-
setVerbose
public void setVerbose(boolean newVerbose, boolean temporary)
-
getMatchExpression
public String getMatchExpression()
-
initialize
public long initialize()
-
parseWalkerExpression
protected abstract org.antlr.v4.runtime.ParserRuleContext parseWalkerExpression(UserAgentTreeWalkerParser parser)
-
setFixedValue
protected abstract void setFixedValue(String newFixedValue)
-
inform
public void inform(String key, String value, org.antlr.v4.runtime.tree.ParseTree result)
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
protected abstract void inform(String key, WalkList.WalkResult foundValue)
-
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
public MatchesList getMatches()
-
-