1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the License). You may not use this file except in 5 * compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or 9 * glassfish/bootstrap/legal/CDDLv1.0.txt. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * Header Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by 18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]" 20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 22 */ 23 package com.sun.enterprise.diagnostics.report.html; 24 25 /** 26 * Encapsulate a single HTML document. This holds a single HTML 27 * element with head and body elements, and allows specifying the 28 * document type. 29 */ 30 public interface Document extends HTMLComponent { 31 32 /** 33 * Get the body element of this HTML document. 34 * @return The body element. 35 */ 36 public Element getBody(); 37 38 /** 39 * Get the head element of this HTML document. 40 * @return The head element. 41 */ 42 public Element getHead(); 43 44 /** 45 * Replace the content of this document with the specified 46 * head and body. 47 * 48 * If the head element does not have the name HEAD, or the body 49 * element does not have the name BODY, then an additional, new 50 * element is created with the appropriate name, and the input 51 * element is added to this element. 52 * @param head A new head element. 53 * @param body A new body element. 54 * @return This document. 55 */ 56 public void set(Element head, Element body); 57 58 /** 59 * Get the current doctype string. 60 * @return The current doctype string. 61 * @see #setDoctype(String) 62 */ 63 public String getDoctype(); 64 65 /** 66 * Explicitly set the doctype of this document. Right now the 67 * raw doctype string is given. It will be converted into a line 68 * of the form:<br/> 69 * <code><!DOCTYPE html PUBLIC "<em>raw</em>"></code> 70 * <p> 71 * This is not very flexible; perhaps this should be re-visited in 72 * the future. 73 * @param raw The raw doctype string. 74 * @return This document. 75 */ 76 public void setDoctype(String raw); 77 } 78