Interface ModuleKeyFactory

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface ModuleKeyFactory
    extends java.lang.AutoCloseable
    A factory for ModuleKeys.
    • Method Detail

      • create

        java.util.Optional<ModuleKey> create​(java.net.URI uri)
                                      throws java.net.URISyntaxException
        Returns a ModuleKey for the given absolute normalized URI, or Optional.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. SecurityManager checks for the returned module will be performed by clients of this method.

        Throws URISyntaxException if 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 in ModuleKeyFactories for which factories need to be closed.
        Specified by:
        close in interface java.lang.AutoCloseable