KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > text > html > parser > TagElement


1 /*
2  * @(#)TagElement.java 1.11 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.text.html.parser;
9
10 import javax.swing.text.html.HTML JavaDoc;
11 /**
12  * A generic HTML TagElement class. The methods define how white
13  * space is interpreted around the tag.
14  *
15  * @version 1.11, 12/19/03
16  * @author Sunita Mani
17  */

18
19 public class TagElement {
20
21     Element JavaDoc elem;
22     HTML.Tag JavaDoc htmlTag;
23     boolean insertedByErrorRecovery;
24
25     public TagElement ( Element JavaDoc elem ) {
26     this(elem, false);
27     }
28
29     public TagElement (Element JavaDoc elem, boolean fictional) {
30     this.elem = elem;
31     htmlTag = HTML.getTag(elem.getName());
32     if (htmlTag == null) {
33         htmlTag = new HTML.UnknownTag JavaDoc(elem.getName());
34     }
35     insertedByErrorRecovery = fictional;
36     }
37
38     public boolean breaksFlow() {
39     return htmlTag.breaksFlow();
40     }
41
42     public boolean isPreformatted() {
43     return htmlTag.isPreformatted();
44     }
45
46     public Element JavaDoc getElement() {
47     return elem;
48     }
49
50     public HTML.Tag JavaDoc getHTMLTag() {
51     return htmlTag;
52     }
53
54     public boolean fictional() {
55     return insertedByErrorRecovery;
56     }
57 }
58
59
60
61
62
Popular Tags