Interface ClassResolver.ClassUriImporter

    • Method Detail

      • tryImport

        @PublicAPI(usage=ACCESS)
        Optional<JavaClass> tryImport​(java.net.URI uri)
        Try to import a JavaClass from the given URI, i.e. open a stream and use the default core import, to create a JavaClass from it.

        NOTE: ClassUriImporter has to be resilient against errors during import, e.g. IOExceptions or MalformedURLExceptions. Errors while reading from the given URI will always result in an Optional.absent() return value, no need to catch Exceptions.
        Parameters:
        uri - The URI to import a JavaClass from
        Returns:
        Optional.of(importedClass), if the JavaClass could be successfully imported, otherwise Optional.absent()