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
DiscoverySelectorIdentifiers
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 can handle.Optional
<? extends DiscoverySelector> parse
(DiscoverySelectorIdentifier identifier, DiscoverySelectorIdentifierParser.Context context) Parse the suppliedDiscoverySelectorIdentifier
.
-
Method Details
-
getPrefix
String getPrefix()Get the prefix that this parser can handle.- Returns:
- the prefix that this parser can handle; never
null
-
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
-