Module org.junit.platform.engine
Interface DiscoverySelectorIdentifierParser
- All Known Implementing Classes:
ClasspathResourceSelector.IdentifierParser
,ClasspathRootSelector.IdentifierParser
,ClassSelector.IdentifierParser
,DirectorySelector.IdentifierParser
,FileSelector.IdentifierParser
,IterationSelector.IdentifierParser
,MethodSelector.IdentifierParser
,ModuleSelector.IdentifierParser
,NestedClassSelector.IdentifierParser
,NestedMethodSelector.IdentifierParser
,PackageSelector.IdentifierParser
,UniqueIdSelector.IdentifierParser
,UriSelector.IdentifierParser
Parser for a
DiscoverySelectorIdentifier
with a specific prefix.
Implementations of this interface can be registered using the Java service
loader mechanism to extend the set of supported prefixes for
DiscoverySelectorIdentifiers
.
- Since:
- 1.11
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Context for parsingDiscoverySelectorIdentifiers
. -
Method Summary
Modifier and TypeMethodDescriptionGet the prefix that this parser supports.Optional
<? extends DiscoverySelector> parse
(DiscoverySelectorIdentifier identifier, DiscoverySelectorIdentifierParser.Context context) Parse the suppliedDiscoverySelectorIdentifier
.
-
Method Details
-
getPrefix
String getPrefix()Get the prefix that this parser supports.- Returns:
- the prefix that this parser supports; never
null
or blank
-
parse
Optional<? extends DiscoverySelector> parse(DiscoverySelectorIdentifier identifier, DiscoverySelectorIdentifierParser.Context context) Parse the suppliedDiscoverySelectorIdentifier
.The JUnit Platform will only invoke this method if the supplied
DiscoverySelectorIdentifier
has a prefix that matches the value returned bygetPrefix()
.- Parameters:
identifier
- theDiscoverySelectorIdentifier
to parsecontext
- theDiscoverySelectorIdentifierParser.Context
to use for parsing- Returns:
- an
Optional
containing the parsedDiscoverySelector
; nevernull
but potentially empty
-