summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2012-08-22 14:47:50 (EDT)
committerKaren Butzke2012-08-22 14:49:36 (EDT)
commita420fb18c36c264ec6b29b2c3fd1f77a6a9f54a9 (patch)
treeabcbe082d770e7de0f39c6bc2ca211c3d99d3f6b
parent13e7b35e7bc5b5d72fc072025526e88b32b28fb5 (diff)
downloadwebtools.dali-a420fb18c36c264ec6b29b2c3fd1f77a6a9f54a9.zip
webtools.dali-a420fb18c36c264ec6b29b2c3fd1f77a6a9f54a9.tar.gz
webtools.dali-a420fb18c36c264ec6b29b2c3fd1f77a6a9f54a9.tar.bz2
caching TextRanges in the JAXB java resource model Annotation hierarchy
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java80
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java93
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java90
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java16
74 files changed, 862 insertions, 563 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
index 9a713bb..23168de 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.context;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.1
+ * @version 3.3
* @since 3.1
*/
public interface XmlElementRef
@@ -80,5 +79,5 @@ public interface XmlElementRef
// ***** validation *****
- TextRange getTypeTextRange(CompilationUnit astRoot);
+ TextRange getTypeTextRange();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
index 3412c96..045a6db 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -150,11 +150,11 @@ public abstract class AbstractJavaQName
return result;
}
- if (this.proxy.namespaceTouches(pos, astRoot)) {
+ if (this.proxy.namespaceTouches(pos)) {
return getNamespaceProposals(filter);
}
- if (this.proxy.nameTouches(pos, astRoot)) {
+ if (this.proxy.nameTouches(pos)) {
return getNameProposals(filter);
}
@@ -178,11 +178,11 @@ public abstract class AbstractJavaQName
}
public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNamespaceTextRange(astRoot), astRoot);
+ return getTextRange(this.proxy.getNamespaceTextRange(), astRoot);
}
public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNameTextRange(astRoot), astRoot);
+ return getTextRange(this.proxy.getNameTextRange(), astRoot);
}
/**
@@ -234,17 +234,17 @@ public abstract class AbstractJavaQName
void setNamespace(String namespace);
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
+ boolean namespaceTouches(int pos);
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
+ TextRange getNamespaceTextRange();
String getName();
void setName(String name);
- boolean nameTouches(int pos, CompilationUnit astRoot);
+ boolean nameTouches(int pos);
- TextRange getNameTextRange(CompilationUnit astRoot);
+ TextRange getNameTextRange();
}
@@ -265,14 +265,14 @@ public abstract class AbstractJavaQName
getAnnotation(true).setNamespace(newSpecifiedNamespace);
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.namespaceTouches(pos, astRoot);
+ return (annotation == null) ? false : annotation.namespaceTouches(pos);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNamespaceTextRange(astRoot);
+ return (annotation == null) ? null : annotation.getNamespaceTextRange();
}
public String getName() {
@@ -284,14 +284,14 @@ public abstract class AbstractJavaQName
getAnnotation(true).setName(newSpecifiedName);
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.nameTouches(pos, astRoot);
+ return (annotation == null) ? false : annotation.nameTouches(pos);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNameTextRange(astRoot);
+ return (annotation == null) ? null : annotation.getNameTextRange();
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
index 37e03e2..8821439 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -448,7 +448,7 @@ public abstract class AbstractJavaTypeMapping
IMessage.HIGH_SEVERITY,
JaxbValidationMessages.XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE,
this,
- getXmlTypeAnnotation().getNamespaceTextRange(astRoot)));
+ getXmlTypeAnnotation().getNamespaceTextRange()));
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
index 8d98ffa..99b941d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -64,7 +64,7 @@ public class GenericJavaAttributeMappingXmlSchemaType
IMessage.HIGH_SEVERITY,
JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE,
this,
- getTypeTextRange(astRoot)));
+ getTypeTextRange()));
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
index 8b1dd7c..6090425 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -56,7 +56,7 @@ public class GenericJavaAttributeXmlJavaTypeAdapter
IMessage.HIGH_SEVERITY,
JaxbValidationMessages.ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED,
this,
- getAnnotation().getTypeTextRange(astRoot)));
+ getAnnotation().getTypeTextRange()));
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
index f8a7b03..348a972 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
@@ -743,7 +743,7 @@ public class GenericJavaClassMapping
return result;
}
- if (propTouches(pos, astRoot)) {
+ if (propTouches(pos)) {
return getPropProposals(filter);
}
@@ -884,7 +884,7 @@ public class GenericJavaClassMapping
JaxbValidationMessages.XML_TYPE__DUPLICATE_PROP,
new String[] { getProp(i) },
this,
- getPropTextRange(i, astRoot)));
+ getPropTextRange(i)));
}
for (String missingProp : missingProps) {
@@ -904,7 +904,7 @@ public class GenericJavaClassMapping
JaxbValidationMessages.XML_TYPE__NONEXISTENT_PROP,
new String[] { getProp(i) },
this,
- getPropTextRange(i, astRoot)));
+ getPropTextRange(i)));
}
for (int i : transientProps) {
@@ -914,7 +914,7 @@ public class GenericJavaClassMapping
JaxbValidationMessages.XML_TYPE__TRANSIENT_PROP,
new String [] { getProp(i) },
this,
- getPropTextRange(i, astRoot)));
+ getPropTextRange(i)));
}
}
@@ -1068,28 +1068,28 @@ public class GenericJavaClassMapping
}
protected TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getFactoryClassTextRange(astRoot);
+ TextRange result = getXmlTypeAnnotation().getFactoryClassTextRange();
return (result != null) ? result : getValidationTextRange(astRoot);
}
protected TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getFactoryMethodTextRange(astRoot);
+ TextRange result = getXmlTypeAnnotation().getFactoryMethodTextRange();
return (result != null) ? result : getValidationTextRange(astRoot);
}
protected TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getPropOrderTextRange(astRoot);
+ TextRange result = getXmlTypeAnnotation().getPropOrderTextRange();
return (result != null) ? result : getValidationTextRange(astRoot);
}
- protected TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getXmlTypeAnnotation().getPropTextRange(index, astRoot);
+ protected TextRange getPropTextRange(int index) {
+ return getXmlTypeAnnotation().getPropTextRange(index);
}
- protected boolean propTouches(int pos, CompilationUnit astRoot) {
- if (getXmlTypeAnnotation().propOrderTouches(pos, astRoot)) {
+ protected boolean propTouches(int pos) {
+ if (getXmlTypeAnnotation().propOrderTouches(pos)) {
for (int i = 0; i < getXmlTypeAnnotation().getPropOrderSize(); i ++ ) {
- if (getXmlTypeAnnotation().propTouches(i, pos, astRoot)) {
+ if (getXmlTypeAnnotation().propTouches(i, pos)) {
return true;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
index 844ba81..9ede19c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
@@ -453,14 +453,14 @@ public class GenericJavaElementFactoryMethod
getAnnotation().setSubstitutionHeadNamespace(newSpecifiedNamespace);
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNamespaceTouches(pos, astRoot);
+ return (annotation == null) ? false : annotation.substitutionHeadNamespaceTouches(pos);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNamespaceTextRange(astRoot);
+ return (annotation == null) ? null : annotation.getSubstitutionHeadNamespaceTextRange();
}
public String getName() {
@@ -472,14 +472,14 @@ public class GenericJavaElementFactoryMethod
getAnnotation().setSubstitutionHeadName(newSpecifiedName);
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNameTouches(pos, astRoot);
+ return (annotation == null) ? false : annotation.substitutionHeadNameTouches(pos);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNameTextRange(astRoot);
+ return (annotation == null) ? null : annotation.getSubstitutionHeadNameTextRange();
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
index 3ec1e2b..bbe30a8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
@@ -112,7 +112,7 @@ public class GenericJavaEnumConstant
return result;
}
- if (valueTouches(pos, astRoot)) {
+ if (valueTouches(pos)) {
XsdTypeDefinition<?> xsdType = getEnumMapping().getXsdTypeDefinition();
if (xsdType != null && xsdType.getKind() == XsdTypeDefinition.Kind.SIMPLE) {
XsdSimpleTypeDefinition xsdSimpleType = (XsdSimpleTypeDefinition) xsdType;
@@ -123,8 +123,8 @@ public class GenericJavaEnumConstant
return EmptyIterable.instance();
}
- protected boolean valueTouches(int pos, CompilationUnit astRoot) {
- return getXmlEnumValueAnnotation().valueTouches(pos, astRoot);
+ protected boolean valueTouches(int pos) {
+ return getXmlEnumValueAnnotation().valueTouches(pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
index e664e53..89e9640 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -220,15 +220,15 @@ public class GenericJavaEnumMapping
public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
super.validate(messages, reporter, astRoot);
- validateXmlType(messages, reporter, astRoot);
- validateXmlEnum(messages, reporter, astRoot);
+ validateXmlType(messages, reporter);
+ validateXmlEnum(messages, reporter);
for (JaxbEnumConstant constant : getEnumConstants()) {
constant.validate(messages, reporter, astRoot);
}
}
- protected void validateXmlType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ protected void validateXmlType(List<IMessage> messages, IReporter reporter) {
XmlTypeAnnotation annotation = getXmlTypeAnnotation();
if (annotation.getFactoryClass() != null) {
@@ -237,7 +237,7 @@ public class GenericJavaEnumMapping
IMessage.NORMAL_SEVERITY,
JaxbValidationMessages.XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM,
this,
- annotation.getFactoryClassTextRange(astRoot)));
+ annotation.getFactoryClassTextRange()));
}
if (annotation.getFactoryMethod() != null) {
@@ -246,7 +246,7 @@ public class GenericJavaEnumMapping
IMessage.NORMAL_SEVERITY,
JaxbValidationMessages.XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM,
this,
- annotation.getFactoryMethodTextRange(astRoot)));
+ annotation.getFactoryMethodTextRange()));
}
if (! CollectionTools.isEmpty(annotation.getPropOrder())) {
@@ -255,11 +255,11 @@ public class GenericJavaEnumMapping
IMessage.NORMAL_SEVERITY,
JaxbValidationMessages.XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM,
this,
- annotation.getPropOrderTextRange(astRoot)));
+ annotation.getPropOrderTextRange()));
}
}
- protected void validateXmlEnum(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ protected void validateXmlEnum(List<IMessage> messages, IReporter reporter) {
XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
@@ -271,12 +271,12 @@ public class GenericJavaEnumMapping
JaxbValidationMessages.XML_ENUM__NON_SIMPLE_SCHEMA_TYPE,
new String[] { getFullyQualifiedXmlEnumValue() },
this,
- getXmlEnumValueTextRange(astRoot)));
+ getXmlEnumValueTextRange()));
}
}
- protected TextRange getXmlEnumValueTextRange(CompilationUnit astRoot) {
- return getXmlEnumAnnotation().getValueTextRange(astRoot);
+ protected TextRange getXmlEnumValueTextRange() {
+ return getXmlEnumAnnotation().getValueTextRange();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
index 00f5396..5d0308e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -42,7 +42,7 @@ public class GenericJavaPackageXmlJavaTypeAdapter
IMessage.HIGH_SEVERITY,
JaxbValidationMessages.PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED,
this,
- getAnnotation().getTypeTextRange(astRoot)));
+ getAnnotation().getTypeTextRange()));
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
index e207b7f..7a7cc19 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -349,7 +349,7 @@ public class GenericJavaXmlElement
public TextRange getTypeTextRange(CompilationUnit astRoot) {
XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTypeTextRange(astRoot);
+ return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTypeTextRange();
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
index 9141e40..182936e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -233,18 +233,18 @@ public class GenericJavaXmlElementRef
return getAnnotation().getTextRange(astRoot);
}
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTypeTextRange(astRoot);
+ public TextRange getTypeTextRange() {
+ return getAnnotation().getTypeTextRange();
}
@Override
public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
super.validate(messages, reporter, astRoot);
this.qName.validate(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
+ validateType(messages, reporter);
}
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ protected void validateType(List<IMessage> messages, IReporter reporter) {
String fqType = getFullyQualifiedType();
if (StringTools.stringIsEmpty(fqType)) {
@@ -253,7 +253,7 @@ public class GenericJavaXmlElementRef
IMessage.HIGH_SEVERITY,
JaxbValidationMessages.XML_ELEMENT_REF__UNSPECIFIED_TYPE,
this,
- getTypeTextRange(astRoot)));
+ getTypeTextRange()));
}
else if (! StringTools.stringIsEmpty(this.specifiedType)
// verify that type actually exists before validating
@@ -266,7 +266,7 @@ public class GenericJavaXmlElementRef
JaxbValidationMessages.XML_ELEMENT_REF__ILLEGAL_TYPE,
new String[] { attributeValueType },
this,
- getTypeTextRange(astRoot)));
+ getTypeTextRange()));
}
@@ -279,7 +279,7 @@ public class GenericJavaXmlElementRef
JaxbValidationMessages.XML_ELEMENT_REF__NO_ROOT_ELEMENT,
new String[] { attributeValueType },
this,
- getTypeTextRange(astRoot)));
+ getTypeTextRange()));
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
index c7e0f48..c4168ea 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -173,7 +173,7 @@ public class GenericJavaXmlElementRefs
JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE,
new String[] { typeName },
xmlElementRef,
- xmlElementRef.getTypeTextRange(astRoot)));
+ xmlElementRef.getTypeTextRange()));
}
String xmlElementNamespace = xmlElementRef.getQName().getNamespace();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
index d317dff..75234dc 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
@@ -121,7 +121,7 @@ public class GenericJavaXmlNs
public Iterable<String> getJavaCompletionProposals(
int pos, Filter<String> filter, CompilationUnit astRoot) {
- if (getResourceXmlNs().namespaceURITouches(pos, astRoot)) {
+ if (getResourceXmlNs().namespaceURITouches(pos)) {
return getNamespaceURICompletionProposals(pos, filter, astRoot);
}
return EmptyIterable.instance();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
index 3c76035..8929410 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
@@ -257,7 +257,7 @@ public class GenericJavaXmlSchema
return result;
}
- if (namespaceTouches(pos, astRoot)) {
+ if (namespaceTouches(pos)) {
return getNamespaceProposals(filter);
}
@@ -271,8 +271,8 @@ public class GenericJavaXmlSchema
return EmptyIterable.instance();
}
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().namespaceTouches(pos, astRoot);
+ protected boolean namespaceTouches(int pos) {
+ return getXmlSchemaAnnotation().namespaceTouches(pos);
}
protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
index 1cb1d4e..4c76e02 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -167,8 +167,8 @@ public abstract class GenericJavaXmlSchemaType
}
}
- protected TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getXmlSchemaTypeAnnotation().getTypeTextRange(astRoot);
+ protected TextRange getTypeTextRange() {
+ return getXmlSchemaTypeAnnotation().getTypeTextRange();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
index 5f22fae..92404ef 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -20,7 +19,7 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
* javax.xml.bind.annotation.XmlEnum
*/
public final class NullXmlEnumAnnotation
- extends NullAnnotation
+ extends NullAnnotation<XmlEnumAnnotation>
implements XmlEnumAnnotation
{
protected NullXmlEnumAnnotation(JavaResourceNode parent) {
@@ -31,11 +30,6 @@ public final class NullXmlEnumAnnotation
return JAXB.XML_ENUM;
}
- @Override
- protected XmlEnumAnnotation addAnnotation() {
- return (XmlEnumAnnotation) super.addAnnotation();
- }
-
// ********** XmlEnumAnnotation implementation **********
@@ -54,7 +48,7 @@ public final class NullXmlEnumAnnotation
}
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
+ public TextRange getValueTextRange() {
return null;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
index 6b25c0a..bd07bff 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -20,7 +19,7 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
* javax.xml.bind.annotation.XmlEnumValue
*/
public final class NullXmlEnumValueAnnotation
- extends NullAnnotation
+ extends NullAnnotation<XmlEnumValueAnnotation>
implements XmlEnumValueAnnotation
{
protected NullXmlEnumValueAnnotation(JavaResourceNode parent) {
@@ -31,11 +30,6 @@ public final class NullXmlEnumValueAnnotation
return JAXB.XML_ENUM_VALUE;
}
- @Override
- protected XmlEnumValueAnnotation addAnnotation() {
- return (XmlEnumValueAnnotation) super.addAnnotation();
- }
-
// ********** XmlEnumValueAnnotation implementation **********
@@ -54,7 +48,7 @@ public final class NullXmlEnumValueAnnotation
return null;
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
+ public boolean valueTouches(int pos) {
return false;
}
}
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 7c2cc3b..2564046 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -24,7 +23,7 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
* javax.xml.bind.annotation.XmlSchema
*/
public final class NullXmlSchemaAnnotation
- extends NullAnnotation
+ extends NullAnnotation<XmlSchemaAnnotation>
implements XmlSchemaAnnotation
{
protected NullXmlSchemaAnnotation(JavaResourceNode parent) {
@@ -35,11 +34,6 @@ public final class NullXmlSchemaAnnotation
return JAXB.XML_SCHEMA;
}
- @Override
- protected XmlSchemaAnnotation addAnnotation() {
- return (XmlSchemaAnnotation) super.addAnnotation();
- }
-
// ********** XmlSchemaAnnotation implementation **********
@@ -55,11 +49,11 @@ public final class NullXmlSchemaAnnotation
}
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
return null;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
return false;
}
@@ -76,11 +70,11 @@ public final class NullXmlSchemaAnnotation
}
}
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
+ public TextRange getLocationTextRange() {
return null;
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
+ public TextRange getValueTextRange() {
return null;
}
@@ -94,7 +88,7 @@ public final class NullXmlSchemaAnnotation
}
}
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
+ public TextRange getAttributeFormDefaultTextRange() {
return null;
}
@@ -108,7 +102,7 @@ public final class NullXmlSchemaAnnotation
}
}
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
+ public TextRange getElementFormDefaultTextRange() {
return null;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
index 848b54d..5376df7 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -22,7 +21,7 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
* javax.xml.bind.annotation.XmlType
*/
public final class NullXmlTypeAnnotation
- extends NullAnnotation
+ extends NullAnnotation<XmlTypeAnnotation>
implements XmlTypeAnnotation
{
protected NullXmlTypeAnnotation(JavaResourceNode parent) {
@@ -33,11 +32,6 @@ public final class NullXmlTypeAnnotation
return JAXB.XML_TYPE;
}
- @Override
- protected XmlTypeAnnotation addAnnotation() {
- return (XmlTypeAnnotation) super.addAnnotation();
- }
-
// ********** XmlTypeAnnotation implementation **********
@@ -56,7 +50,7 @@ public final class NullXmlTypeAnnotation
}
}
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
+ public TextRange getFactoryClassTextRange() {
return null;
}
@@ -71,7 +65,7 @@ public final class NullXmlTypeAnnotation
}
}
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
+ public TextRange getFactoryMethodTextRange() {
return null;
}
@@ -86,11 +80,11 @@ public final class NullXmlTypeAnnotation
}
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
return null;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
return false;
}
@@ -106,11 +100,11 @@ public final class NullXmlTypeAnnotation
}
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
return null;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
return false;
}
@@ -143,19 +137,19 @@ public final class NullXmlTypeAnnotation
throw new UnsupportedOperationException();
}
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
+ public TextRange getPropOrderTextRange() {
return null;
}
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
+ public boolean propOrderTouches(int pos) {
return false;
}
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
+ public TextRange getPropTextRange(int index) {
return null;
}
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
+ public boolean propTouches(int index, int pos) {
return false;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
index 520efc7..14fa07c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -74,11 +73,11 @@ public final class BinaryXmlAttributeAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -102,11 +101,11 @@ public final class BinaryXmlAttributeAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -130,7 +129,7 @@ public final class BinaryXmlAttributeAnnotation
return (Boolean) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__REQUIRED);
}
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
+ public TextRange getRequiredTextRange() {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
index 72721b7..28f1728 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -83,11 +82,11 @@ public final class BinaryXmlElementAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -111,11 +110,11 @@ public final class BinaryXmlElementAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -139,7 +138,7 @@ public final class BinaryXmlElementAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__DEFAULT_VALUE);
}
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
+ public TextRange getDefaultValueTextRange() {
throw new UnsupportedOperationException();
}
@@ -162,7 +161,7 @@ public final class BinaryXmlElementAnnotation
return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__NILLABLE);
}
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
+ public TextRange getNillableTextRange() {
throw new UnsupportedOperationException();
}
@@ -185,7 +184,7 @@ public final class BinaryXmlElementAnnotation
return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
}
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
+ public TextRange getRequiredTextRange() {
throw new UnsupportedOperationException();
}
@@ -209,7 +208,7 @@ public final class BinaryXmlElementAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__TYPE);
}
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
+ public TextRange getTypeTextRange() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
index bf1be28..86951d8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -84,11 +83,11 @@ public final class BinaryXmlElementDeclAnnotation
return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -113,11 +112,11 @@ public final class BinaryXmlElementDeclAnnotation
return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -143,7 +142,7 @@ public final class BinaryXmlElementDeclAnnotation
return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SCOPE);
}
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
+ public TextRange getScopeTextRange() {
throw new UnsupportedOperationException();
}
@@ -172,11 +171,11 @@ public final class BinaryXmlElementDeclAnnotation
return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
}
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getSubstitutionHeadNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean substitutionHeadNamespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -201,11 +200,11 @@ public final class BinaryXmlElementDeclAnnotation
return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
}
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
+ public TextRange getSubstitutionHeadNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
+ public boolean substitutionHeadNameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -230,7 +229,7 @@ public final class BinaryXmlElementDeclAnnotation
return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
}
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
+ public TextRange getDefaultValueTextRange() {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
index 2a07f8c..20d5d5c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -77,11 +76,11 @@ public final class BinaryXmlElementRefAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -104,11 +103,11 @@ public final class BinaryXmlElementRefAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -131,7 +130,7 @@ public final class BinaryXmlElementRefAnnotation
return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
}
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
+ public TextRange getRequiredTextRange() {
throw new UnsupportedOperationException();
}
@@ -155,7 +154,7 @@ public final class BinaryXmlElementRefAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__TYPE);
}
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
+ public TextRange getTypeTextRange() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
index 3447344..41058a2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -77,11 +76,11 @@ public final class BinaryXmlElementWrapperAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -105,11 +104,11 @@ public final class BinaryXmlElementWrapperAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -133,7 +132,7 @@ public final class BinaryXmlElementWrapperAnnotation
return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
}
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
+ public TextRange getNillableTextRange() {
throw new UnsupportedOperationException();
}
@@ -156,7 +155,7 @@ public final class BinaryXmlElementWrapperAnnotation
return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
}
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
+ public TextRange getRequiredTextRange() {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
index eaaff3c..cbf6713 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -70,7 +69,7 @@ public final class BinaryXmlEnumAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ENUM__VALUE);
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
+ public TextRange getValueTextRange() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
index 03f67ad..fd7da5d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -67,7 +66,7 @@ public final class BinaryXmlEnumValueAnnotation
throw new UnsupportedOperationException();
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
+ public boolean valueTouches(int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
index 70bdd6b..7babc93 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -74,7 +73,7 @@ public final class BinaryXmlJavaTypeAdapterAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__VALUE);
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
+ public TextRange getValueTextRange() {
throw new UnsupportedOperationException();
}
@@ -102,7 +101,7 @@ public final class BinaryXmlJavaTypeAdapterAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__TYPE);
}
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
+ public TextRange getTypeTextRange() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
index ac2e615..4c80708 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -72,11 +71,11 @@ public final class BinaryXmlRootElementAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -100,11 +99,11 @@ public final class BinaryXmlRootElementAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
index a2d08f7..b24564c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,7 +11,6 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import java.util.Vector;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -84,7 +83,7 @@ public final class BinaryXmlTypeAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_CLASS);
}
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
+ public TextRange getFactoryClassTextRange() {
throw new UnsupportedOperationException();
}
@@ -112,7 +111,7 @@ public final class BinaryXmlTypeAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_METHOD);
}
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
+ public TextRange getFactoryMethodTextRange() {
throw new UnsupportedOperationException();
}
@@ -135,11 +134,11 @@ public final class BinaryXmlTypeAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAME);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
+ public TextRange getNameTextRange() {
throw new UnsupportedOperationException();
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
+ public boolean nameTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -163,11 +162,11 @@ public final class BinaryXmlTypeAnnotation
return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAMESPACE);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
+ public TextRange getNamespaceTextRange() {
throw new UnsupportedOperationException();
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
+ public boolean namespaceTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -210,19 +209,19 @@ public final class BinaryXmlTypeAnnotation
throw new UnsupportedOperationException();
}
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
+ public TextRange getPropOrderTextRange() {
throw new UnsupportedOperationException();
}
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
+ public boolean propOrderTouches(int pos) {
throw new UnsupportedOperationException();
}
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
+ public TextRange getPropTextRange(int index) {
throw new UnsupportedOperationException();
}
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
+ public boolean propTouches(int index, int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
index 2a0c7a8..763e03f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -38,14 +37,17 @@ public final class SourceXmlAttributeAnnotation
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
private final AnnotationElementAdapter<Boolean> requiredAdapter;
private Boolean required;
+ private TextRange requiredTextRange;
// ********** constructors **********
@@ -91,16 +93,22 @@ public final class SourceXmlAttributeAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.name = this.buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = this.buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.required = this.buildRequired(astAnnotation);
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncName(this.buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.syncNamespace(this.buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.syncRequired(this.buildRequired(astAnnotation));
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
}
@Override
@@ -133,12 +141,16 @@ public final class SourceXmlAttributeAnnotation
return this.nameAdapter.getValue(astAnnotation);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nameDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
@@ -164,12 +176,16 @@ public final class SourceXmlAttributeAnnotation
return this.namespaceAdapter.getValue(astAnnotation);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
@@ -195,7 +211,12 @@ public final class SourceXmlAttributeAnnotation
return this.requiredAdapter.getValue(astAnnotation);
}
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
+ private TextRange buildRequiredTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.requiredDeclarationAdapter, astAnnotation);
}
+
+ public TextRange getRequiredTextRange() {
+ return this.requiredTextRange;
+ }
+
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
index 9452b04..5eb8bc1 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
@@ -46,27 +45,33 @@ public final class SourceXmlElementAnnotation
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
private final AnnotationElementAdapter<Boolean> nillableAdapter;
private Boolean nillable;
+ private TextRange nillableTextRange;
private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
private final AnnotationElementAdapter<Boolean> requiredAdapter;
private Boolean required;
+ private TextRange requiredTextRange;
private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
private final AnnotationElementAdapter<String> defaultValueAdapter;
private String defaultValue;
+ private TextRange defaultValueTextRange;
private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
private final AnnotationElementAdapter<String> typeAdapter;
private String type;
private String fullyQualifiedTypeName;
+ private TextRange typeTextRange;
public static SourceXmlElementAnnotation buildSourceXmlElementAnnotation(
@@ -159,24 +164,36 @@ public final class SourceXmlElementAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.name = this.buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = this.buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.nillable = this.buildNillable(astAnnotation);
+ this.nillableTextRange = this.buildNillableTextRange(astAnnotation);
this.required = this.buildRequired(astAnnotation);
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
this.defaultValue = this.buildDefaultValue(astAnnotation);
+ this.defaultValueTextRange = this.buildDefaultValueTextRange(astAnnotation);
this.type = this.buildType(astAnnotation);
this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astAnnotation);
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncName(this.buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.syncNamespace(this.buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.syncNillable(this.buildNillable(astAnnotation));
+ this.nillableTextRange = this.buildNillableTextRange(astAnnotation);
this.syncRequired(this.buildRequired(astAnnotation));
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
this.syncDefaultValue(this.buildDefaultValue(astAnnotation));
+ this.defaultValueTextRange = this.buildDefaultValueTextRange(astAnnotation);
this.syncType(this.buildType(astAnnotation));
this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astAnnotation));
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
}
@Override
@@ -209,12 +226,16 @@ public final class SourceXmlElementAnnotation
return this.nameAdapter.getValue(astAnnotation);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nameDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
@@ -240,12 +261,16 @@ public final class SourceXmlElementAnnotation
return this.namespaceAdapter.getValue(astAnnotation);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
@@ -270,11 +295,16 @@ public final class SourceXmlElementAnnotation
private Boolean buildNillable(Annotation astAnnotation) {
return this.nillableAdapter.getValue(astAnnotation);
}
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
+
+ private TextRange buildNillableTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nillableDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNillableTextRange() {
+ return this.nillableTextRange;
}
+
// ***** required
public Boolean getRequired() {
return this.required;
@@ -296,9 +326,13 @@ public final class SourceXmlElementAnnotation
private Boolean buildRequired(Annotation astAnnotation) {
return this.requiredAdapter.getValue(astAnnotation);
}
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
+
+ private TextRange buildRequiredTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.requiredDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getRequiredTextRange() {
+ return this.requiredTextRange;
}
// ***** defaultValue
@@ -323,8 +357,12 @@ public final class SourceXmlElementAnnotation
return this.defaultValueAdapter.getValue(astAnnotation);
}
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
+ private TextRange buildDefaultValueTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.defaultValueDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getDefaultValueTextRange() {
+ return this.defaultValueTextRange;
}
// ***** type
@@ -349,8 +387,12 @@ public final class SourceXmlElementAnnotation
return this.typeAdapter.getValue(astAnnotation);
}
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
+ private TextRange buildTypeTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.typeDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getTypeTextRange() {
+ return this.typeTextRange;
}
// ***** fully-qualified type name
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
index 82a5410..7534769 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
@@ -41,26 +40,32 @@ public final class SourceXmlElementDeclAnnotation
private final AnnotationElementAdapter<String> scopeAdapter;
private String scope;
private String fullyQualifiedScopeClassName;
+ private TextRange scopeTextRange;
private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> substitutionHeadNamespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> substitutionHeadNamespaceAdapter;
private String substitutionHeadNamespace;
+ private TextRange substitutionHeadNamespaceTextRange;
private final DeclarationAnnotationElementAdapter<String> substitutionHeadNameDeclarationAdapter;
private final AnnotationElementAdapter<String> substitutionHeadNameAdapter;
private String substitutionHeadName;
+ private TextRange substitutionHeadNameTextRange;
private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
private final AnnotationElementAdapter<String> defaultValueAdapter;
private String defaultValue;
+ private TextRange defaultValueTextRange;
// ********** constructors **********
@@ -122,24 +127,36 @@ public final class SourceXmlElementDeclAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.scope = buildScope(astAnnotation);
+ this.scopeTextRange = this.buildScopeTextRange(astAnnotation);
this.fullyQualifiedScopeClassName = buildFullyQualifiedScopeClassName(astAnnotation);
this.namespace = buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.name = buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.substitutionHeadNamespace = buildSubstitutionHeadNamespace(astAnnotation);
+ this.substitutionHeadNamespaceTextRange = this.buildSubstitutionHeadNamespaceTextRange(astAnnotation);
this.substitutionHeadName = buildSubstitutionHeadName(astAnnotation);
+ this.substitutionHeadNameTextRange = this.buildSubstitutionHeadNameTextRange(astAnnotation);
this.defaultValue = buildDefaultValue(astAnnotation);
+ this.defaultValueTextRange = this.buildDefaultValueTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncScope(buildScope(astAnnotation));
+ this.scopeTextRange = this.buildScopeTextRange(astAnnotation);
syncFullyQualifiedScopeClassName(buildFullyQualifiedScopeClassName(astAnnotation));
syncNamespace(buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
syncName(buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
syncSubstitutionHeadNamespace(buildSubstitutionHeadNamespace(astAnnotation));
+ this.substitutionHeadNamespaceTextRange = this.buildSubstitutionHeadNamespaceTextRange(astAnnotation);
syncSubstitutionHeadName(buildSubstitutionHeadName(astAnnotation));
+ this.substitutionHeadNameTextRange = this.buildSubstitutionHeadNameTextRange(astAnnotation);
syncDefaultValue(buildDefaultValue(astAnnotation));
+ this.defaultValueTextRange = this.buildDefaultValueTextRange(astAnnotation);
}
@Override
@@ -170,9 +187,13 @@ public final class SourceXmlElementDeclAnnotation
private String buildScope(Annotation astAnnotation) {
return this.scopeAdapter.getValue(astAnnotation);
}
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.scopeDeclarationAdapter, astRoot);
+
+ private TextRange buildScopeTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.scopeDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getScopeTextRange() {
+ return this.scopeTextRange;
}
@@ -215,13 +236,17 @@ public final class SourceXmlElementDeclAnnotation
private String buildNamespace(Annotation astAnnotation) {
return this.namespaceAdapter.getValue(astAnnotation);
}
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
+
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
@@ -248,12 +273,17 @@ public final class SourceXmlElementDeclAnnotation
return this.nameAdapter.getValue(astAnnotation);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.nameDeclarationAdapter, astRoot);
+
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nameDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
@@ -279,13 +309,17 @@ public final class SourceXmlElementDeclAnnotation
private String buildSubstitutionHeadNamespace(Annotation astAnnotation) {
return this.substitutionHeadNamespaceAdapter.getValue(astAnnotation);
}
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNamespaceDeclarationAdapter, astRoot);
+
+ private TextRange buildSubstitutionHeadNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.substitutionHeadNamespaceDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getSubstitutionHeadNamespaceTextRange() {
+ return this.substitutionHeadNamespaceTextRange;
}
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNamespaceDeclarationAdapter, pos, astRoot);
+ public boolean substitutionHeadNamespaceTouches(int pos) {
+ return this.textRangeTouches(this.substitutionHeadNamespaceTextRange, pos);
}
@@ -311,13 +345,17 @@ public final class SourceXmlElementDeclAnnotation
private String buildSubstitutionHeadName(Annotation astAnnotation) {
return this.substitutionHeadNameAdapter.getValue(astAnnotation);
}
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNameDeclarationAdapter, astRoot);
+
+ private TextRange buildSubstitutionHeadNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.substitutionHeadNameDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getSubstitutionHeadNameTextRange() {
+ return this.substitutionHeadNameTextRange;
}
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNameDeclarationAdapter, pos, astRoot);
+ public boolean substitutionHeadNameTouches(int pos) {
+ return this.textRangeTouches(this.substitutionHeadNameTextRange, pos);
}
@@ -344,7 +382,12 @@ public final class SourceXmlElementDeclAnnotation
return this.defaultValueAdapter.getValue(astAnnotation);
}
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
+
+ private TextRange buildDefaultValueTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.defaultValueDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getDefaultValueTextRange() {
+ return this.defaultValueTextRange;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
index 2a427e3..3e8d8ad 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
@@ -48,18 +47,22 @@ public final class SourceXmlElementRefAnnotation
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
private final AnnotationElementAdapter<Boolean> requiredAdapter;
private Boolean required;
+ private TextRange requiredTextRange;
private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
private final AnnotationElementAdapter<String> typeAdapter;
private String type;
+ private TextRange typeTextRange;
public static SourceXmlElementRefAnnotation buildSourceXmlElementRefAnnotation(
@@ -148,20 +151,28 @@ public final class SourceXmlElementRefAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.name = this.buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = this.buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.required = this.buildRequired(astAnnotation);
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
this.type = this.buildType(astAnnotation);
this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astAnnotation);
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncName(this.buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.syncNamespace(this.buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.syncRequired(this.buildRequired(astAnnotation));
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
this.syncType(this.buildType(astAnnotation));
this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astAnnotation));
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
}
@Override
@@ -194,12 +205,16 @@ public final class SourceXmlElementRefAnnotation
return this.nameAdapter.getValue(astAnnotation);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nameDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
@@ -225,12 +240,16 @@ public final class SourceXmlElementRefAnnotation
return this.namespaceAdapter.getValue(astAnnotation);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
@@ -255,9 +274,13 @@ public final class SourceXmlElementRefAnnotation
private Boolean buildRequired(Annotation astAnnotation) {
return this.requiredAdapter.getValue(astAnnotation);
}
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
+
+ private TextRange buildRequiredTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.requiredDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getRequiredTextRange() {
+ return this.requiredTextRange;
}
// ***** type
@@ -282,8 +305,12 @@ public final class SourceXmlElementRefAnnotation
return this.typeAdapter.getValue(astAnnotation);
}
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
+ private TextRange buildTypeTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.typeDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getTypeTextRange() {
+ return this.typeTextRange;
}
// ***** fully-qualified type name
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
index 254dd9b..9b95f16 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -38,18 +37,22 @@ public final class SourceXmlElementWrapperAnnotation
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
private final AnnotationElementAdapter<Boolean> nillableAdapter;
private Boolean nillable;
+ private TextRange nillableTextRange;
private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
private final AnnotationElementAdapter<Boolean> requiredAdapter;
private Boolean required;
+ private TextRange requiredTextRange;
// ********** constructors **********
@@ -101,18 +104,26 @@ public final class SourceXmlElementWrapperAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.name = this.buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = this.buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.nillable = this.buildNillable(astAnnotation);
+ this.nillableTextRange = this.buildNillableTextRange(astAnnotation);
this.required = this.buildRequired(astAnnotation);
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncName(this.buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.syncNamespace(this.buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.syncNillable(this.buildNillable(astAnnotation));
+ this.nillableTextRange = this.buildNillableTextRange(astAnnotation);
this.syncRequired(this.buildRequired(astAnnotation));
+ this.requiredTextRange = this.buildRequiredTextRange(astAnnotation);
}
@Override
@@ -145,14 +156,18 @@ public final class SourceXmlElementWrapperAnnotation
return this.nameAdapter.getValue(astAnnotation);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nameDeclarationAdapter, astAnnotation);
}
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
+ }
+
// ***** namespace
public String getNamespace() {
@@ -176,12 +191,16 @@ public final class SourceXmlElementWrapperAnnotation
return this.namespaceAdapter.getValue(astAnnotation);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
@@ -207,8 +226,13 @@ public final class SourceXmlElementWrapperAnnotation
return this.nillableAdapter.getValue(astAnnotation);
}
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
+
+ private TextRange buildNillableTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nillableDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNillableTextRange() {
+ return this.nillableTextRange;
}
// ***** required
@@ -233,7 +257,11 @@ public final class SourceXmlElementWrapperAnnotation
return this.requiredAdapter.getValue(astAnnotation);
}
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
+ private TextRange buildRequiredTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.requiredDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getRequiredTextRange() {
+ return this.requiredTextRange;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
index 22cbb88..2bc18b5 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
@@ -39,6 +38,7 @@ public final class SourceXmlEnumAnnotation
private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
+ private TextRange valueTextRange;
private String fullyQualifiedValueClassName;
@@ -59,6 +59,7 @@ public final class SourceXmlEnumAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.value = this.buildValue(astAnnotation);
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astAnnotation);
}
@@ -66,6 +67,7 @@ public final class SourceXmlEnumAnnotation
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncValue(this.buildValue(astAnnotation));
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astAnnotation));
}
@@ -99,8 +101,16 @@ public final class SourceXmlEnumAnnotation
return this.valueAdapter.getValue(astAnnotation);
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
+ public TextRange getValueTextRange() {
+ return this.valueTextRange;
+ }
+
+ private TextRange buildValueTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(VALUE_ADAPTER, astAnnotation);
+ }
+
+ public boolean valueTouches(int pos) {
+ return this.textRangeTouches(this.valueTextRange, pos);
}
// ***** fully-qualified value class name
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
index 45833b4..000573b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -102,8 +101,8 @@ public final class SourceXmlEnumValueAnnotation
return this.getElementTextRange(VALUE_ADAPTER, astAnnotation);
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(VALUE_ADAPTER, pos, astRoot);
+ public boolean valueTouches(int pos) {
+ return this.textRangeTouches(this.valueTextRange, pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
index 12c0c7e..c2fcc50 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
@@ -46,6 +45,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
private String fullyQualifiedValue;
+ private TextRange valueTextRange;
/*
* We want this event fired when the fq class changes by itself, not as a result
@@ -57,6 +57,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private final AnnotationElementAdapter<String> typeAdapter;
private String type;
private String fullyQualifiedType;
+ private TextRange typeTextRange;
/*
* We want this event fired when the fq class changes by itself, not as a result
@@ -112,8 +113,10 @@ public final class SourceXmlJavaTypeAdapterAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.value = buildValue(astAnnotation);
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
this.fullyQualifiedValue = buildFullyQualifiedValue(astAnnotation);
this.type = buildType(astAnnotation);
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
this.fullyQualifiedType = buildFullyQualifiedType(astAnnotation);
}
@@ -121,7 +124,9 @@ public final class SourceXmlJavaTypeAdapterAnnotation
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncValue(buildValue(astAnnotation));
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
syncType(buildType(astAnnotation));
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
syncFullyQualifiedValue(buildFullyQualifiedValue(astAnnotation));
syncFullyQualifiedType(buildFullyQualifiedType(astAnnotation));
@@ -160,9 +165,13 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private String buildValue(Annotation astAnnotation) {
return this.valueAdapter.getValue(astAnnotation);
}
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
+
+ private TextRange buildValueTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.valueDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getValueTextRange() {
+ return this.valueTextRange;
}
public String getFullyQualifiedValue() {
@@ -204,9 +213,13 @@ public final class SourceXmlJavaTypeAdapterAnnotation
private String buildType(Annotation astAnnotation) {
return this.typeAdapter.getValue(astAnnotation);
}
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
+
+ private TextRange buildTypeTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.typeDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getTypeTextRange() {
+ return this.typeTextRange;
}
public String getFullyQualifiedType() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
index d9c5620..6b4814c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
@@ -34,10 +34,12 @@ public class SourceXmlNsAnnotation
private final DeclarationAnnotationElementAdapter<String> namespaceURIDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceURIAdapter;
private String namespaceURI;
+ private TextRange namespaceURITextRange;
private final DeclarationAnnotationElementAdapter<String> prefixDeclarationAdapter;
private final AnnotationElementAdapter<String> prefixAdapter;
private String prefix;
+ private TextRange prefixTextRange;
public SourceXmlNsAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
@@ -73,14 +75,18 @@ public class SourceXmlNsAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.namespaceURI = buildNamespaceURI(astAnnotation);
+ this.namespaceURITextRange = this.buildNamespaceURITextRange(astAnnotation);
this.prefix = buildPrefix(astAnnotation);
+ this.prefixTextRange = this.buildPrefixTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncNamespaceURI(buildNamespaceURI(astAnnotation));
+ this.namespaceURITextRange = this.buildNamespaceURITextRange(astAnnotation);
syncPrefix(buildPrefix(astAnnotation));
+ this.prefixTextRange = this.buildPrefixTextRange(astAnnotation);
}
@Override
@@ -111,7 +117,19 @@ public class SourceXmlNsAnnotation
this.namespaceURI = namespaceURI;
firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
}
+
+ public TextRange getNamespaceURITextRange() {
+ return this.namespaceURITextRange;
+ }
+
+ private TextRange buildNamespaceURITextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceURIDeclarationAdapter, astAnnotation);
+ }
+ public boolean namespaceURITouches(int pos) {
+ return this.textRangeTouches(this.namespaceURITextRange, pos);
+ }
+
public TextRange getNamespaceURITextRange(CompilationUnit astRoot) {
return getElementTextRange(this.namespaceURIDeclarationAdapter, astRoot);
}
@@ -143,13 +161,17 @@ public class SourceXmlNsAnnotation
this.prefix = prefix;
firePropertyChanged(PREFIX_PROPERTY, old, prefix);
}
-
- public TextRange getPrefixTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.prefixDeclarationAdapter, astRoot);
+
+ public TextRange getPrefixTextRange() {
+ return this.prefixTextRange;
+ }
+
+ private TextRange buildPrefixTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.prefixDeclarationAdapter, astAnnotation);
}
- public boolean prefixTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.prefixDeclarationAdapter, pos, astRoot);
+ public boolean prefixTouches(int pos) {
+ return this.textRangeTouches(this.prefixTextRange, pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
index 1d206ed..9e8e069 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -36,10 +35,12 @@ public final class SourceXmlRootElementAnnotation
private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
public SourceXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
@@ -59,14 +60,18 @@ public final class SourceXmlRootElementAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.name = this.buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = this.buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncName(this.buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.syncNamespace(this.buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
}
@Override
@@ -99,12 +104,16 @@ public final class SourceXmlRootElementAnnotation
return this.nameAdapter.getValue(astAnnotation);
}
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(NAME_ADAPTER, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
@@ -130,14 +139,18 @@ public final class SourceXmlRootElementAnnotation
return this.namespaceAdapter.getValue(astAnnotation);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(NAMESPACE_ADAPTER, astAnnotation);
}
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
+ }
+
//*********** static methods ****************
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 7537631..f149faf 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -42,21 +41,25 @@ public class SourceXmlSchemaAnnotation
buildAttributeFormDefaultAdapter();
private final AnnotationElementAdapter<String> attributeFormDefaultAdapter;
private XmlNsForm attributeFormDefault;
+ private TextRange attributeFormDefaultTextRange;
private static final DeclarationAnnotationElementAdapter<String> ELEMENT_FORM_DEFAULT_ADAPTER =
buildElementFormDefaultAdapter();
private final AnnotationElementAdapter<String> elementFormDefaultAdapter;
private XmlNsForm elementFormDefault;
+ private TextRange elementFormDefaultTextRange;
private static final DeclarationAnnotationElementAdapter<String> LOCATION_ADAPTER =
buildLocationAdapter();
private final AnnotationElementAdapter<String> locationAdapter;
private String location;
+ private TextRange locationTextRange;
private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER =
buildNamespaceAdapter();
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final XmlnsAnnotationContainer xmlnsContainer = new XmlnsAnnotationContainer();
@@ -109,9 +112,13 @@ public class SourceXmlSchemaAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.attributeFormDefault = buildAttributeFormDefault(astAnnotation);
+ this.attributeFormDefaultTextRange = this.buildAttributeFormDefaultTextRange(astAnnotation);
this.elementFormDefault = buildElementFormDefault(astAnnotation);
+ this.elementFormDefaultTextRange = this.buildElementFormDefaultTextRange(astAnnotation);
this.location = buildLocation(astAnnotation);
+ this.locationTextRange = this.buildLocationTextRange(astAnnotation);
this.namespace = buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.xmlnsContainer.initializeFromContainerAnnotation(astAnnotation);
}
@@ -119,9 +126,13 @@ public class SourceXmlSchemaAnnotation
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncAttributeFormDefault(buildAttributeFormDefault(astAnnotation));
+ this.attributeFormDefaultTextRange = this.buildAttributeFormDefaultTextRange(astAnnotation);
syncElementFormDefault(buildElementFormDefault(astAnnotation));
+ this.elementFormDefaultTextRange = this.buildElementFormDefaultTextRange(astAnnotation);
syncLocation(buildLocation(astAnnotation));
+ this.locationTextRange = this.buildLocationTextRange(astAnnotation);
syncNamespace(buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.xmlnsContainer.synchronize(astAnnotation);
}
@@ -153,9 +164,13 @@ public class SourceXmlSchemaAnnotation
this.attributeFormDefault = attributeFormDefault;
firePropertyChanged(ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
}
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ATTRIBUTE_FORM_DEFAULT_ADAPTER, astRoot);
+
+ public TextRange getAttributeFormDefaultTextRange() {
+ return this.attributeFormDefaultTextRange;
+ }
+
+ private TextRange buildAttributeFormDefaultTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(ATTRIBUTE_FORM_DEFAULT_ADAPTER, astAnnotation);
}
@@ -181,9 +196,13 @@ public class SourceXmlSchemaAnnotation
this.elementFormDefault = elementFormDefault;
firePropertyChanged(ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
}
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ELEMENT_FORM_DEFAULT_ADAPTER, astRoot);
+
+ public TextRange getElementFormDefaultTextRange() {
+ return this.elementFormDefaultTextRange;
+ }
+
+ private TextRange buildElementFormDefaultTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(ELEMENT_FORM_DEFAULT_ADAPTER, astAnnotation);
}
@@ -209,9 +228,13 @@ public class SourceXmlSchemaAnnotation
this.location = location;
firePropertyChanged(LOCATION_PROPERTY, old, location);
}
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(LOCATION_ADAPTER, astRoot);
+
+ public TextRange getLocationTextRange() {
+ return this.locationTextRange;
+ }
+
+ private TextRange buildLocationTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(LOCATION_ADAPTER, astAnnotation);
}
@@ -237,13 +260,17 @@ public class SourceXmlSchemaAnnotation
this.namespace = namespace;
firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
}
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
+ }
+
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(NAMESPACE_ADAPTER, astAnnotation);
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
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 ad62411..558115a 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
@@ -44,15 +43,18 @@ public class SourceXmlSchemaTypeAnnotation
private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
private final AnnotationElementAdapter<String> typeAdapter;
private String type;
private String fullyQualifiedType;
+ private TextRange typeTextRange;
// ********** constructors **********
@@ -122,18 +124,24 @@ public class SourceXmlSchemaTypeAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.name = buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.type = buildType(astAnnotation);
this.fullyQualifiedType = buildFullyQualifiedType(astAnnotation);
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncName(buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
syncNamespace(buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
syncType(buildType(astAnnotation));
syncFullyQualifiedType(buildFullyQualifiedType(astAnnotation));
+ this.typeTextRange = this.buildTypeTextRange(astAnnotation);
}
@Override
@@ -165,13 +173,17 @@ public class SourceXmlSchemaTypeAnnotation
private String buildName(Annotation astAnnotation) {
return this.nameAdapter.getValue(astAnnotation);
}
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
+
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.nameDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
// ***** namespace
@@ -195,13 +207,17 @@ public class SourceXmlSchemaTypeAnnotation
private String buildNamespace(Annotation astAnnotation) {
return this.namespaceAdapter.getValue(astAnnotation);
}
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
+
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.namespaceDeclarationAdapter, astAnnotation);
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
+ }
+
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
// ***** type
@@ -225,9 +241,13 @@ public class SourceXmlSchemaTypeAnnotation
private String buildType(Annotation astAnnotation) {
return this.typeAdapter.getValue(astAnnotation);
}
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
+
+ private TextRange buildTypeTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.typeDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getTypeTextRange() {
+ return this.typeTextRange;
}
public String getFullyQualifiedType() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
index 14ed789..9f3bf2a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
@@ -48,24 +48,30 @@ public final class SourceXmlTypeAnnotation
private static final DeclarationAnnotationElementAdapter<String> FACTORY_CLASS_ADAPTER = buildFactoryClassAdapter();
private final AnnotationElementAdapter<String> factoryClassAdapter;
private String factoryClass;
+ private TextRange factoryClassTextRange;
private String fullyQualifiedFactoryClassName;
private static final DeclarationAnnotationElementAdapter<String> FACTORY_METHOD_ADAPTER = buildFactoryMethodAdapter();
private final AnnotationElementAdapter<String> factoryMethodAdapter;
private String factoryMethod;
+ private TextRange factoryMethodTextRange;
private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
private final AnnotationElementAdapter<String> nameAdapter;
private String name;
+ private TextRange nameTextRange;
private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
+ private TextRange namespaceTextRange;
private final IndexedDeclarationAnnotationElementAdapter<String> propOrderDeclarationAdapter;
private final AnnotationElementAdapter<String[]> propOrderAdapter;
private final Vector<String> propOrder = new Vector<String>();
+ private TextRange propOrderTextRange;
+ private final Vector<TextRange> propTextRanges = new Vector<TextRange>();
public SourceXmlTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
@@ -101,22 +107,34 @@ public final class SourceXmlTypeAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.factoryClass = this.buildFactoryClass(astAnnotation);
+ this.factoryClassTextRange = this.buildFactoryClassTextRange(astAnnotation);
this.fullyQualifiedFactoryClassName = this.buildFullyQualifiedFactoryClassName(astAnnotation);
this.factoryMethod = this.buildFactoryMethod(astAnnotation);
+ this.factoryMethodTextRange = this.buildFactoryMethodTextRange(astAnnotation);
this.name = this.buildName(astAnnotation);
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.namespace = this.buildNamespace(astAnnotation);
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.initializePropOrder(astAnnotation);
+ this.propOrderTextRange = this.buildPropOrderTextRange(astAnnotation);
+ this.syncPropTextRanges((CompilationUnit) astAnnotation.getRoot());
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
this.syncFactoryClass(this.buildFactoryClass(astAnnotation));
+ this.factoryClassTextRange = this.buildFactoryClassTextRange(astAnnotation);
this.syncFullyQualifiedFactoryClassName(this.buildFullyQualifiedFactoryClassName(astAnnotation));
this.syncFactoryMethod(this.buildFactoryMethod(astAnnotation));
+ this.factoryMethodTextRange = this.buildFactoryMethodTextRange(astAnnotation);
this.syncName(this.buildName(astAnnotation));
+ this.nameTextRange = this.buildNameTextRange(astAnnotation);
this.syncNamespace(this.buildNamespace(astAnnotation));
+ this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation);
this.syncPropOrder(astAnnotation);
+ this.propOrderTextRange = this.buildPropOrderTextRange(astAnnotation);
+ this.syncPropTextRanges((CompilationUnit) astAnnotation.getRoot());
}
@Override
@@ -149,9 +167,14 @@ public final class SourceXmlTypeAnnotation
return this.factoryClassAdapter.getValue(astAnnotation);
}
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_CLASS_ADAPTER, astRoot);
+ public TextRange getFactoryClassTextRange() {
+ return this.factoryClassTextRange;
}
+
+ private TextRange buildFactoryClassTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(FACTORY_CLASS_ADAPTER, astAnnotation);
+ }
+
// ***** fully-qualified factory class name
public String getFullyQualifiedFactoryClassName() {
@@ -190,8 +213,12 @@ public final class SourceXmlTypeAnnotation
return this.factoryMethodAdapter.getValue(astAnnotation);
}
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_METHOD_ADAPTER, astRoot);
+ public TextRange getFactoryMethodTextRange() {
+ return this.factoryMethodTextRange;
+ }
+
+ private TextRange buildFactoryMethodTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(FACTORY_METHOD_ADAPTER, astAnnotation);
}
// ***** name
@@ -215,13 +242,17 @@ public final class SourceXmlTypeAnnotation
private String buildName(Annotation astAnnotation) {
return this.nameAdapter.getValue(astAnnotation);
}
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(NAME_ADAPTER, astRoot);
+
+ private TextRange buildNameTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(NAME_ADAPTER, astAnnotation);
+ }
+
+ public TextRange getNameTextRange() {
+ return this.nameTextRange;
}
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
+ public boolean nameTouches(int pos) {
+ return this.textRangeTouches(this.nameTextRange, pos);
}
@@ -247,12 +278,16 @@ public final class SourceXmlTypeAnnotation
return this.namespaceAdapter.getValue(astAnnotation);
}
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
+ private TextRange buildNamespaceTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(NAMESPACE_ADAPTER, astAnnotation);
+ }
+
+ public TextRange getNamespaceTextRange() {
+ return this.namespaceTextRange;
}
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
+ public boolean namespaceTouches(int pos) {
+ return this.textRangeTouches(this.namespaceTextRange, pos);
}
@@ -305,21 +340,34 @@ public final class SourceXmlTypeAnnotation
String[] astPropOrder = this.propOrderAdapter.getValue(astAnnotation);
this.synchronizeList(Arrays.asList(astPropOrder), this.propOrder, PROP_ORDER_LIST);
}
+
+
+ public TextRange getPropOrderTextRange() {
+ return this.propOrderTextRange;
+ }
+
+ private TextRange buildPropOrderTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.propOrderDeclarationAdapter, astAnnotation);
+ }
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.propOrderDeclarationAdapter, astRoot);
+ public boolean propOrderTouches(int pos) {
+ return this.textRangeTouches(this.propOrderTextRange, pos);
}
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.propOrderDeclarationAdapter, pos, astRoot);
+ //TODO I think we should be able to do this from the Annotation instead of the CompilationUnit
+ private void syncPropTextRanges(CompilationUnit astRoot) {
+ this.propTextRanges.clear();
+ for (int i = 0; i < this.propOrder.size(); i++) {
+ this.propTextRanges.add(i, getElementTextRange(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, i, astRoot), astRoot));
+ }
}
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getElementTextRange(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, index, astRoot), astRoot);
+ public TextRange getPropTextRange(int index) {
+ return this.propTextRanges.get(index);
}
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return textRangeTouches(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, index, astRoot), pos);
+ public boolean propTouches(int index, int pos) {
+ return this.textRangeTouches(this.getPropTextRange(index), pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
index 5dd3b0d..908d5b6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
/**
@@ -21,7 +20,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.1
+ * @version 3.3
* @since 3.0
*/
public interface JaxbBasicSchemaComponentAnnotation
@@ -44,5 +43,5 @@ public interface JaxbBasicSchemaComponentAnnotation
* Return the {@link TextRange} for the 'required' element. If the element
* does not exist return the {@link TextRange} for the XmlAttribute annotation.
*/
- TextRange getRequiredTextRange(CompilationUnit astRoot);
+ TextRange getRequiredTextRange();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
index d87da74..09ad8ef 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -22,7 +21,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.?
+ * @version 3.3
* @since 3.?
*/
public interface QNameAnnotation
@@ -49,13 +48,13 @@ public interface QNameAnnotation
* Return the {@link TextRange} for the 'namespace' element. If the element
* does not exist return the {@link TextRange} for the annotation itself.
*/
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
+ TextRange getNamespaceTextRange();
/**
* Return whether the specified position touches the 'namespace' element.
* Return false if the element does not exist.
*/
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
+ boolean namespaceTouches(int pos);
/**
* Constant associated with changes to the 'name' property
@@ -78,11 +77,11 @@ public interface QNameAnnotation
* Return the {@link TextRange} for the 'name' element. If the element
* does not exist return the {@link TextRange} for the annotation itself.
*/
- TextRange getNameTextRange(CompilationUnit astRoot);
+ TextRange getNameTextRange();
/**
* Return whether the specified position touches the 'name' element.
* Return false if the element does not exist.
*/
- boolean nameTouches(int pos, CompilationUnit astRoot);
+ boolean nameTouches(int pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
index c57b458..27a86d3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlElementAnnotation
@@ -46,7 +45,7 @@ public interface XmlElementAnnotation
* Return the {@link TextRange} for the 'defaultValue' element. If the element
* does not exist return the {@link TextRange} for the XmlElement annotation.
*/
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
+ TextRange getDefaultValueTextRange();
/**
* Corresponds to the 'nillable' element of the XmlElement annotation.
@@ -65,7 +64,7 @@ public interface XmlElementAnnotation
* Return the {@link TextRange} for the 'nillable' element. If the element
* does not exist return the {@link TextRange} for the XmlElement annotation.
*/
- TextRange getNillableTextRange(CompilationUnit astRoot);
+ TextRange getNillableTextRange();
/**
* Corresponds to the 'type' element of the XmlElement annotation.
@@ -88,7 +87,7 @@ public interface XmlElementAnnotation
* Return the {@link TextRange} for the 'type' element. If the element
* does not exist return the {@link TextRange} for the XmlElement annotation.
*/
- TextRange getTypeTextRange(CompilationUnit astRoot);
+ TextRange getTypeTextRange();
/**
* Return the fully-qualified type name as resolved by the AST's bindings.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
index 9b3a83e..2277ca8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
/**
@@ -22,7 +21,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlElementDeclAnnotation
@@ -56,7 +55,7 @@ public interface XmlElementDeclAnnotation
* Return the {@link TextRange} for the 'scope' element. If the element
* does not exist return the {@link TextRange} for the XmlElementDecl annotation.
*/
- TextRange getScopeTextRange(CompilationUnit astRoot);
+ TextRange getScopeTextRange();
/**
* String associated with "fullyQualifiedScopeClassName" property changes.
@@ -96,13 +95,13 @@ public interface XmlElementDeclAnnotation
* Return the {@link TextRange} for the 'substitutionHeadNamespace' element. If the element
* does not exist return the {@link TextRange} for the XmlElementDecl annotation.
*/
- TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot);
+ TextRange getSubstitutionHeadNamespaceTextRange();
/**
* Return whether the specified position touches the 'substitutionHeadNamespace' element.
* Return false if the element does not exist.
*/
- boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot);
+ boolean substitutionHeadNamespaceTouches(int pos);
// ***** substitution head name *****
@@ -128,13 +127,13 @@ public interface XmlElementDeclAnnotation
* Return the {@link TextRange} for the 'substitutionHeadName' element. If the element
* does not exist return the {@link TextRange} for the XmlElementDecl annotation.
*/
- TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot);
+ TextRange getSubstitutionHeadNameTextRange();
/**
* Return whether the specified position touches the 'substitutionHeadName' element.
* Return false if the element does not exist.
*/
- boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot);
+ boolean substitutionHeadNameTouches(int pos);
// ***** default value *****
@@ -160,5 +159,5 @@ public interface XmlElementDeclAnnotation
* Return the {@link TextRange} for the 'defaultValue' element. If the element
* does not exist return the {@link TextRange} for the XmlElementDecl annotation.
*/
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
+ TextRange getDefaultValueTextRange();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
index 6b6d9b8..85391f4 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlElementRefAnnotation
@@ -52,7 +51,7 @@ public interface XmlElementRefAnnotation
* Return the {@link TextRange} for the 'required' element. If the element
* does not exist return the {@link TextRange} for the annotation itself.
*/
- TextRange getRequiredTextRange(CompilationUnit astRoot);
+ TextRange getRequiredTextRange();
// ***** type *****
@@ -83,7 +82,7 @@ public interface XmlElementRefAnnotation
* Return the {@link TextRange} for the 'type' element. If the element
* does not exist return the {@link TextRange} for the annotation itself.
*/
- TextRange getTypeTextRange(CompilationUnit astRoot);
+ TextRange getTypeTextRange();
/**
* String associated with changes to the 'fullyQualifiedName' property of this annotation.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
index aaacd08..e7b0c3a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
/**
@@ -22,7 +21,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlElementWrapperAnnotation
@@ -45,7 +44,7 @@ public interface XmlElementWrapperAnnotation
* Return the {@link TextRange} for the 'nillable' element. If the element
* does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
*/
- TextRange getNillableTextRange(CompilationUnit astRoot);
+ TextRange getNillableTextRange();
/**
* Corresponds to the 'required' element of the XmlElementWrapper annotation.
@@ -64,5 +63,5 @@ public interface XmlElementWrapperAnnotation
* Return the {@link TextRange} for the 'required' element. If the element
* does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
*/
- TextRange getRequiredTextRange(CompilationUnit astRoot);
+ TextRange getRequiredTextRange();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
index 1afc8ca..e7e83b4 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlEnumAnnotation
@@ -50,7 +49,7 @@ public interface XmlEnumAnnotation
* Return the {@link TextRange} for the 'value' element. If the element
* does not exist return the {@link TextRange} for the XmlEnum annotation.
*/
- TextRange getValueTextRange(CompilationUnit astRoot);
+ TextRange getValueTextRange();
/**
* Return the fully-qualified value class name as resolved by the AST's bindings.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
index f6e4ee1..d86bc06 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -52,5 +51,5 @@ public interface XmlEnumValueAnnotation
/**
* Return whether the given position touches the 'value' element value.
*/
- boolean valueTouches(int pos, CompilationUnit astRoot);
+ boolean valueTouches(int pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
index 3abc2cd..01e5159 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlJavaTypeAdapterAnnotation
@@ -51,7 +50,7 @@ public interface XmlJavaTypeAdapterAnnotation
* Return the {@link TextRange} for the 'value' element. If the element
* does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
*/
- TextRange getValueTextRange(CompilationUnit astRoot);
+ TextRange getValueTextRange();
/**
* Return the value's fully-qualified class name as resolved by the AST's bindings.
@@ -85,7 +84,7 @@ public interface XmlJavaTypeAdapterAnnotation
* Return the {@link TextRange} for the 'type' element. If the element
* does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
*/
- TextRange getTypeTextRange(CompilationUnit astRoot);
+ TextRange getTypeTextRange();
/**
* Return the type's fully-qualified class name as resolved by the AST's bindings.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
index fc9a9d8..519b9a2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlNsAnnotation
@@ -49,13 +48,13 @@ public interface XmlNsAnnotation
* Return the {@link TextRange} for the 'namespaceURI' element. If the element
* does not exist return the {@link TextRange} for the XmlNs annotation.
*/
- TextRange getNamespaceURITextRange(CompilationUnit astRoot);
+ TextRange getNamespaceURITextRange();
/**
* Return whether the specified position touches the 'namespaceURI' element.
* Return false if the element does not exist.
*/
- boolean namespaceURITouches(int pos, CompilationUnit astRoot);
+ boolean namespaceURITouches(int pos);
// ***** prefix *****
@@ -78,11 +77,11 @@ public interface XmlNsAnnotation
* Return the {@link TextRange} for the 'prefix' element. If the element
* does not exist return the {@link TextRange} for the XmlNs annotation.
*/
- TextRange getPrefixTextRange(CompilationUnit astRoot);
+ TextRange getPrefixTextRange();
/**
* Return whether the specified position touches the 'prefix' element.
* Return false if the element does not exist.
*/
- boolean prefixTouches(int pos, CompilationUnit astRoot);
+ boolean prefixTouches(int pos);
}
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 0908506..799d3d8 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
@@ -24,7 +23,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlSchemaAnnotation
@@ -47,7 +46,7 @@ public interface XmlSchemaAnnotation
* Return the {@link TextRange} for the 'attributeFormDefault' element. If the element
* does not exist return the {@link TextRange} for the XmlSchema annotation.
*/
- TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot);
+ TextRange getAttributeFormDefaultTextRange();
/**
* Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
@@ -66,7 +65,7 @@ public interface XmlSchemaAnnotation
* Return the {@link TextRange} for the 'elementFormDefault' element. If the element
* does not exist return the {@link TextRange} for the XmlSchema annotation.
*/
- TextRange getElementFormDefaultTextRange(CompilationUnit astRoot);
+ TextRange getElementFormDefaultTextRange();
/**
* Corresponds to the 'location' element of the XmlSchema annotation.
@@ -85,7 +84,7 @@ public interface XmlSchemaAnnotation
* Return the {@link TextRange} for the 'location' element. If the element
* does not exist return the {@link TextRange} for the XmlSchema annotation.
*/
- TextRange getLocationTextRange(CompilationUnit astRoot);
+ TextRange getLocationTextRange();
/**
* Corresponds to the 'namespace' element of the XmlSchema annotation.
@@ -104,13 +103,13 @@ public interface XmlSchemaAnnotation
* Return the {@link TextRange} for the 'namespace' element. If the element
* does not exist return the {@link TextRange} for the XmlSchema annotation.
*/
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
+ TextRange getNamespaceTextRange();
/**
* Return whether the specified position touches the 'namespace' element.
* Return false if the element does not exist.
*/
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
+ boolean namespaceTouches(int pos);
/**
* Corresponds to the 'xmlns' element of the XmlSchema annotation.
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 f6a255e..2ad64e7 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
public interface XmlSchemaTypeAnnotation
@@ -52,7 +51,7 @@ public interface XmlSchemaTypeAnnotation
* Return the {@link TextRange} for the 'type' element. If the element
* does not exist return the {@link TextRange} for the XmlSchemaType annotation.
*/
- TextRange getTypeTextRange(CompilationUnit astRoot);
+ TextRange getTypeTextRange();
String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
@@ -70,5 +69,5 @@ public interface XmlSchemaTypeAnnotation
/**
* The default type when none is specified
*/
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT";
+ String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT"; //$NON-NLS-1$
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
index 781cde9..a69f03f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.?
+ * @version 3.3
* @since 3.0
*/
public interface XmlTypeAnnotation
@@ -56,7 +55,7 @@ public interface XmlTypeAnnotation
* Return the {@link TextRange} for the 'factoryClass' element. If the element
* does not exist return the {@link TextRange} for the XmlType annotation.
*/
- TextRange getFactoryClassTextRange(CompilationUnit astRoot);
+ TextRange getFactoryClassTextRange();
String FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY = "fullyQualifiedFactoryClassName"; //$NON-NLS-1$
@@ -91,7 +90,7 @@ public interface XmlTypeAnnotation
* Return the {@link TextRange} for the 'factoryMethod' element. If the element
* does not exist return the {@link TextRange} for the XmlType annotation.
*/
- TextRange getFactoryMethodTextRange(CompilationUnit astRoot);
+ TextRange getFactoryMethodTextRange();
// ***** prop order *****
@@ -142,23 +141,23 @@ public interface XmlTypeAnnotation
/**
* Return the text range of the 'propOrder' element of the XmlType annotation.
*/
- TextRange getPropOrderTextRange(CompilationUnit astRoot);
+ TextRange getPropOrderTextRange();
/**
* Return whether the specified position touches the 'propOrder' element.
* Return false if the element does not exist.
*/
- boolean propOrderTouches(int pos, CompilationUnit astRoot);
+ boolean propOrderTouches(int pos);
/**
* Return the text range of the prop at the specified index
* @throws ArrayIndexOutOfBoundsException if the index is out of range
*/
- TextRange getPropTextRange(int index, CompilationUnit astRoot);
+ TextRange getPropTextRange(int index);
/**
* Return whether the specified position touches the prop at the specified index.
* @throws ArrayIndexOutOfBoundsException if the index is out of range
*/
- boolean propTouches(int index, int pos, CompilationUnit astRoot);
+ boolean propTouches(int index, int pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java
index 7157109..daa689a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
import java.util.List;
@@ -87,10 +96,10 @@ public class ELJavaXmlDiscriminatorNode
public Iterable<String> getJavaCompletionProposals(
int pos, Filter<String> filter, CompilationUnit astRoot) {
- if (getAnnotation().valueTouches(pos, astRoot) && this.value != null) {
+ if (getAnnotation().valueTouches(pos) && this.value != null) {
XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.value);
- return xpath.getCompletionProposals(new XPathContext(astRoot), xsdType, pos, filter);
+ return xpath.getCompletionProposals(new XPathContext(), xsdType, pos, filter);
}
return EmptyIterable.instance();
@@ -114,7 +123,7 @@ public class ELJavaXmlDiscriminatorNode
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XML_DISCRIMINATOR_NODE__NOT_SPECIFIED,
ELJavaXmlDiscriminatorNode.this,
- getValueTextRange(astRoot)));
+ getValueTextRange()));
return;
}
@@ -124,28 +133,25 @@ public class ELJavaXmlDiscriminatorNode
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
ELJavaXmlDiscriminatorNode.this,
- getValueTextRange(astRoot)));
+ getValueTextRange()));
return;
}
XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.value);
- xpath.validate(new XPathContext(astRoot), xsdType, messages);
+ xpath.validate(new XPathContext(), xsdType, messages);
}
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
+ protected TextRange getValueTextRange() {
// should never be null
- return getAnnotation().getValueTextRange(astRoot);
+ return getAnnotation().getValueTextRange();
}
protected class XPathContext
implements XPath.Context {
-
- private CompilationUnit astRoot;
-
- protected XPathContext(CompilationUnit astRoot) {
- this.astRoot = astRoot;
+
+ protected XPathContext() {
}
@@ -158,7 +164,7 @@ public class ELJavaXmlDiscriminatorNode
}
public TextRange getTextRange() {
- return ELJavaXmlDiscriminatorNode.this.getValueTextRange(this.astRoot);
+ return ELJavaXmlDiscriminatorNode.this.getValueTextRange();
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
index ba04a80..3e9aa0c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
@@ -131,8 +131,8 @@ public class ELJavaXmlInverseReferenceMapping
return result;
}
- if (getXmlInverseReferenceAnnotation().mappedByTouches(pos, astRoot)) {
- result = getMappedByProposals(filter, astRoot);
+ if (getXmlInverseReferenceAnnotation().mappedByTouches(pos)) {
+ result = getMappedByProposals(filter);
}
if (! CollectionTools.isEmpty(result)) {
return result;
@@ -141,7 +141,7 @@ public class ELJavaXmlInverseReferenceMapping
return EmptyIterable.instance();
}
- protected Iterable<String> getMappedByProposals(Filter<String> filter, CompilationUnit astRoot) {
+ protected Iterable<String> getMappedByProposals(Filter<String> filter) {
JaxbClassMapping referencedClassMapping = getReferencedClassMapping();
if (referencedClassMapping == null) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java
index 8c7a989..ef8a40b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java
@@ -140,18 +140,18 @@ public class ELJavaXmlJoinNode
public Iterable<String> getJavaCompletionProposals(
int pos, Filter<String> filter, CompilationUnit astRoot) {
- if (getAnnotation().xmlPathTouches(pos, astRoot) && this.xmlPath != null) {
+ if (getAnnotation().xmlPathTouches(pos) && this.xmlPath != null) {
XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.xmlPath);
- return xpath.getCompletionProposals(new XmlPathContext(astRoot), xsdType, pos, filter);
+ return xpath.getCompletionProposals(new XmlPathContext(), xsdType, pos, filter);
}
- if (getAnnotation().referencedXmlPathTouches(pos, astRoot) && this.referencedXmlPath != null) {
+ if (getAnnotation().referencedXmlPathTouches(pos) && this.referencedXmlPath != null) {
XsdTypeDefinition xsdType = getAttributeMapping().getReferencedXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.referencedXmlPath);
- Iterable<String> result = xpath.getCompletionProposals(new ReferencedXmlPathContext(astRoot), xsdType, pos, filter);
+ Iterable<String> result = xpath.getCompletionProposals(new ReferencedXmlPathContext(), xsdType, pos, filter);
ELClassMapping referencedClassMapping = this.context.getAttributeMapping().getReferencedClassMapping();
if (referencedClassMapping != null) {
@@ -178,18 +178,18 @@ public class ELJavaXmlJoinNode
public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
super.validate(messages, reporter, astRoot);
- validateXmlPath(messages, astRoot);
- validateReferencedXmlPath(messages, astRoot);
+ validateXmlPath(messages);
+ validateReferencedXmlPath(messages);
}
- protected void validateXmlPath(List<IMessage> messages, CompilationUnit astRoot) {
+ protected void validateXmlPath(List<IMessage> messages) {
if (StringTools.stringIsEmpty(this.xmlPath)) {
messages.add(
ELJaxbValidationMessageBuilder.buildMessage(
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XML_JOIN_NODE__XML_PATH_NOT_SPECIFIED,
ELJavaXmlJoinNode.this,
- getXmlPathTextRange(astRoot)));
+ getXmlPathTextRange()));
return;
}
@@ -199,23 +199,23 @@ public class ELJavaXmlJoinNode
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
ELJavaXmlJoinNode.this,
- getXmlPathTextRange(astRoot)));
+ getXmlPathTextRange()));
return;
}
XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.xmlPath);
- xpath.validate(new XmlPathContext(astRoot), xsdType, messages);
+ xpath.validate(new XmlPathContext(), xsdType, messages);
}
- protected void validateReferencedXmlPath(List<IMessage> messages, CompilationUnit astRoot) {
+ protected void validateReferencedXmlPath(List<IMessage> messages) {
if (StringTools.stringIsEmpty(this.referencedXmlPath)) {
messages.add(
ELJaxbValidationMessageBuilder.buildMessage(
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_SPECIFIED,
ELJavaXmlJoinNode.this,
- getReferencedXmlPathTextRange(astRoot)));
+ getReferencedXmlPathTextRange()));
return;
}
@@ -225,7 +225,7 @@ public class ELJavaXmlJoinNode
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
ELJavaXmlJoinNode.this,
- getReferencedXmlPathTextRange(astRoot)));
+ getReferencedXmlPathTextRange()));
return;
}
@@ -238,22 +238,22 @@ public class ELJavaXmlJoinNode
ELJaxbValidationMessages.XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_IN_REFERENCED_CLASS_KEYS,
new String[] { referencedClassMapping.getJaxbType().getFullyQualifiedName(), this.referencedXmlPath },
ELJavaXmlJoinNode.this,
- getReferencedXmlPathTextRange(astRoot)));
+ getReferencedXmlPathTextRange()));
}
XsdTypeDefinition xsdType = getAttributeMapping().getReferencedXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.referencedXmlPath);
- xpath.validate(new ReferencedXmlPathContext(astRoot), xsdType, messages);
+ xpath.validate(new ReferencedXmlPathContext(), xsdType, messages);
}
- protected TextRange getXmlPathTextRange(CompilationUnit astRoot) {
+ protected TextRange getXmlPathTextRange() {
// should never be null
- return getAnnotation().getXmlPathTextRange(astRoot);
+ return getAnnotation().getXmlPathTextRange();
}
- protected TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot) {
+ protected TextRange getReferencedXmlPathTextRange() {
// should never be null
- return getAnnotation().getReferencedXmlPathTextRange(astRoot);
+ return getAnnotation().getReferencedXmlPathTextRange();
}
@@ -268,10 +268,7 @@ public class ELJavaXmlJoinNode
protected abstract class XPathContext
implements XPath.Context {
- protected CompilationUnit astRoot;
-
- protected XPathContext(CompilationUnit astRoot) {
- this.astRoot = astRoot;
+ protected XPathContext() {
}
@@ -288,13 +285,13 @@ public class ELJavaXmlJoinNode
protected class XmlPathContext
extends XPathContext {
- protected XmlPathContext(CompilationUnit astRoot) {
- super(astRoot);
+ protected XmlPathContext() {
+ super();
}
public TextRange getTextRange() {
- return ELJavaXmlJoinNode.this.getXmlPathTextRange(this.astRoot);
+ return ELJavaXmlJoinNode.this.getXmlPathTextRange();
}
}
@@ -302,13 +299,13 @@ public class ELJavaXmlJoinNode
protected class ReferencedXmlPathContext
extends XPathContext {
- protected ReferencedXmlPathContext(CompilationUnit astRoot) {
- super(astRoot);
+ protected ReferencedXmlPathContext() {
+ super();
}
public TextRange getTextRange() {
- return ELJavaXmlJoinNode.this.getReferencedXmlPathTextRange(this.astRoot);
+ return ELJavaXmlJoinNode.this.getReferencedXmlPathTextRange();
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java
index 3397fd6..898567e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java
@@ -190,14 +190,14 @@ public class ELJavaXmlJoinNodesMapping
getValidationTextRange(astRoot)));
}
- validateDuplicateXmlPaths(messages, reporter, astRoot);
+ validateDuplicateXmlPaths(messages, reporter);
for (ELJavaXmlJoinNode xmlJoinNode : this.xmlJoinNodeContainer.getContextElements()) {
xmlJoinNode.validate(messages, reporter, astRoot);
}
}
- protected void validateDuplicateXmlPaths(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ protected void validateDuplicateXmlPaths(List<IMessage> messages, IReporter reporter) {
Bag<String> xmlPaths = new HashBag<String>();
Bag<String> referencedXmlPaths = new HashBag<String>();
@@ -213,13 +213,13 @@ public class ELJavaXmlJoinNodesMapping
}
for (ELJavaXmlJoinNode joinNode : this.xmlJoinNodeContainer.getContextElements()) {
- validateDuplicateXmlPath(joinNode, xmlPaths, messages, astRoot);
- validateDuplicateReferencedXmlPath(joinNode, referencedXmlPaths, messages, astRoot);
+ validateDuplicateXmlPath(joinNode, xmlPaths, messages);
+ validateDuplicateReferencedXmlPath(joinNode, referencedXmlPaths, messages);
}
}
protected void validateDuplicateXmlPath(ELJavaXmlJoinNode joinNode, Bag<String> xmlPaths,
- List<IMessage> messages, CompilationUnit astRoot) {
+ List<IMessage> messages) {
String xmlPath = joinNode.getXmlPath();
if (xmlPaths.count(xmlPath) > 1) {
messages.add(
@@ -228,12 +228,12 @@ public class ELJavaXmlJoinNodesMapping
ELJaxbValidationMessages.XML_JOIN_NODES__DUPLICATE_XML_PATH,
new String[] { xmlPath },
joinNode,
- joinNode.getXmlPathTextRange(astRoot)));
+ joinNode.getXmlPathTextRange()));
}
}
protected void validateDuplicateReferencedXmlPath(ELJavaXmlJoinNode joinNode, Bag<String> referencedXmlPaths,
- List<IMessage> messages, CompilationUnit astRoot) {
+ List<IMessage> messages) {
String referencedXmlPath = joinNode.getReferencedXmlPath();
if (referencedXmlPaths.count(referencedXmlPath) > 1) {
messages.add(
@@ -242,7 +242,7 @@ public class ELJavaXmlJoinNodesMapping
ELJaxbValidationMessages.XML_JOIN_NODES__DUPLICATE_REFERENCED_XML_PATH,
new String[] { referencedXmlPath },
joinNode,
- joinNode.getReferencedXmlPathTextRange(astRoot)));
+ joinNode.getReferencedXmlPathTextRange()));
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java
index 63b716e..d73eefe 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
import java.util.List;
@@ -97,10 +106,10 @@ public class ELJavaXmlPath
public Iterable<String> getJavaCompletionProposals(
int pos, Filter<String> filter, CompilationUnit astRoot) {
- if (getAnnotation().valueTouches(pos, astRoot) && this.value != null) {
+ if (getAnnotation().valueTouches(pos) && this.value != null) {
XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.value);
- return xpath.getCompletionProposals(new XPathContext(astRoot), xsdType, pos, filter);
+ return xpath.getCompletionProposals(new XPathContext(), xsdType, pos, filter);
}
return EmptyIterable.instance();
@@ -124,7 +133,7 @@ public class ELJavaXmlPath
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XML_PATH__NOT_SPECIFIED,
ELJavaXmlPath.this,
- getValueTextRange(astRoot)));
+ getValueTextRange()));
return;
}
@@ -134,18 +143,18 @@ public class ELJavaXmlPath
IMessage.HIGH_SEVERITY,
ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
ELJavaXmlPath.this,
- getValueTextRange(astRoot)));
+ getValueTextRange()));
return;
}
XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
XPath xpath = XPathFactory.instance().getXpath(this.value);
- xpath.validate(new XPathContext(astRoot), xsdType, messages);
+ xpath.validate(new XPathContext(), xsdType, messages);
}
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
+ protected TextRange getValueTextRange() {
// should never be null
- return getAnnotation().getValueTextRange(astRoot);
+ return getAnnotation().getValueTextRange();
}
@@ -160,10 +169,7 @@ public class ELJavaXmlPath
protected class XPathContext
implements XPath.Context {
- private CompilationUnit astRoot;
-
- protected XPathContext(CompilationUnit astRoot) {
- this.astRoot = astRoot;
+ protected XPathContext() {
}
@@ -176,7 +182,7 @@ public class ELJavaXmlPath
}
public TextRange getTextRange() {
- return ELJavaXmlPath.this.getValueTextRange(this.astRoot);
+ return ELJavaXmlPath.this.getValueTextRange();
}
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java
index bfe576f..d2ed31b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -67,11 +66,11 @@ public class BinaryXmlDiscriminatorNodeAnnotation
return (String) this.getJdtMemberValue(ELJaxb.XML_DISCRIMINATOR_NODE__VALUE);
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
+ public TextRange getValueTextRange() {
throw new UnsupportedOperationException();
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
+ public boolean valueTouches(int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java
index 1bf79a1..dd8f19f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -71,7 +70,7 @@ public class BinaryXmlInverseReferenceAnnotation
throw new UnsupportedOperationException();
}
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
+ public boolean mappedByTouches(int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java
index ab5497b..b67a3c7 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -47,7 +46,7 @@ public class BinaryXmlJoinNodeAnnotation
@Override
public void toString(StringBuilder sb) {
- sb.append(this.xmlPath + " -> " + this.referencedXmlPath);
+ sb.append(this.xmlPath + " -> " + this.referencedXmlPath); //$NON-NLS-1$
}
@@ -71,11 +70,11 @@ public class BinaryXmlJoinNodeAnnotation
return (String) this.getJdtMemberValue(ELJaxb.XML_JOIN_NODE__XML_PATH);
}
- public TextRange getXmlPathTextRange(CompilationUnit astRoot) {
+ public TextRange getXmlPathTextRange() {
throw new UnsupportedOperationException();
}
- public boolean xmlPathTouches(int pos, CompilationUnit astRoot) {
+ public boolean xmlPathTouches(int pos) {
throw new UnsupportedOperationException();
}
@@ -100,11 +99,11 @@ public class BinaryXmlJoinNodeAnnotation
return (String) this.getJdtMemberValue(ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH);
}
- public TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot) {
+ public TextRange getReferencedXmlPathTextRange() {
throw new UnsupportedOperationException();
}
- public boolean referencedXmlPathTouches(int pos, CompilationUnit astRoot) {
+ public boolean referencedXmlPathTouches(int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java
index 41e5f85..96e923e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -67,11 +66,11 @@ public class BinaryXmlPathAnnotation
return (String) this.getJdtMemberValue(ELJaxb.XML_PATH__VALUE);
}
- public TextRange getValueTextRange(CompilationUnit astRoot) {
+ public TextRange getValueTextRange() {
throw new UnsupportedOperationException();
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
+ public boolean valueTouches(int pos) {
throw new UnsupportedOperationException();
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java
index 931cec5..f1957a6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java
@@ -39,6 +39,7 @@ public class SourceXmlDiscriminatorNodeAnnotation
private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
+ private TextRange valueTextRange;
public SourceXmlDiscriminatorNodeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
@@ -76,12 +77,14 @@ public class SourceXmlDiscriminatorNodeAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.value = buildValue(astAnnotation);
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncValue(buildValue(astAnnotation));
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
}
@Override
@@ -112,12 +115,16 @@ public class SourceXmlDiscriminatorNodeAnnotation
private String buildValue(Annotation astAnnotation) {
return this.valueAdapter.getValue(astAnnotation);
}
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
+
+ public TextRange getValueTextRange() {
+ return this.valueTextRange;
+ }
+
+ private TextRange buildValueTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.valueDeclarationAdapter, astAnnotation);
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.valueDeclarationAdapter, pos, astRoot);
+ public boolean valueTouches(int pos) {
+ return this.textRangeTouches(this.valueTextRange, pos);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java
index 08c1234..58d3916 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -124,7 +123,7 @@ public class SourceXmlDiscriminatorValueAnnotation
return this.getElementTextRange(this.valueDeclarationAdapter, astAnnotation);
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.valueDeclarationAdapter, pos, astRoot);
+ public boolean valueTouches(int pos) {
+ return this.textRangeTouches(this.valueTextRange, pos);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java
index f11c4db..355660b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -114,7 +113,7 @@ public class SourceXmlInverseReferenceAnnotation
return this.getElementTextRange(this.mappedByDeclarationAdapter, astAnnotation);
}
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.mappedByDeclarationAdapter, pos, astRoot);
+ public boolean mappedByTouches(int pos) {
+ return this.textRangeTouches(this.mappedByTextRange, pos);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java
index fcc8062..2432cc5 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
@@ -43,10 +42,12 @@ public class SourceXmlJoinNodeAnnotation
private final DeclarationAnnotationElementAdapter<String> xmlPathDeclarationAdapter;
private final AnnotationElementAdapter<String> xmlPathAdapter;
private String xmlPath;
+ private TextRange xmlPathTextRange;
private final DeclarationAnnotationElementAdapter<String> referencedXmlPathDeclarationAdapter;
private final AnnotationElementAdapter<String> referencedXmlPathAdapter;
private String referencedXmlPath;
+ private TextRange referencedXmlPathTextRange;
public static SourceXmlJoinNodeAnnotation buildSourceXmlJoinNodeAnnotation(
@@ -100,19 +101,23 @@ public class SourceXmlJoinNodeAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.xmlPath = buildXmlPath(astAnnotation);
+ this.xmlPathTextRange = this.buildXmlPathTextRange(astAnnotation);
this.referencedXmlPath = buildReferencedXmlPath(astAnnotation);
+ this.referencedXmlPathTextRange = this.buildReferencedXmlPathTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncXmlPath(buildXmlPath(astAnnotation));
+ this.xmlPathTextRange = this.buildXmlPathTextRange(astAnnotation);
syncReferencedXmlPath(buildReferencedXmlPath(astAnnotation));
+ this.referencedXmlPathTextRange = this.buildReferencedXmlPathTextRange(astAnnotation);
}
@Override
public void toString(StringBuilder sb) {
- sb.append(this.xmlPath + " -> " + this.referencedXmlPath);
+ sb.append(this.xmlPath + " -> " + this.referencedXmlPath); //$NON-NLS-1$
}
@@ -138,13 +143,17 @@ public class SourceXmlJoinNodeAnnotation
private String buildXmlPath(Annotation astAnnotation) {
return this.xmlPathAdapter.getValue(astAnnotation);
}
-
- public TextRange getXmlPathTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.xmlPathDeclarationAdapter, astRoot);
+
+ private TextRange buildXmlPathTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.xmlPathDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getXmlPathTextRange() {
+ return this.xmlPathTextRange;
}
- public boolean xmlPathTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.xmlPathDeclarationAdapter, pos, astRoot);
+ public boolean xmlPathTouches(int pos) {
+ return this.textRangeTouches(this.xmlPathTextRange, pos);
}
@@ -170,13 +179,17 @@ public class SourceXmlJoinNodeAnnotation
private String buildReferencedXmlPath(Annotation astAnnotation) {
return this.referencedXmlPathAdapter.getValue(astAnnotation);
}
-
- public TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedXmlPathDeclarationAdapter, astRoot);
+
+ private TextRange buildReferencedXmlPathTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.referencedXmlPathDeclarationAdapter, astAnnotation);
+ }
+
+ public TextRange getReferencedXmlPathTextRange() {
+ return this.referencedXmlPathTextRange;
}
- public boolean referencedXmlPathTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.referencedXmlPathDeclarationAdapter, pos, astRoot);
+ public boolean referencedXmlPathTouches(int pos) {
+ return this.textRangeTouches(this.referencedXmlPathTextRange, pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java
index b2cc146..173473e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
@@ -43,6 +42,7 @@ public class SourceXmlPathAnnotation
private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
+ private TextRange valueTextRange;
public static SourceXmlPathAnnotation buildSourceXmlPathAnnotation(
@@ -90,12 +90,14 @@ public class SourceXmlPathAnnotation
public void initialize(Annotation astAnnotation) {
super.initialize(astAnnotation);
this.value = buildValue(astAnnotation);
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
}
@Override
public void synchronizeWith(Annotation astAnnotation) {
super.synchronizeWith(astAnnotation);
syncValue(buildValue(astAnnotation));
+ this.valueTextRange = this.buildValueTextRange(astAnnotation);
}
@Override
@@ -126,13 +128,17 @@ public class SourceXmlPathAnnotation
private String buildValue(Annotation astAnnotation) {
return this.valueAdapter.getValue(astAnnotation);
}
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
+
+ public TextRange getValueTextRange() {
+ return this.valueTextRange;
+ }
+
+ private TextRange buildValueTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.valueDeclarationAdapter, astAnnotation);
}
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.valueDeclarationAdapter, pos, astRoot);
+ public boolean valueTouches(int pos) {
+ return this.textRangeTouches(this.valueTextRange, pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java
index 43efff8..881d760 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -50,10 +49,10 @@ public interface XmlDiscriminatorNodeAnnotation
* Return the text range associated with the 'value' element.
* Return the text range of this annotation if the element is absent.
*/
- TextRange getValueTextRange(CompilationUnit astRoot);
+ TextRange getValueTextRange();
/**
* Return whether the specified text position is within the 'value' element.
*/
- boolean valueTouches(int pos, CompilationUnit astRoot);
+ boolean valueTouches(int pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
index 416ec22..edd20ee 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -55,5 +54,5 @@ public interface XmlInverseReferenceAnnotation
/**
* Return whether the specified text position is within the 'mappedBy' element.
*/
- boolean mappedByTouches(int pos, CompilationUnit astRoot);
+ boolean mappedByTouches(int pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java
index 7e8ff12..32bf759 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -23,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.2
+ * @version 3.3
* @since 3.2
*/
public interface XmlJoinNodeAnnotation
@@ -50,12 +49,12 @@ public interface XmlJoinNodeAnnotation
* Return the text range associated with the 'xmlPath' element.
* Return the text range of this annotation if the element is absent.
*/
- TextRange getXmlPathTextRange(CompilationUnit astRoot);
+ TextRange getXmlPathTextRange();
/**
* Return whether the specified text position is within the 'xmlPath' element.
*/
- boolean xmlPathTouches(int pos, CompilationUnit astRoot);
+ boolean xmlPathTouches(int pos);
/**
@@ -79,10 +78,10 @@ public interface XmlJoinNodeAnnotation
* Return the text range associated with the 'referencedXmlPath' element.
* Return the text range of this annotation if the element is absent.
*/
- TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot);
+ TextRange getReferencedXmlPathTextRange();
/**
* Return whether the specified text position is within the 'referencedXmlPath' element.
*/
- boolean referencedXmlPathTouches(int pos, CompilationUnit astRoot);
+ boolean referencedXmlPathTouches(int pos);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java
index 5a6908a..f72cdd6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java
@@ -1,6 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -14,7 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.2
+ * @version 3.3
* @since 3.2
*/
public interface XmlPathAnnotation
@@ -41,10 +49,10 @@ public interface XmlPathAnnotation
* Return the text range associated with the 'value' element.
* Return the text range of this annotation if the element is absent.
*/
- TextRange getValueTextRange(CompilationUnit astRoot);
+ TextRange getValueTextRange();
/**
* Return whether the specified text position is within the 'value' element.
*/
- boolean valueTouches(int pos, CompilationUnit astRoot);
+ boolean valueTouches(int pos);
}