david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 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_williams | 4ad020f | 2005-04-18 08:00:30 +0000 | [diff] [blame] | 13 | package org.eclipse.wst.xml.core.internal.provisional.document; |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 14 | |
| 15 | |
| 16 | |
david_williams | 838590b | 2005-04-14 14:05:08 +0000 | [diff] [blame] | 17 | import org.w3c.dom.Attr; |
| 18 | import org.w3c.dom.DOMException; |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 19 | import org.w3c.dom.Element; |
| 20 | |
| 21 | /** |
david_williams | 646a5e2 | 2005-04-02 07:16:27 +0000 | [diff] [blame] | 22 | * This interface provides extensions to corresponding DOM interface to enable |
| 23 | * functions for source editing and incremental parsing. |
| 24 | * |
david_williams | 6cb2639 | 2005-06-24 20:13:29 +0000 | [diff] [blame] | 25 | * @plannedfor 1.0 |
david_williams | 646a5e2 | 2005-04-02 07:16:27 +0000 | [diff] [blame] | 26 | * |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 27 | */ |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 28 | public interface IDOMElement extends IDOMNode, Element { |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 29 | |
| 30 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 31 | * 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_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 36 | */ |
| 37 | int getEndStartOffset(); |
| 38 | |
| 39 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 40 | * Returns the end offset of the |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 41 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 42 | * ISSUE: need to sort out need for this |
| 43 | * |
| 44 | * @return int - the end offset of the start tag. |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 45 | */ |
| 46 | int getStartEndOffset(); |
| 47 | |
| 48 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 49 | * 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_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 55 | */ |
| 56 | boolean hasEndTag(); |
| 57 | |
| 58 | /** |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 59 | * returns true if has a start tag. |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 60 | * |
| 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_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 65 | */ |
| 66 | boolean hasStartTag(); |
| 67 | |
| 68 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 69 | * returns true if this element is a comment element |
| 70 | * |
| 71 | * @return true if this element is a comment element |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 72 | */ |
| 73 | boolean isCommentTag(); |
| 74 | |
| 75 | /** |
| 76 | * isEmptyTag method |
| 77 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 78 | * @return boolean - true if is empty tag, false otherwise |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 79 | */ |
| 80 | boolean isEmptyTag(); |
| 81 | |
| 82 | /** |
david_williams | 838590b | 2005-04-14 14:05:08 +0000 | [diff] [blame] | 83 | * Returns true if floating end tag. |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 84 | * |
david_williams | 5677702 | 2005-04-11 06:21:55 +0000 | [diff] [blame] | 85 | * @return true if floating end tag. |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 86 | */ |
| 87 | boolean isEndTag(); |
| 88 | |
| 89 | /** |
| 90 | * Returns true for "global tag" (basically, without prefix) |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 91 | * |
| 92 | * @return true for "global tag" (basically, without prefix) |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 93 | */ |
| 94 | boolean isGlobalTag(); |
| 95 | |
| 96 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 97 | * Returns true for no start and the end tags in source. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 98 | * |
| 99 | * Provided for some very special cases when, for example, and HTML tag is |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 100 | * 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_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 105 | */ |
| 106 | boolean isImplicitTag(); |
| 107 | |
| 108 | /** |
| 109 | * isJSPTag method |
| 110 | * |
| 111 | * @return boolean |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 112 | * |
| 113 | * ISSUE: change to isContainerLanguageTag(String type); |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 114 | */ |
| 115 | boolean isJSPTag(); |
| 116 | |
| 117 | /** |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 118 | * Returns true if start tag is closed. |
| 119 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 120 | * @return true if start tag is closed. |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 121 | */ |
| 122 | boolean isStartTagClosed(); |
| 123 | |
| 124 | /** |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 125 | * returns true if is xml tag |
| 126 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 127 | * ISSUE: need to spec this better. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 128 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 129 | * @return true if is xml tag |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 130 | */ |
| 131 | boolean isXMLTag(); |
| 132 | |
| 133 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 134 | * NOT CLIENT API |
| 135 | * |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 136 | * notifyEndTagChanged |
| 137 | * |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 138 | */ |
| 139 | void notifyEndTagChanged(); |
| 140 | |
| 141 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 142 | * NOT CLIENT API |
| 143 | * |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 144 | * notifyStartTagChanged |
| 145 | * |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 146 | */ |
| 147 | void notifyStartTagChanged(); |
| 148 | |
| 149 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 150 | * NOT CLIENT API |
| 151 | * |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 152 | * Signify that this tag is a comment |
| 153 | * |
david_williams | dc8da6d | 2005-04-09 13:20:16 +0000 | [diff] [blame] | 154 | * For use only by parsers. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 155 | * |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 156 | */ |
| 157 | void setCommentTag(boolean isCommentTag); |
| 158 | |
| 159 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 160 | * NOT CLIENT API |
| 161 | * |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 162 | * Signify that this tag is an empty tag |
| 163 | * |
david_williams | dc8da6d | 2005-04-09 13:20:16 +0000 | [diff] [blame] | 164 | * For use only by parsers |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 165 | */ |
| 166 | void setEmptyTag(boolean isEmptyTag); |
| 167 | |
| 168 | /** |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 169 | * NOT CLIENT API |
| 170 | * |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 171 | * Signify that this tag is a JSP tag |
| 172 | * |
david_williams | dc8da6d | 2005-04-09 13:20:16 +0000 | [diff] [blame] | 173 | * For use only by parsers |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 174 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 175 | * ISSUE: I have had one non-parsing client who has had to use this ... |
| 176 | * need to check |
| 177 | * |
david_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 178 | */ |
| 179 | void setJSPTag(boolean isJSPTag); |
david_williams | 838590b | 2005-04-14 14:05:08 +0000 | [diff] [blame] | 180 | |
| 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_williams | 9621348 | 2004-11-11 09:07:12 +0000 | [diff] [blame] | 196 | } |