Class ResourceFlavorDescriptor

java.lang.Object
org.faceless.publisher.resource.ResourceFlavorDescriptor

public class ResourceFlavorDescriptor extends Object
Describes a ResourceFlavor. This fully describes the Resource requested by the Report, and is used by a ResourceLoader to determine whether it can load for this object or not.
  • Constructor Details

    • ResourceFlavorDescriptor

      public ResourceFlavorDescriptor(ReportFactory reportFactory, String fragment, Class<?> resourceClass, Class<? extends ReportOutput> outputClass, MediaType mediaType)
      Create a new ResourceFlavorDescriptor
      Parameters:
      reportFactory - the factory
      fragment - the URI fragment
      resourceClass - the Class of the Resource object
      outputClass - the ReportOutput type this Resource is for
      mediaType - the mediaType
    • ResourceFlavorDescriptor

      public ResourceFlavorDescriptor(ReportFactory reportFactory, String fragment, Class<?>[] resourceClasses, Class<? extends ReportOutput> outputClass, MediaType mediaType)
      Create a new ResourceFlavorDescriptor
      Parameters:
      reportFactory - the factory
      fragment - the URI fragment
      resourceClasses - the list of acceptable Classes of the Resource object
      outputClass - the ReportOutput type this Resource is for
      mediaType - the mediaType
  • Method Details

    • getReportFactory

      public ReportFactory getReportFactory()
      Return the ReportFactory passed into the constructor
    • getMediaType

      public MediaType getMediaType()
      Return the MediaType passed into the constructor
    • getAccept

      public String getAccept()
      Return the "Accept" header that should be sent with this ResourceFlavorDescriptor.
    • getAcceptLanguage

      public String getAcceptLanguage()
      Return the "Accept-Language" header that should be sent with this ResourceFlavorDescriptor.
    • getFragment

      public String getFragment()
      Return the Fragment passed into the constructor
    • getResourceClasses

      public Collection<Class<?>> getResourceClasses()
      Return the list of Class objects passed into the constructor
    • wouldAccept

      public boolean wouldAccept(Class<?>... classList)
      Return true if this ResourceFlavorDescriptor would accept a resource of the specified class
    • wouldAcceptObject

      public boolean wouldAcceptObject(Object object)
      Return true if this ResourceFlavorDescriptor would accept the specified Object
    • getOutputClass

      public Class<? extends ReportOutput> getOutputClass()
      Return the ReportOutput passed into the constructor
    • toString

      public String toString()
      Overrides:
      toString in class Object