Package org.pkl.core.module
Interface ModuleKeyFactory
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface ModuleKeyFactory extends java.lang.AutoCloseableA factory forModuleKeys.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Closes this factory, releasing any resources held.java.util.Optional<ModuleKey>create(java.net.URI uri)Returns aModuleKeyfor the given absolute normalized URI, orOptional.empty()if this factory cannot handle the given URI.
-
-
-
Method Detail
-
create
java.util.Optional<ModuleKey> create(java.net.URI uri) throws java.net.URISyntaxException
Returns aModuleKeyfor the given absolute normalized URI, orOptional.empty()if this factory cannot handle the given URI.Implementations must not perform any I/O related to the given URI. For example, they must not check if the module represented by the given URI exists.
SecurityManagerchecks for the returned module will be performed by clients of this method.Throws
URISyntaxExceptionif the given URI has invalid syntax.- Parameters:
uri- an absolute normalized URI- Returns:
- a module key for the given URI
- Throws:
java.net.URISyntaxException
-
close
default void close()
Closes this factory, releasing any resources held. See the documentation of factory methods inModuleKeyFactoriesfor which factories need to be closed.- Specified by:
closein interfacejava.lang.AutoCloseable
-
-