Interface ResourceFlavor


public interface ResourceFlavor
A Resource may have one or more ResourceFlavors
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the specified object.
    default boolean
    Return true if the connection supplied to the loader to load this flavor should be left to linger.
    default boolean
    Return true if this object can only be used once - i.e. it's a stream.
    boolean
    Return true if this ResourceDescriptor can return an object of the specified type.
  • Method Details

    • supports

      boolean supports(ResourceDescriptor d)
      Return true if this ResourceDescriptor can return an object of the specified type.
    • getObject

      Object getObject(ResourceDescriptor d, Resource resource, Report report) throws Exception
      Return the specified object. Note that the flavor must never, ever return a type that wouldn't claim to be supported by supports(org.faceless.publisher.resource.ResourceDescriptor)
      Parameters:
      d - the ResourceDescriptor
      resource - the Resource
      report - the Report requesting the object
      Throws:
      Exception
    • isLingering

      default boolean isLingering()
      Return true if the connection supplied to the loader to load this flavor should be left to linger. This is false (the default) unless this makes use of partial loading, as it does for (eg) loading PDFs
    • isSingleUse

      default boolean isSingleUse()
      Return true if this object can only be used once - i.e. it's a stream. It will never be cached