blob: ee16e15de8bcca02b29882acc9f0935c9eb3a548 [file] [log] [blame]
david_williamsc39caaf2005-04-05 06:07:16 +00001/*******************************************************************************
amywuecebb042007-04-10 20:07:35 +00002 * Copyright (c) 2001, 2005 IBM Corporation and others.
david_williamsc39caaf2005-04-05 06:07:16 +00003 * 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
amywuecebb042007-04-10 20:07:35 +00007 *
david_williamsc39caaf2005-04-05 06:07:16 +00008 * 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_williamsc39caaf2005-04-05 06:07:16 +000014
15
16
david_williams4ad020f2005-04-18 08:00:30 +000017import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
david_williamsc39caaf2005-04-05 06:07:16 +000018import org.w3c.dom.Attr;
19
20
21/**
22 * 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_williamsc39caaf2005-04-05 06:07:16 +000026 *
27 */
28public interface IDOMAttr extends IDOMNode, Attr {
29
30 /**
31 * Get's the region in attribute representing the '=' sign. May or may not
32 * have whitespace surrounding it.
33 *
david_williams56777022005-04-11 06:21:55 +000034 * @deprecated -
35 * ISSUE: need to change/remove to avoid exposing 'ITextRegion'
36 * change to offset pattern, as others.
37 *
david_williams6c3c6d02005-04-10 20:43:07 +000038 * @return ITextRegion - the region representing the equals sign, or null
39 * if their is no equals sign.
david_williamsc39caaf2005-04-05 06:07:16 +000040 */
41 ITextRegion getEqualRegion();
42
43 /**
44 * Gets the source location of the end of the attribute name, including
45 * whitespace.
46 *
david_williams6c3c6d02005-04-10 20:43:07 +000047 * @return int - the source location of the end of the attribute name,
48 * including whitespace.
david_williamsc39caaf2005-04-05 06:07:16 +000049 */
50 int getNameRegionEndOffset();
51
52 /**
53 * Gets the source location of the start of the attribute name.
54 *
david_williams6c3c6d02005-04-10 20:43:07 +000055 * @return int - the source location of the start of the attribute name.
david_williamsc39caaf2005-04-05 06:07:16 +000056 */
57 int getNameRegionStartOffset();
58
59
60 /**
61 * Gets the text associated with the attribute name.
62 *
david_williams6c3c6d02005-04-10 20:43:07 +000063 * @return String - the text associated with the attribute name.
david_williamsc39caaf2005-04-05 06:07:16 +000064 */
65 String getNameRegionText();
66
67 /**
68 * Gets the source location of the end of the attribute name, excluding
69 * whitespace.
70 *
david_williams6c3c6d02005-04-10 20:43:07 +000071 * @return int - returns the source location of the end of the attribute
72 * name, excluding whitespace.
david_williamsc39caaf2005-04-05 06:07:16 +000073 */
74 int getNameRegionTextEndOffset();
75
76 /**
77 * Gets the source location of the start of the attribute value.
78 *
david_williams6c3c6d02005-04-10 20:43:07 +000079 * @return int - returns the source location of the start of the attribute
80 * value.
81 *
82 * ISSUE: need to better spec interaction with quote marks
david_williamsc39caaf2005-04-05 06:07:16 +000083 */
84 int getValueRegionStartOffset();
85
86 /**
87 * Gets the text associated with the attribute value.
88 *
david_williams6c3c6d02005-04-10 20:43:07 +000089 * @return String - returns the text associated with the attribute value.
david_williamsc39caaf2005-04-05 06:07:16 +000090 */
91 String getValueRegionText();
92
93 /**
94 * Check if Attr has a nested value (such as a JSP expression).
95 *
david_williams6c3c6d02005-04-10 20:43:07 +000096 * @return true if contains a nested value, false otherwise.
david_williamsc39caaf2005-04-05 06:07:16 +000097 */
98 boolean hasNestedValue();
99
100 /**
101 * Check if Attr has only name but not equal sign nor value.
102 *
103 * @return true if has only name but not equal sign nor value.
104 */
105 boolean hasNameOnly();
106
107 /**
108 * Returns true if attribute is defined globally for document. Returns
109 * false if attribute is preceeded by a prefix (whether valid name space
110 * or not). Returns true if its owning element is a global element.
111 *
david_williams6c3c6d02005-04-10 20:43:07 +0000112 * @return true if attribute is defined globally for document. Returns
113 * false if attribute is preceeded by a prefix (whether valid name
114 * space or not). Returns true if its owning element is a global
115 * element.
david_williamsc39caaf2005-04-05 06:07:16 +0000116 */
117 boolean isGlobalAttr();
118
119 /**
120 * Returns true if is xml attr
121 *
david_williams6c3c6d02005-04-10 20:43:07 +0000122 * ISSUE: need to figure out how to specify this one in a meaningful way.
123 *
124 * @return boolean - returns true if is xml attr
david_williamsc39caaf2005-04-05 06:07:16 +0000125 */
126 boolean isXMLAttr();
127
128}