org.apache.juneau.html.HtmlDocTemplate Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.html;
/**
* Defines the interface for rendering the contents of an HTML page produced by the {@link HtmlDocSerializer}
* serializer.
*
*
* The HTML doc serializer produces the following document structure with the typical contents:
*
* <html>
* <head>
* <style>
* CSS styles and links to stylesheets
* </style>
* <script>
* Javascript
* </script>
* </head>
* <body>
* <header>
* <h1>Page title </h1>
* <h2>Page description </h2>
* Arbitrary page branding
* </header>
* <nav>
* Page links
* </nav>
* <aside>
* Side-bar page links
* </aside>
* <article>
* Contents of serialized object
* </article>
* <footer>
* Footer message
* </footer>
* </body>
* </html>
*
*
*
* This interface allows you to control how these sections get rendered.
*/
public interface HtmlDocTemplate {
/**
* Renders the contents of the <head>
element.
*
* @param session The current serializer session.
* @param w The writer being written to.
* @param o The object being serialized.
* @throws Exception Any exception can be thrown.
*/
public void writeTo(HtmlDocSerializerSession session, HtmlWriter w, Object o) throws Exception;
}