diff options
author | pfullbright | 2011-01-20 21:48:38 +0000 |
---|---|---|
committer | pfullbright | 2011-01-20 21:48:38 +0000 |
commit | dced8c69af13de9d7bf3eff5e6f19a452991d949 (patch) | |
tree | 8d339c1d9aa555ccb7297e89c21553912ead5809 /jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse | |
parent | 9c5cc7cfa69198ef6d8a9820cb17c1ae63d4f0fd (diff) | |
download | webtools.dali-dced8c69af13de9d7bf3eff5e6f19a452991d949.tar.gz webtools.dali-dced8c69af13de9d7bf3eff5e6f19a452991d949.tar.xz webtools.dali-dced8c69af13de9d7bf3eff5e6f19a452991d949.zip |
added namespaceTouches(..)
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse')
3 files changed, 19 insertions, 2 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java index 60704850fb..1c93a87714 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java @@ -42,6 +42,7 @@ public final class NullXmlSchemaAnnotation // ********** XmlSchemaAnnotation implementation ********** // ***** namespace + public String getNamespace() { return null; } @@ -55,8 +56,14 @@ public final class NullXmlSchemaAnnotation public TextRange getNamespaceTextRange(CompilationUnit astRoot) { return null; } - + + public boolean namespaceTouches(int pos, CompilationUnit astRoot) { + return false; + } + + // ***** location + public String getLocation() { return null; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java index ca406ebed5..97240b331e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java @@ -236,6 +236,10 @@ public class SourceXmlSchemaAnnotation return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot); } + public boolean namespaceTouches(int pos, CompilationUnit astRoot) { + return elementTouches(NAMESPACE_ADAPTER, pos, astRoot); + } + // **************** xmlns ************************************************* diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java index 99ab23eb2b..4f8be4565b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java @@ -106,7 +106,13 @@ public interface XmlSchemaAnnotation * does not exist return the {@link TextRange} for the XmlSchema 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 'xmlns' element of the XmlSchema annotation. * Return an empty iterator if the element does not exist in Java. |