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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceContext 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
nullor 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
DiscoverySelectorIdentifierhas a prefix that matches the value returned bygetPrefix().- Parameters:
identifier- theDiscoverySelectorIdentifierto parsecontext- theDiscoverySelectorIdentifierParser.Contextto use for parsing- Returns:
- an
Optionalcontaining the parsedDiscoverySelector; nevernullbut potentially empty
-