Interface Template<D>

  • Type Parameters:
    D - The type of domain object to replace with text
    All Known Implementing Classes:
    FixedHeaderAndFooterTemplate

    public interface Template<D>
    A pattern for writing variable strings based on domain objects.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void writeFooter​(java.io.PrintWriter writer)
      Write the closing text.
      void writeHeader​(java.io.PrintWriter writer)
      Write the starting text.
      void writeRow​(D domainObject, java.util.Map<java.lang.String,​ContentInfo> contentInfo, java.io.PrintWriter writer)
      Write the template text with placeholders replaced by the given values.
    • Method Detail

      • writeHeader

        void writeHeader​(java.io.PrintWriter writer)
                  throws java.io.IOException
        Write the starting text.
        Parameters:
        writer - The writer to write to
        Throws:
        java.io.IOException - When an I/O error occurs
      • writeRow

        void writeRow​(D domainObject,
                      java.util.Map<java.lang.String,​ContentInfo> contentInfo,
                      java.io.PrintWriter writer)
               throws java.io.IOException
        Write the template text with placeholders replaced by the given values.
        Parameters:
        domainObject - The domain object which will be used as a basis for replacement of placeholders in the template with actual values
        contentInfo - Reference information and hashes for content associated with the domain object
        writer - The writer to write to
        Throws:
        java.io.IOException - When an I/O error occurs
      • writeFooter

        void writeFooter​(java.io.PrintWriter writer)
                  throws java.io.IOException
        Write the closing text.
        Parameters:
        writer - The writer to write to
        Throws:
        java.io.IOException - When an I/O error occurs