blob: c1a6feb7ba20c23b5562ec37a57f557614ec5553 [file] [log] [blame]
david_williams96213482004-11-11 09:07:12 +00001/*******************************************************************************
2 * Copyright (c) 2001, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 * Jens Lukowski/Innoopract - initial renaming/restructuring
11 *
12 *******************************************************************************/
david_williams4ad020f2005-04-18 08:00:30 +000013package org.eclipse.wst.xml.core.internal.provisional.document;
david_williams96213482004-11-11 09:07:12 +000014
15
16
david_williams838590b2005-04-14 14:05:08 +000017import org.w3c.dom.Attr;
18import org.w3c.dom.DOMException;
david_williams96213482004-11-11 09:07:12 +000019import org.w3c.dom.Element;
20
21/**
david_williams646a5e22005-04-02 07:16:27 +000022 * This interface provides extensions to corresponding DOM interface to enable
23 * functions for source editing and incremental parsing.
24 *
david_williams6cb26392005-06-24 20:13:29 +000025 * @plannedfor 1.0
david_williams646a5e22005-04-02 07:16:27 +000026 *
david_williams96213482004-11-11 09:07:12 +000027 */
david_williamsc39caaf2005-04-05 06:07:16 +000028public interface IDOMElement extends IDOMNode, Element {
david_williams96213482004-11-11 09:07:12 +000029
30 /**
david_williams6c3c6d02005-04-10 20:43:07 +000031 * Retuns the start offset of the end tag.
32 *
33 * ISSUE: need to sort out need for this
34 *
35 * @return int - the start offset of the end tag.
david_williams96213482004-11-11 09:07:12 +000036 */
37 int getEndStartOffset();
38
39 /**
david_williams6c3c6d02005-04-10 20:43:07 +000040 * Returns the end offset of the
david_williamsc39caaf2005-04-05 06:07:16 +000041 *
david_williams6c3c6d02005-04-10 20:43:07 +000042 * ISSUE: need to sort out need for this
43 *
44 * @return int - the end offset of the start tag.
david_williams96213482004-11-11 09:07:12 +000045 */
46 int getStartEndOffset();
47
48 /**
david_williams6c3c6d02005-04-10 20:43:07 +000049 * Returns true if has an end tag.
50 *
51 * In our source-oriented DOM, sometimes Elements are "ended", even
52 * without an explicit end tag in the source.
53 *
54 * @return true if has an end tag.
david_williams96213482004-11-11 09:07:12 +000055 */
56 boolean hasEndTag();
57
58 /**
david_williamsc39caaf2005-04-05 06:07:16 +000059 * returns true if has a start tag.
david_williams6c3c6d02005-04-10 20:43:07 +000060 *
61 * In our source-oriented DOM, a lone end tag will cause a node to be
62 * created in the tree, unlike well-formed-only DOMs.
63 *
64 * @return true if has a start tag.
david_williams96213482004-11-11 09:07:12 +000065 */
66 boolean hasStartTag();
67
68 /**
david_williams6c3c6d02005-04-10 20:43:07 +000069 * returns true if this element is a comment element
70 *
71 * @return true if this element is a comment element
david_williams96213482004-11-11 09:07:12 +000072 */
73 boolean isCommentTag();
74
75 /**
76 * isEmptyTag method
77 *
david_williams6c3c6d02005-04-10 20:43:07 +000078 * @return boolean - true if is empty tag, false otherwise
david_williams96213482004-11-11 09:07:12 +000079 */
80 boolean isEmptyTag();
81
82 /**
david_williams838590b2005-04-14 14:05:08 +000083 * Returns true if floating end tag.
david_williams6c3c6d02005-04-10 20:43:07 +000084 *
david_williams56777022005-04-11 06:21:55 +000085 * @return true if floating end tag.
david_williams96213482004-11-11 09:07:12 +000086 */
87 boolean isEndTag();
88
89 /**
90 * Returns true for "global tag" (basically, without prefix)
david_williams6c3c6d02005-04-10 20:43:07 +000091 *
92 * @return true for "global tag" (basically, without prefix)
david_williams96213482004-11-11 09:07:12 +000093 */
94 boolean isGlobalTag();
95
96 /**
david_williams6c3c6d02005-04-10 20:43:07 +000097 * Returns true for no start and the end tags in source.
david_williamsc39caaf2005-04-05 06:07:16 +000098 *
99 * Provided for some very special cases when, for example, and HTML tag is
david_williams6c3c6d02005-04-10 20:43:07 +0000100 * assumed in an HTML document that does not have a literal HTML tag.
101 *
102 * ISSUE: check with clients to see if still needed
103 *
104 * @return true or no start and the end tags in source.
david_williams96213482004-11-11 09:07:12 +0000105 */
106 boolean isImplicitTag();
107
108 /**
109 * isJSPTag method
110 *
111 * @return boolean
david_williamsc39caaf2005-04-05 06:07:16 +0000112 *
113 * ISSUE: change to isContainerLanguageTag(String type);
david_williams96213482004-11-11 09:07:12 +0000114 */
115 boolean isJSPTag();
116
117 /**
david_williamsc39caaf2005-04-05 06:07:16 +0000118 * Returns true if start tag is closed.
119 *
david_williams6c3c6d02005-04-10 20:43:07 +0000120 * @return true if start tag is closed.
david_williams96213482004-11-11 09:07:12 +0000121 */
122 boolean isStartTagClosed();
123
124 /**
david_williamsc39caaf2005-04-05 06:07:16 +0000125 * returns true if is xml tag
126 *
david_williams6c3c6d02005-04-10 20:43:07 +0000127 * ISSUE: need to spec this better.
david_williamsc39caaf2005-04-05 06:07:16 +0000128 *
david_williams6c3c6d02005-04-10 20:43:07 +0000129 * @return true if is xml tag
david_williams96213482004-11-11 09:07:12 +0000130 */
131 boolean isXMLTag();
132
133 /**
david_williams6c3c6d02005-04-10 20:43:07 +0000134 * NOT CLIENT API
135 *
david_williamsc39caaf2005-04-05 06:07:16 +0000136 * notifyEndTagChanged
137 *
david_williams96213482004-11-11 09:07:12 +0000138 */
139 void notifyEndTagChanged();
140
141 /**
david_williams6c3c6d02005-04-10 20:43:07 +0000142 * NOT CLIENT API
143 *
david_williamsc39caaf2005-04-05 06:07:16 +0000144 * notifyStartTagChanged
145 *
david_williams96213482004-11-11 09:07:12 +0000146 */
147 void notifyStartTagChanged();
148
149 /**
david_williams6c3c6d02005-04-10 20:43:07 +0000150 * NOT CLIENT API
151 *
david_williamsc39caaf2005-04-05 06:07:16 +0000152 * Signify that this tag is a comment
153 *
david_williamsdc8da6d2005-04-09 13:20:16 +0000154 * For use only by parsers.
david_williamsc39caaf2005-04-05 06:07:16 +0000155 *
david_williams96213482004-11-11 09:07:12 +0000156 */
157 void setCommentTag(boolean isCommentTag);
158
159 /**
david_williams6c3c6d02005-04-10 20:43:07 +0000160 * NOT CLIENT API
161 *
david_williamsc39caaf2005-04-05 06:07:16 +0000162 * Signify that this tag is an empty tag
163 *
david_williamsdc8da6d2005-04-09 13:20:16 +0000164 * For use only by parsers
david_williams96213482004-11-11 09:07:12 +0000165 */
166 void setEmptyTag(boolean isEmptyTag);
167
168 /**
david_williams6c3c6d02005-04-10 20:43:07 +0000169 * NOT CLIENT API
170 *
david_williamsc39caaf2005-04-05 06:07:16 +0000171 * Signify that this tag is a JSP tag
172 *
david_williamsdc8da6d2005-04-09 13:20:16 +0000173 * For use only by parsers
david_williamsc39caaf2005-04-05 06:07:16 +0000174 *
david_williams6c3c6d02005-04-10 20:43:07 +0000175 * ISSUE: I have had one non-parsing client who has had to use this ...
176 * need to check
177 *
david_williams96213482004-11-11 09:07:12 +0000178 */
179 void setJSPTag(boolean isJSPTag);
david_williams838590b2005-04-14 14:05:08 +0000180
181 /**
182 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
183 */
184 public void setIdAttribute(String name, boolean isId);
185
186 /**
187 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
188 */
189 public void setIdAttributeNS(String namespaceURI, String localName, boolean isId);
190
191 /**
192 * NOT IMPLEMENTED. Is defined here in preparation for DOM 3.
193 */
194 public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException;
195
david_williams96213482004-11-11 09:07:12 +0000196}