bpatel@766: /* bpatel@766: * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. bpatel@766: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. bpatel@766: * bpatel@766: * This code is free software; you can redistribute it and/or modify it bpatel@766: * under the terms of the GNU General Public License version 2 only, as bpatel@766: * published by the Free Software Foundation. Oracle designates this bpatel@766: * particular file as subject to the "Classpath" exception as provided bpatel@766: * by Oracle in the LICENSE file that accompanied this code. bpatel@766: * bpatel@766: * This code is distributed in the hope that it will be useful, but WITHOUT bpatel@766: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or bpatel@766: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License bpatel@766: * version 2 for more details (a copy is included in the LICENSE file that bpatel@766: * accompanied this code). bpatel@766: * bpatel@766: * You should have received a copy of the GNU General Public License version bpatel@766: * 2 along with this work; if not, write to the Free Software Foundation, bpatel@766: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. bpatel@766: * bpatel@766: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA bpatel@766: * or visit www.oracle.com if you need additional information or have any bpatel@766: * questions. bpatel@766: */ bpatel@766: bpatel@766: package com.sun.tools.doclets.formats.html.markup; bpatel@766: bpatel@766: /** bpatel@766: * Enum representing HTML tags. bpatel@766: * bpatel@766: * @author Bhavesh Patel bpatel@766: */ bpatel@766: public enum HtmlTag { bpatel@766: A(BlockType.INLINE, EndTag.END), bpatel@766: BLOCKQUOTE, bpatel@766: BODY(BlockType.OTHER, EndTag.END), bpatel@766: BR(BlockType.INLINE, EndTag.NOEND), bpatel@766: CAPTION, bpatel@766: CENTER, bpatel@766: CODE(BlockType.INLINE, EndTag.END), bpatel@766: DD, bpatel@766: DIV, bpatel@766: DL, bpatel@766: DT, bpatel@766: EM(BlockType.INLINE, EndTag.END), bpatel@766: FONT(BlockType.INLINE, EndTag.END), bpatel@766: FRAME(BlockType.OTHER, EndTag.NOEND), bpatel@766: FRAMESET(BlockType.OTHER, EndTag.END), bpatel@766: H1, bpatel@766: H2, bpatel@766: H3, bpatel@766: H4, bpatel@766: H5, bpatel@766: H6, bpatel@766: HEAD(BlockType.OTHER, EndTag.END), bpatel@766: HR(BlockType.BLOCK, EndTag.NOEND), bpatel@766: HTML(BlockType.OTHER, EndTag.END), bpatel@766: I(BlockType.INLINE, EndTag.END), bpatel@766: IMG(BlockType.INLINE, EndTag.NOEND), bpatel@766: LI, bpatel@766: LINK(BlockType.OTHER, EndTag.NOEND), bpatel@766: MENU, bpatel@766: META(BlockType.OTHER, EndTag.NOEND), bpatel@766: NOFRAMES(BlockType.OTHER, EndTag.END), bpatel@766: NOSCRIPT(BlockType.OTHER, EndTag.END), bpatel@766: OL, bpatel@766: P, bpatel@766: PRE, bpatel@766: SCRIPT(BlockType.OTHER, EndTag.END), bpatel@766: SMALL(BlockType.INLINE, EndTag.END), bpatel@766: SPAN(BlockType.INLINE, EndTag.END), bpatel@766: STRONG(BlockType.INLINE, EndTag.END), bpatel@766: TABLE, bpatel@766: TBODY, bpatel@766: TD, bpatel@766: TH, bpatel@766: TITLE(BlockType.OTHER, EndTag.END), bpatel@766: TR, bpatel@766: TT(BlockType.INLINE, EndTag.END), bpatel@766: UL; bpatel@766: bpatel@766: protected final BlockType blockType; bpatel@766: protected final EndTag endTag; bpatel@766: private final String value; bpatel@766: bpatel@766: /** bpatel@766: * Enum representing the type of HTML element. bpatel@766: */ bpatel@766: protected static enum BlockType { bpatel@766: BLOCK, bpatel@766: INLINE, bpatel@766: OTHER; bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Enum representing HTML end tag requirement. bpatel@766: */ bpatel@766: protected static enum EndTag { bpatel@766: END, bpatel@766: NOEND; bpatel@766: } bpatel@766: bpatel@766: HtmlTag() { bpatel@766: this(BlockType.BLOCK, EndTag.END); bpatel@766: } bpatel@766: bpatel@766: HtmlTag(BlockType blockType, EndTag endTag ) { bpatel@766: this.blockType = blockType; bpatel@766: this.endTag = endTag; bpatel@766: this.value = name().toLowerCase(); bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Returns true if the end tag is required. This is specific to the standard bpatel@766: * doclet and does not exactly resemble the W3C specifications. bpatel@766: * bpatel@766: * @return true if end tag needs to be displayed else return false bpatel@766: */ bpatel@766: public boolean endTagRequired() { bpatel@766: return (endTag == EndTag.END); bpatel@766: } bpatel@766: bpatel@766: public String toString() { bpatel@766: return value; bpatel@766: } bpatel@766: }