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
@API(status=EXPERIMENTAL,
since="1.11")
public interface DiscoverySelectorIdentifierParser
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
Nested ClassesModifier 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
-