Interface ContentLoaderBackend<InternalType>

All Known Implementing Classes:
ImageContentLoaderBackend, ImageIOLoader, ImageJLoader, SAXLoader, XhtmlContentLoaderBackend

public interface ContentLoaderBackend<InternalType>
This is an interface that should be implemented by all content loader back-ends.

All content loader back-ends that are fronted by the same ContentLoader should handle the same InternalType, which is returned by the load method.

Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the back-end is present.
    load(Object data, boolean fragment, Set<String> errors)
    Loads any kind of raw data and tries to accommodate as much as possible to return an instance of InternalType after successful loading and handling.
  • Method Details

    • isBackendPresent

      boolean isBackendPresent()
      Indicates whether the back-end is present.

      This can be important for optional libraries that should only actually try to load the data when the required classes are available in the classpath.

      Returns:
      true if the back-end is present; or

      false if this is not the case

      Since:
      1.0
    • load

      LoadedContent<InternalType> load(Object data, boolean fragment, Set<String> errors)
      Loads any kind of raw data and tries to accommodate as much as possible to return an instance of InternalType after successful loading and handling.

      Should any errors occur, then they will be added as text messages to the errors collection.

      Parameters:
      data - the raw data that has to be loaded
      fragment - true if the raw data is a fragment; or

      false if the raw data is a complete document or file

      errors - a set to which possible error messages will be added
      Returns:
      an instance of the LoadedContent with the InternalType; or

      null if the raw data couldn't be loaded

      Since:
      1.4