Package ch.kk7.confij.source.any
Interface ConfijAnyResource
- All Known Implementing Classes:
ClasspathResource.AnyClasspathResource,FileResource.AnyFileResource,URLResource.AnyURLResource
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ConfijAnyResource
A resource provider basically reads a string from anywhere given an URI.
If it should work as an AnySource it should be stateless (and receive all variable input from the input URI). Additionally it
should be registered as a ConfijResourceProvider ServiceLoader.
-
Method Summary
Modifier and Type Method Description java.util.Optional<? extends ConfijResource>maybeHandle(java.lang.String pathTemplate)Receive a "preview" on the URI to be processed.
-
Method Details
-
maybeHandle
Receive a "preview" on the URI to be processed. This resouce provider can choose to accept or reject processing it. This is most commonly decided based on the URI's scheme.- Parameters:
pathTemplate- an URI to be processed later.- Returns:
- a stream of strings if this resouce provider accepts processing this URI (but it can still fail), empty if the uri doesn't look like it could be processed
-