Package org.revapi
Interface ElementMatcher
-
- All Superinterfaces:
AutoCloseable
,Configurable
- All Known Implementing Classes:
BaseElementMatcher
public interface ElementMatcher extends Configurable, AutoCloseable
An element matcher is a helper extension to other extensions that need to figure out if a certain element meets certain criteria.- Author:
- Lukas Krejci
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ElementMatcher.CompiledRecipe
A "compiled" representation of a textual recipe.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<ElementMatcher.CompiledRecipe>
compile(String recipe)
Tries to compile the provided recipe into a form that can test individual elements.String
getMatcherId()
This is distinct from theConfigurable.getExtensionId()
, because it identifies the matcher in the "use" positions somewhere inside the configuration of other extensions.-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface org.revapi.configuration.Configurable
getExtensionId, getJSONSchema, initialize
-
-
-
-
Method Detail
-
getMatcherId
String getMatcherId()
This is distinct from theConfigurable.getExtensionId()
, because it identifies the matcher in the "use" positions somewhere inside the configuration of other extensions. TheextensionId
can be used for identifying the element matcher itself in the analysis configuration or pipeline configuration.- Returns:
-
compile
Optional<ElementMatcher.CompiledRecipe> compile(String recipe)
Tries to compile the provided recipe into a form that can test individual elements.- Parameters:
recipe
- the recipe to compile- Returns:
- a compiled recipe or empty optional if the string cannot be compiled by this matcher
-
-