Interface ClassResolver.ClassUriImporter

Enclosing interface:
ClassResolver

@PublicAPI(usage=ACCESS)
public static interface ClassResolver.ClassUriImporter
Provides a way to import a JavaClass from a given URI.
See Also:
tryImport(URI)
  • Method Summary

    Modifier and Type Method Description
    Optional<JavaClass> tryImport​(java.net.URI uri)
    Try to import a JavaClass from the given URI, i.e.
  • Method Details

    • 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()