Class ResourceDescriptor

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

public class ResourceDescriptor extends Object
Describes a Resource. 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

    • ResourceDescriptor

      public ResourceDescriptor(ResourceDescriptor descriptor, Class<?>... resourceClasses)
    • ResourceDescriptor

      public ResourceDescriptor(ReportFactory reportFactory, Class<?>... resourceClasses)
    • ResourceDescriptor

      public ResourceDescriptor(Class<?>... resourceClasses)
      Create a new ResourceDescriptor
      Parameters:
      reportFactory - the factory
      url - the URL
      resourceClasses - the class-list that the resource must match
  • Method Details

    • withURL

      public ResourceDescriptor withURL(URL2 url)
    • withMediaType

      public ResourceDescriptor withMediaType(MediaType mediaType)
      Create a new ResourceDescriptor that is this one with the specified MediaType
    • withProcessingInstructions

      public ResourceDescriptor withProcessingInstructions(List<ProcessingInstruction> processingInstructions)
      Create a new ResourceDescriptor that is this one with the specified list of document Processing Instructions
    • withAccept

      public ResourceDescriptor withAccept(String accept)
      Create a new ResourceDescriptor that is this one with the specified "accept" header
    • withAcceptLanguage

      public ResourceDescriptor withAcceptLanguage(String acceptLanguage)
      Create a new ResourceDescriptor that is this one with the specified "accept-language" header
    • withLinkParameters

      public ResourceDescriptor withLinkParameters(Map<String,List<? extends Term>> params)
      Create a new ResourceDescriptor that is this one with the specified linked params
    • withDocument

      public ResourceDescriptor withDocument(org.faceless.publisher.Document document)
    • withOutputClass

      public ResourceDescriptor withOutputClass(Class<? extends ReportOutput> outputClass)
    • withDefaultCharset

      public ResourceDescriptor withDefaultCharset(String charset)
    • withoutWarning

      public ResourceDescriptor withoutWarning(int warning)
      Create a new ResourceDescriptor that is this one with the specified warning disabled
    • getReportFactory

      public ReportFactory getReportFactory()
      Return the ReportFactory
    • getURL

      public URL2 getURL()
      Return the URL
    • getFragment

      public String getFragment()
      Return the URL fragment
    • getMediaType

      public MediaType getMediaType()
      Return the MediaType
    • getAccept

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

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

      public String getDefaultCharset()
      Return the default charset
    • getResourceClasses

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

      public Class<? extends ReportOutput> getOutputClass()
    • getProcessingInstructions

      public List<ProcessingInstruction> getProcessingInstructions()
      Return the list of Class objects passed into the constructor
    • wouldAccept

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

      public boolean wouldBeAcceptedBy(Class<?>... classList)
      Return true if the output accepted by this ResourceDescriptor would be accepted by the supplied Class (opposite of wouldAccept)
    • wouldAcceptObject

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

      public boolean isWarning(int warning)
    • getLinkParameters

      public Map<String,List<? extends Term>> getLinkParameters()
    • getLinkParametersAsStylesheet

      public static URL2 getLinkParametersAsStylesheet(Map<String,List<? extends Term>> params)
    • toString

      public String toString()
      Overrides:
      toString in class Object