david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
amywu | ecebb04 | 2007-04-10 20:07:35 +0000 | [diff] [blame] | 2 | * Copyright (c) 2001, 2005 IBM Corporation and others. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 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 |
amywu | ecebb04 | 2007-04-10 20:07:35 +0000 | [diff] [blame] | 7 | * |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 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 | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 14 | |
| 15 | |
| 16 | |
david_williams | 4ad020f | 2005-04-18 08:00:30 +0000 | [diff] [blame] | 17 | import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion; |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 18 | import 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_williams | 6cb2639 | 2005-06-24 20:13:29 +0000 | [diff] [blame] | 25 | * @plannedfor 1.0 |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 26 | * |
| 27 | */ |
| 28 | public 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_williams | 5677702 | 2005-04-11 06:21:55 +0000 | [diff] [blame] | 34 | * @deprecated - |
| 35 | * ISSUE: need to change/remove to avoid exposing 'ITextRegion' |
| 36 | * change to offset pattern, as others. |
| 37 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 38 | * @return ITextRegion - the region representing the equals sign, or null |
| 39 | * if their is no equals sign. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 40 | */ |
| 41 | ITextRegion getEqualRegion(); |
| 42 | |
| 43 | /** |
| 44 | * Gets the source location of the end of the attribute name, including |
| 45 | * whitespace. |
| 46 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 47 | * @return int - the source location of the end of the attribute name, |
| 48 | * including whitespace. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 49 | */ |
| 50 | int getNameRegionEndOffset(); |
| 51 | |
| 52 | /** |
| 53 | * Gets the source location of the start of the attribute name. |
| 54 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 55 | * @return int - the source location of the start of the attribute name. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 56 | */ |
| 57 | int getNameRegionStartOffset(); |
| 58 | |
| 59 | |
| 60 | /** |
| 61 | * Gets the text associated with the attribute name. |
| 62 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 63 | * @return String - the text associated with the attribute name. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 64 | */ |
| 65 | String getNameRegionText(); |
| 66 | |
| 67 | /** |
| 68 | * Gets the source location of the end of the attribute name, excluding |
| 69 | * whitespace. |
| 70 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 71 | * @return int - returns the source location of the end of the attribute |
| 72 | * name, excluding whitespace. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 73 | */ |
| 74 | int getNameRegionTextEndOffset(); |
| 75 | |
| 76 | /** |
| 77 | * Gets the source location of the start of the attribute value. |
| 78 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 79 | * @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_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 83 | */ |
| 84 | int getValueRegionStartOffset(); |
| 85 | |
| 86 | /** |
| 87 | * Gets the text associated with the attribute value. |
| 88 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 89 | * @return String - returns the text associated with the attribute value. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 90 | */ |
| 91 | String getValueRegionText(); |
| 92 | |
| 93 | /** |
| 94 | * Check if Attr has a nested value (such as a JSP expression). |
| 95 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 96 | * @return true if contains a nested value, false otherwise. |
david_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 97 | */ |
| 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_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 112 | * @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_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 116 | */ |
| 117 | boolean isGlobalAttr(); |
| 118 | |
| 119 | /** |
| 120 | * Returns true if is xml attr |
| 121 | * |
david_williams | 6c3c6d0 | 2005-04-10 20:43:07 +0000 | [diff] [blame] | 122 | * 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_williams | c39caaf | 2005-04-05 06:07:16 +0000 | [diff] [blame] | 125 | */ |
| 126 | boolean isXMLAttr(); |
| 127 | |
| 128 | } |