Class XMLResourceLoader

java.lang.Object
org.faceless.publisher.ext.XMLResourceLoader
All Implemented Interfaces:
ResourceLoader

public class XMLResourceLoader extends Object implements ResourceLoader

A top-level ResourceLoader for loading HTML, XML and SVG documents for processing with BFO Publisher. Matches "text/html", "application/xhtml+xml", "text/xml", "application/xml" and "image/svg+xml".

This is the main loader type for doucments

  • Constructor Details

    • XMLResourceLoader

      public XMLResourceLoader()
  • Method Details

    • supports

      public boolean supports(ResourceDescriptor descriptor)
      This class can create ReportConfiguration objects from xml, html and svg input.
      Specified by:
      supports in interface ResourceLoader
    • load

      public ResourceFlavor load(ResourceDescriptor descriptor, Resource resource, URL2Connection con) throws IOException
      Description copied from interface: ResourceLoader
      Attempt to load a Resource from the specified URL2Connection. If the ResourceLoader applies (it should test the resource mediatype and class) then it should load the resource from the URL. If the URI has a fragment and the loaded resource to ALL fragments, it should change the URI to have no fragment. Likewise if any aspect of the MediaType does not apply (i.e. the encoding) then it should remove it, so the Resource describes the widest possible URI and MediaType that would match this object. Finally, on success this method should set the Object on the resource, or throw an exception on failure. The supplied "con" will have an InputStream that is mark-capable already. If the stream is a gzip or brotli compresed stream, decompression will already be applied. The mediatype wil be set on "d". Returning null from this object is considered an error condition - if that happens we shouldn't have got here, and the only reason we did was because "supports" for the same descriptor returned true.
      Specified by:
      load in interface ResourceLoader
      Parameters:
      descriptor - the descriptor of what type of flavor we want.
      resource - the Resource we're populating
      con - the URLConnection to load the resource from
      Returns:
      the new Flavor, or null if it doesn't apply.
      Throws:
      IOException