| // *************************************************************************************************************************** |
| // * 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. |
| * |
| * <p> |
| * The HTML doc serializer produces the following document structure with the typical contents: |
| * <p class='bcode w800'> |
| * <xt><html> |
| * <head> |
| * <style> |
| * <xv>CSS styles and links to stylesheets</xv> |
| * </style> |
| * <script> |
| * <xv>Javascript</xv> |
| * </script> |
| * </head> |
| * <body> |
| * <header> |
| * <h1><xv>Page title</xv></h1> |
| * <h2><xv>Page description</xv></h2> |
| * <xv>Arbitrary page branding</xv> |
| * </header> |
| * <nav> |
| * <xv>Page links</xv> |
| * </nav> |
| * <aside> |
| * <xv>Side-bar page links</xv> |
| * </aside> |
| * <article> |
| * <xv>Contents of serialized object</xv> |
| * </article> |
| * <footer> |
| * <xv>Footer message</xv> |
| * </footer> |
| * </body> |
| * </html></xt> |
| * </p> |
| * |
| * <p> |
| * This interface allows you to control how these sections get rendered. |
| */ |
| public interface HtmlDocTemplate { |
| |
| /** |
| * Represents a non-existent doc template. |
| */ |
| public interface Null extends HtmlDocTemplate {} |
| |
| /** |
| * Renders the contents of the <code><xt><head></xt></code> 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; |
| } |