Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jaxb
diff options
context:
space:
mode:
authorkmoore2011-01-20 22:53:52 +0000
committerkmoore2011-01-20 22:53:52 +0000
commit66480f7cb94e16d7f9c15975e94e23b6d8537f26 (patch)
treed3ad87e32d9604cbbbd61652eb821e62546112ee /jaxb
parentf144f3beaa055d40afeaa7529ca730db730d95cf (diff)
downloadwebtools.dali-66480f7cb94e16d7f9c15975e94e23b6d8537f26.tar.gz
webtools.dali-66480f7cb94e16d7f9c15975e94e23b6d8537f26.tar.xz
webtools.dali-66480f7cb94e16d7f9c15975e94e23b6d8537f26.zip
added nameTouches and namespaceTouches API
Diffstat (limited to 'jaxb')
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java16
2 files changed, 23 insertions, 3 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
index ac09970a73..7e62a654e3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
@@ -164,6 +164,10 @@ public class SourceXmlSchemaTypeAnnotation
return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
}
+ public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+ }
+
// ***** namespace
public String getNamespace() {
return this.namespace;
@@ -189,7 +193,11 @@ public class SourceXmlSchemaTypeAnnotation
public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
}
-
+
+ public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ }
+
// ***** type
public String getType() {
return this.type;
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
index a06c7cab0a..49f035cfcc 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
@@ -48,7 +48,13 @@ public interface XmlSchemaTypeAnnotation
* does not exist return the {@link TextRange} for the XmlSchemaType annotation.
*/
TextRange getNameTextRange(CompilationUnit astRoot);
-
+
+ /**
+ * Return whether the specified position touches the 'name' element.
+ * Return false if the element does not exist.
+ */
+ boolean nameTouches(int pos, CompilationUnit astRoot);
+
/**
* Corresponds to the 'namespace' element of the XmlSchemaType annotation.
* Return null if the element does not exist in Java.
@@ -67,7 +73,13 @@ public interface XmlSchemaTypeAnnotation
* does not exist return the {@link TextRange} for the XmlSchemaType annotation.
*/
TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
+
+ /**
+ * Return whether the specified position touches the 'namespace' element.
+ * Return false if the element does not exist.
+ */
+ boolean namespaceTouches(int pos, CompilationUnit astRoot);
+
/**
* Corresponds to the 'type' element of the XmlSchemaType annotation.
* Return null if the element does not exist in Java.

Back to the top