Class AbstractFeed

  • All Implemented Interfaces:
    Feed
    Direct Known Subclasses:
    AtomFeed, RssFeed

    public abstract class AbstractFeed
    extends java.lang.Object
    implements Feed
    The AbstractFeed serves as a base for classes printing resources as feeds.
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Returns the content type of the feed.
        Specified by:
        getContentType in interface Feed
        Returns:
        The type
      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
        Returns the character encoding of the feed.
        Specified by:
        getCharacterEncoding in interface Feed
        Returns:
        The encoding
      • printEntry

        public void printEntry​(Resource res)
                        throws java.io.IOException
        Prints the specified resource as a feed entry
        Specified by:
        printEntry in interface Feed
        Parameters:
        res - the resource
        Throws:
        java.io.IOException - If output fails
      • printChildEntries

        public void printChildEntries()
                               throws java.io.IOException
        Prints the children of the current resource as feed entries
        Specified by:
        printChildEntries in interface Feed
        Throws:
        java.io.IOException - If output fails
      • printChildEntries

        public void printChildEntries​(int max)
                               throws java.io.IOException
        Prints the children of the current resource as feed entries
        Specified by:
        printChildEntries in interface Feed
        Parameters:
        max - The maximum number of entries
        Throws:
        java.io.IOException - If output fails
      • printEntries

        public void printEntries​(java.util.Iterator<Resource> iter)
                          throws java.io.IOException
        Prints the specified resources as feed entries
        Specified by:
        printEntries in interface Feed
        Parameters:
        iter - The resources
        Throws:
        java.io.IOException - If output fails
      • printEntries

        public void printEntries​(java.util.Iterator<Resource> iter,
                                 int max)
                          throws java.io.IOException
        Prints the specified resources as feed entries
        Specified by:
        printEntries in interface Feed
        Parameters:
        iter - The resources
        max - The maximum number of entries
        Throws:
        java.io.IOException - If output fails
      • printFooter

        public void printFooter()
                         throws java.io.IOException
        Writes the feed footer.
        Specified by:
        printFooter in interface Feed
        Throws:
        java.io.IOException - If output fails