Interface Outputable

  • All Superinterfaces:
    EntityProvider, Formats
    All Known Subinterfaces:
    OutputFormattable, OutputSerializable, RESTful

    public interface Outputable
    extends EntityProvider, Formats
    These entities can be returned as certain output formats which are handled automatically
    If you want to define the data that is returned instead of using the internal methods then use OutputFormattable

    NOTE: By default all entity view requests go through to the available access providers: EntityViewAccessProvider or HttpServletAccessProvider NOTE: there is no internal handling of HTML, it will always redirect to the the available access provider if there is one (if there is not one then the entity will be toStringed)
    Author:
    Aaron Zeckoski (aaron@caret.cam.ac.uk)
    • Method Detail

      • getHandledOutputFormats

        String[] getHandledOutputFormats()
        Defines the output format types (extensions) handled by this provider
        NOTE: In the case of an entity view the extension which goes on the end of an entity URL (after a ".") indicates the return type
        WARNING: This combines with the access interface when http requests are being processed, all requests will pass through to the EntityViewAccessProvider if they are not handled
        Returns:
        an array containing the extension formats (from Formats) handled
        OR empty array to indicate all are handled (note that the internal formatter will throw exceptions when it cannot handle a type)
        OR null to indicate none are handled (same as not implementing AccessFormats)
        NOTE: use the constants (example: Formats.HTML) or feel free to make up your own if you like