Class BasicHtmlDocTemplate

java.lang.Object
org.apache.juneau.html.BasicHtmlDocTemplate
All Implemented Interfaces:
HtmlDocTemplate

public class BasicHtmlDocTemplate extends Object implements HtmlDocTemplate
A basic template for the HTML doc serializer.

This class can be subclassed to customize page rendering.

See Also:
  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Description copied from interface: HtmlDocTemplate
      Renders the contents of the <head> element.
      Specified by:
      writeTo in interface HtmlDocTemplate
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • head

      protected void head(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <head> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • style

      protected void style(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <head>/<style> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • script

      protected void script(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <head>/<script> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • body

      protected void body(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <body> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • header

      protected void header(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <body>/<header> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • aside

      protected void aside(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <body>/<aside> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • article

      protected void article(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <body>/<article> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • footer

      protected void footer(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception
      Renders the contents of the <body>/<footer> element.
      Parameters:
      session - The current serializer session.
      w - The writer being written to.
      o - The object being serialized.
      Throws:
      Exception - Any exception can be thrown.
    • hasStyle

      protected boolean hasStyle(HtmlDocSerializerSession session)
      Returns true if this page should render a <head>/<style> element.
      Parameters:
      session - The current serializer session.
      Returns:
      A boolean flag.
    • hasScript

      protected boolean hasScript(HtmlDocSerializerSession session)
      Returns true if this page should render a <head>/<script> element.
      Parameters:
      session - The current serializer session.
      Returns:
      A boolean flag.
    • hasHeader

      protected boolean hasHeader(HtmlDocSerializerSession session)
      Returns true if this page should render a <body>/<header> element.
      Parameters:
      session - The current serializer session.
      Returns:
      A boolean flag.
    • hasNav

      protected boolean hasNav(HtmlDocSerializerSession session)
      Returns true if this page should render a <body>/<nav> element.
      Parameters:
      session - The current serializer session.
      Returns:
      A boolean flag.
    • hasAside

      protected boolean hasAside(HtmlDocSerializerSession session)
      Returns true if this page should render a <body>/<aside> element.
      Parameters:
      session - The current serializer session.
      Returns:
      A boolean flag.
    • hasFooter

      protected boolean hasFooter(HtmlDocSerializerSession session)
      Returns true if this page should render a <body>/<footer> element.
      Parameters:
      session - The current serializer session.
      Returns:
      A boolean flag.