diff options
author | Karen Butzke | 2012-08-27 20:22:03 +0000 |
---|---|---|
committer | Karen Butzke | 2012-08-27 20:22:03 +0000 |
commit | 0c48289ad0c3a335b93ecf3da8e17f96121e0247 (patch) | |
tree | 988728136c3583daced4411cc2a7c172a1136e18 /jaxb/plugins | |
parent | 3f09be219e0653795d242d51ab08ec31d4057011 (diff) | |
download | webtools.dali-0c48289ad0c3a335b93ecf3da8e17f96121e0247.tar.gz webtools.dali-0c48289ad0c3a335b93ecf3da8e17f96121e0247.tar.xz webtools.dali-0c48289ad0c3a335b93ecf3da8e17f96121e0247.zip |
Bug 376595 - stop building CompilationUnit
astRoot when validating, moved validate
methods up the hierarchy, removed textRange resolvers, removed some
owner interfaces
Diffstat (limited to 'jaxb/plugins')
78 files changed, 535 insertions, 586 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java index 67cb961f77..96120b4678 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java @@ -9,8 +9,13 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.context; +import java.util.List; + import org.eclipse.jpt.common.core.JptResourceTypeReference; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jaxb.core.JaxbNode; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; +import org.eclipse.wst.validation.internal.provisional.core.IReporter; /** * Common protocol for JAXB objects that have a context, as opposed to @@ -22,7 +27,7 @@ import org.eclipse.jpt.jaxb.core.JaxbNode; * 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 JaxbContextNode @@ -43,4 +48,18 @@ public interface JaxbContextNode */ void update(); + + + // ******************** validation **************************************** + + /** + * Adds to the list of current validation messages + */ + void validate(List<IMessage> messages, IReporter reporter); + + /** + * Return the text range for highlighting errors for this object + */ + TextRange getValidationTextRange(); + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java index f203a01b64..fdb9aa6ecb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.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,10 +9,6 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.context; -import java.util.List; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; - /** * Root of the JAXB context model. * <p> @@ -22,7 +18,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; * 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 JaxbContextRoot @@ -104,13 +100,4 @@ public interface JaxbContextRoot // ***** misc ***** - - - - // ***** validation ***** - - /** - * Add validation messages to the specified list. - */ - public void validate(List<IMessage> messages, IReporter reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java index 739cbe8806..2c730c85fb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.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,10 +9,7 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.context; -import java.util.List; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; /** * @@ -23,7 +20,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; * 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.03 * @since 3.0 */ public interface JaxbPackage @@ -75,12 +72,4 @@ public interface JaxbPackage * Return the {@link XsdSchema} associated with this package, if there is one, null otherwise */ XsdSchema getXsdSchema(); - - - // **************** validation ******************************************** - - /** - * Add validation messages to the specified list. - */ - public void validate(List<IMessage> messages, IReporter reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java index 5ef41785db..bd648dc8dd 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.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; @@ -23,7 +22,7 @@ import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; * 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 JaxbQName @@ -57,7 +56,7 @@ public interface JaxbQName // ***** validation ***** - TextRange getNamespaceTextRange(CompilationUnit astRoot); + TextRange getNamespaceTextRange(); - TextRange getNameTextRange(CompilationUnit astRoot); + TextRange getNameTextRange(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java index 333cbcf353..378e161ee8 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.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.XmlElementAnnotation; @@ -110,5 +109,5 @@ public interface XmlElement // ***** validation ***** - TextRange getTypeTextRange(CompilationUnit astRoot); + TextRange getTypeTextRange(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java index b2859f03dd..c833c9915d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.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,13 +9,9 @@ *******************************************************************************/ package org.eclipse.jpt.jaxb.core.context.java; -import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.Filter; import org.eclipse.jpt.jaxb.core.context.JaxbContextNode; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; public interface JavaContextNode @@ -27,17 +23,4 @@ public interface JavaContextNode * Return the Java code-completion proposals for the specified position in the source code. */ Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot); - - - // ******************** validation **************************************** - - /** - * Adds to the list of current validation messages - */ - void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot); - - /** - * Return the text range for highlighting errors for this object - */ - TextRange getValidationTextRange(CompilationUnit astRoot); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java index 5e270b27f4..a8a23763ae 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.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,11 +9,17 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.internal.context; +import java.util.List; + import org.eclipse.jpt.common.core.JptResourceType; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jaxb.core.JaxbNode; import org.eclipse.jpt.jaxb.core.context.JaxbContextNode; import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot; import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbNode; +import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; +import org.eclipse.wst.validation.internal.provisional.core.IReporter; public abstract class AbstractJaxbContextNode extends AbstractJaxbNode @@ -83,4 +89,19 @@ public abstract class AbstractJaxbContextNode public JaxbContextRoot getContextRoot() { return getParent().getContextRoot(); } + + + // **************** validation ******************************************** + + public abstract TextRange getValidationTextRange(); + + /** + * All subclass implementations {@link #validate(List, IReporter)} + * should be preceded by a "super" call to this method + */ + public void validate(List<IMessage> messages, IReporter reporter) { + if (reporter.isCancelled()) { + throw new ValidationCancelledException(); + } + } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java index e7e5170c90..ea3b3a42b4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java @@ -20,6 +20,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum; import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.common.utility.internal.NotNullFilter; import org.eclipse.jpt.common.utility.internal.StringTools; @@ -568,8 +569,15 @@ public abstract class AbstractJaxbContextRoot // **************** validation ******************************************** + + @Override + public TextRange getValidationTextRange() { + return TextRange.Empty.instance(); //? + } + @Override public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); for (JaxbPackage pkg : this.packages.values()) { pkg.validate(messages, reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java index 5869fee34f..46927b9548 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.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,6 +11,7 @@ package org.eclipse.jpt.jaxb.core.internal.context; import java.util.List; import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; @@ -20,7 +21,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlRegistry; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; -import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException; import org.eclipse.wst.validation.internal.provisional.core.IMessage; import org.eclipse.wst.validation.internal.provisional.core.IReporter; @@ -110,7 +110,7 @@ public class GenericPackage // **************** misc ************************************************** public String getNamespace() { - return (getPackageInfo() == null) ? "" : getPackageInfo().getXmlSchema().getNamespace(); + return (getPackageInfo() == null) ? "" : getPackageInfo().getXmlSchema().getNamespace(); //$NON-NLS-1$ } public XmlNsForm getAttributeFormDefault() { @@ -127,11 +127,15 @@ public class GenericPackage // **************** validation ******************************************** + + @Override + public TextRange getValidationTextRange() { + return TextRange.Empty.instance(); //? + } + @Override public void validate(List<IMessage> messages, IReporter reporter) { - if (reporter.isCancelled()) { - throw new ValidationCancelledException(); - } + super.validate(messages, reporter); if (getJaxbProject().getSchemaLibrary().getSchema(getNamespace()) == null) { messages.add( diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java index f560b9e093..6789f06f05 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.Annotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; @@ -181,11 +180,11 @@ public abstract class AbstractJavaAdaptableAttributeMapping<A extends Annotation @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlJavaTypeAdapter != null) { - this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot); + this.xmlJavaTypeAdapter.validate(messages, reporter); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java index 7c215be62b..3bec53e001 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java @@ -9,7 +9,6 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.internal.context.java; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.Annotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute; import org.eclipse.jpt.common.core.utility.TextRange; @@ -102,8 +101,8 @@ public abstract class AbstractJavaAttributeMapping<A extends Annotation> // ********** validation ********** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation() == null ? getJavaResourceAttribute().getNameTextRange() : getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation() == null ? getJavaResourceAttribute().getNameTextRange() : getAnnotation().getTextRange(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java index d92a2bb966..2a20cb3dfa 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java @@ -9,20 +9,15 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.internal.context.java; -import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.JptResourceType; import org.eclipse.jpt.common.core.internal.utility.PlatformTools; import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.Filter; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.jaxb.core.JaxbNode; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode; -import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; public abstract class AbstractJavaContextNode @@ -47,19 +42,4 @@ public abstract class AbstractJavaContextNode int pos, Filter<String> filter, CompilationUnit astRoot) { return EmptyIterable.instance(); } - - - // **************** validation ******************************************** - - public abstract TextRange getValidationTextRange(CompilationUnit astRoot); - - /** - * All subclass implementations {@link #validate(List, IReporter, CompilationUnit)} - * should be preceded by a "super" call to this method - */ - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - if (reporter.isCancelled()) { - throw new ValidationCancelledException(); - } - } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java index d3edefc11d..f4731e9332 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.utility.Filter; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping; @@ -94,7 +93,7 @@ public abstract class AbstractJavaElementQName } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition(); if (xsdType == null) { return; @@ -118,7 +117,7 @@ public abstract class AbstractJavaElementQName } if (resolvedXsdElement == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } 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 045a6db958..2e157d714a 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 @@ -169,20 +169,20 @@ public abstract class AbstractJavaQName // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getParent().getValidationTextRange(astRoot); + public TextRange getValidationTextRange() { + return getParent().getValidationTextRange(); } - protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) { - return (textRange != null) ? textRange : getParent().getValidationTextRange(astRoot); + protected TextRange getTextRange(TextRange textRange) { + return (textRange != null) ? textRange : getParent().getValidationTextRange(); } - public TextRange getNamespaceTextRange(CompilationUnit astRoot) { - return getTextRange(this.proxy.getNamespaceTextRange(), astRoot); + public TextRange getNamespaceTextRange() { + return getTextRange(this.proxy.getNamespaceTextRange()); } - public TextRange getNameTextRange(CompilationUnit astRoot) { - return getTextRange(this.proxy.getNameTextRange(), astRoot); + public TextRange getNameTextRange() { + return getTextRange(this.proxy.getNameTextRange()); } /** @@ -194,17 +194,17 @@ public abstract class AbstractJavaQName } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateName(messages, reporter, astRoot); + validateName(messages, reporter); if (! StringTools.stringIsEmpty(getName())) { - validateReference(messages, reporter, astRoot); + validateReference(messages, reporter); } } - protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateName(List<IMessage> messages, IReporter reporter) { if (StringTools.stringIsEmpty(getName())) { messages.add( DefaultValidationMessages.buildMessage( @@ -212,19 +212,19 @@ public abstract class AbstractJavaQName JaxbValidationMessages.QNAME__MISSING_NAME, new String[] { getReferencedComponentTypeDescription() }, this, - getNameTextRange(astRoot))); + getNameTextRange())); } } - protected abstract void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot); + protected abstract void validateReference(List<IMessage> messages, IReporter reporter); - protected IMessage getUnresolveSchemaComponentMessage(CompilationUnit astRoot) { + protected IMessage getUnresolveSchemaComponentMessage() { return DefaultValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, JaxbValidationMessages.QNAME__UNRESOLVED_COMPONENT, new String[] { getReferencedComponentTypeDescription(), getNamespace(), getName() }, this, - getNameTextRange(astRoot)); + getNameTextRange()); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java index cc03ba5808..9ae8bacd3c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java @@ -30,7 +30,6 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation; -import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException; import org.eclipse.wst.validation.internal.provisional.core.IMessage; import org.eclipse.wst.validation.internal.provisional.core.IReporter; @@ -268,13 +267,6 @@ public abstract class AbstractJavaType } - // ***** misc ***** - - protected CompilationUnit buildASTRoot() { - return this.resourceType.getJavaResourceCompilationUnit().buildASTRoot(); - } - - // ***** content assist ***** @Override @@ -310,14 +302,13 @@ public abstract class AbstractJavaType * Override as needed */ @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { return getJavaResourceType().getNameTextRange(); } + @Override public void validate(List<IMessage> messages, IReporter reporter) { - if (reporter.isCancelled()) { - throw new ValidationCancelledException(); - } + super.validate(messages, reporter); // TODO temporary hack since we don't know yet where to put // any messages for types in another project IFile file = this.resourceType.getFile(); @@ -327,21 +318,14 @@ public abstract class AbstractJavaType if ((file != null) && file.getProject().equals(getJaxbProject().getProject()) && (this.resourceType instanceof SourceNode)) { - // build the AST root here to pass down - this.validate(messages, reporter, this.buildASTRoot()); - } - } - - @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); - - if (this.mapping != null) { - this.mapping.validate(messages, reporter, astRoot); - } - - if (this.xmlJavaTypeAdapter != null) { - this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot); + + if (this.mapping != null) { + this.mapping.validate(messages, reporter); + } + + if (this.xmlJavaTypeAdapter != null) { + this.xmlJavaTypeAdapter.validate(messages, reporter); + } } } } 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 882143908f..5c59d92fe5 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 @@ -338,20 +338,20 @@ public abstract class AbstractJavaTypeMapping // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - TextRange textRange = getXmlTypeAnnotation().getTextRange(astRoot); - return (textRange != null) ? textRange : getJaxbType().getValidationTextRange(astRoot); + public TextRange getValidationTextRange() { + TextRange textRange = getXmlTypeAnnotation().getTextRange(); + return (textRange != null) ? textRange : getJaxbType().getValidationTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (! this.xmlTransient) { - this.qName.validate(messages, reporter, astRoot); + this.qName.validate(messages, reporter); if (this.xmlRootElement != null) { - this.xmlRootElement.validate(messages, reporter, astRoot); + this.xmlRootElement.validate(messages, reporter); } } } @@ -436,7 +436,7 @@ public abstract class AbstractJavaTypeMapping } @Override - protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateName(List<IMessage> messages, IReporter reporter) { // do not call super... - it is not an error if the name is "" // if name is absent (""), namespace cannot be different from package namespace if ("".equals(getName()) @@ -453,7 +453,7 @@ public abstract class AbstractJavaTypeMapping } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { // if name is not absent (""), type must be from schema associated with this package String name = getName(); String namespace = getNamespace(); @@ -463,7 +463,7 @@ public abstract class AbstractJavaTypeMapping if (schema != null) { XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name); if (schemaType == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java index f2c8bb9d3a..3a397823ee 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.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.internal.context.java; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; import org.eclipse.jpt.common.core.utility.TextRange; @@ -200,7 +199,7 @@ public abstract class AbstractJavaXmlJavaTypeAdapter // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.annotation.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.annotation.getTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java index 57c51ad727..1a15f7881f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; @@ -288,19 +287,19 @@ public abstract class AbstractJavaXmlNamedNodeMapping<A extends JaxbBasicSchemaC // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlID != null) { - this.xmlID.validate(messages, reporter, astRoot); + this.xmlID.validate(messages, reporter); } if (this.xmlIDREF != null) { - this.xmlIDREF.validate(messages, reporter, astRoot); + this.xmlIDREF.validate(messages, reporter); } if (this.xmlAttachmentRef != null) { - this.xmlAttachmentRef.validate(messages, reporter, astRoot); + this.xmlAttachmentRef.validate(messages, reporter); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java index 8f5f0ca876..8cf22df868 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.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.core.internal.context.java; import java.util.List; @@ -223,26 +232,26 @@ public abstract class AbstractJavaXmlNodeMapping<A extends Annotation> // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlSchemaType != null) { - this.xmlSchemaType.validate(messages, reporter, astRoot); + this.xmlSchemaType.validate(messages, reporter); } if (isXmlList()) { - validateXmlList(messages, reporter, astRoot); + validateXmlList(messages, reporter); } } - protected void validateXmlList(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateXmlList(List<IMessage> messages, IReporter reporter) { if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) { messages.add( DefaultValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE, this, - getXmlListValidationTextRange(astRoot))); + getXmlListValidationTextRange())); } else { XsdTypeDefinition xsdType = getDataTypeXsdTypeDefinition(); @@ -256,13 +265,13 @@ public abstract class AbstractJavaXmlNodeMapping<A extends Annotation> JaxbValidationMessages.XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE, new String[] { getValueTypeName() }, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } - protected TextRange getXmlListValidationTextRange(CompilationUnit astRoot) { + protected TextRange getXmlListValidationTextRange() { XmlListAnnotation annotation = getXmlListAnnotation(); - return (annotation == null) ? getValidationTextRange(astRoot) : annotation.getTextRange(astRoot); + return (annotation == null) ? getValidationTextRange() : annotation.getTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java index 1eb4de5840..8d2f72bdf9 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java @@ -9,7 +9,6 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.internal.context.java; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute; import org.eclipse.jpt.common.core.resource.java.JavaResourceField; import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; @@ -58,7 +57,7 @@ public class FieldAccessor } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { return null; } 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 99b941df4c..3db4fca576 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 @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; @@ -54,8 +53,8 @@ public class GenericJavaAttributeMappingXmlSchemaType // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); String fqType = getFullyQualifiedType(); if (fqType != null && ! XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) { 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 6090425904..f2a3fec6fe 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 @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; @@ -48,8 +47,8 @@ public class GenericJavaAttributeXmlJavaTypeAdapter // ********** validation ********** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (getType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) { messages.add( DefaultValidationMessages.buildMessage( diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java index b608e7280c..3df75bce52 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java @@ -15,7 +15,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Vector; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceField; import org.eclipse.jpt.common.core.resource.java.JavaResourceMember; import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; @@ -643,16 +642,16 @@ public class GenericJavaAttributesContainer // ********** validation ********** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); for (JaxbPersistentAttribute attribute : getAttributes()) { - attribute.validate(messages, reporter, astRoot); + attribute.validate(messages, reporter); } } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getJaxbClassMapping().getValidationTextRange(astRoot); + public TextRange getValidationTextRange() { + return getJaxbClassMapping().getValidationTextRange(); } 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 348a972910..438f26dc1d 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 @@ -775,22 +775,22 @@ public class GenericJavaClassMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateConstructor(messages, reporter, astRoot); - validatePropOrder(messages, reporter, astRoot); - validateXmlAnyAttributeMapping(messages, astRoot); - validateXmlAnyElementMapping(messages, astRoot); - validateXmlValueMapping(messages, astRoot); - validateXmlIDs(messages, astRoot); + validateConstructor(messages, reporter); + validatePropOrder(messages, reporter); + validateXmlAnyAttributeMapping(messages); + validateXmlAnyElementMapping(messages); + validateXmlValueMapping(messages); + validateXmlIDs(messages); for (JaxbPersistentAttribute attribute : getAttributes()) { - attribute.validate(messages, reporter, astRoot); + attribute.validate(messages, reporter); } } - protected void validateConstructor(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateConstructor(List<IMessage> messages, IReporter reporter) { // TODO - factory class/method if (! JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS.equals(getFactoryClass())) { @@ -800,7 +800,7 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_TYPE__UNSPECIFIED_FACTORY_METHOD, this, - getFactoryClassTextRange(astRoot))); + getFactoryClassTextRange())); } } else { @@ -812,13 +812,13 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } - protected void validatePropOrder(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validatePropOrder(List<IMessage> messages, IReporter reporter) { if (CollectionTools.isEmpty(getPropOrder())) { return; } @@ -894,7 +894,7 @@ public class GenericJavaClassMapping JaxbValidationMessages.XML_TYPE__MISSING_PROP, new String[] { missingProp }, this, - getPropOrderTextRange(astRoot))); + getPropOrderTextRange())); } for (int i : nonexistentProps) { @@ -918,7 +918,7 @@ public class GenericJavaClassMapping } } - protected void validateXmlAnyAttributeMapping(List<IMessage> messages, CompilationUnit astRoot) { + protected void validateXmlAnyAttributeMapping(List<IMessage> messages) { Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>(); Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>(); @@ -941,7 +941,7 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( @@ -949,12 +949,12 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED, anyAttribute.getMapping(), - anyAttribute.getMapping().getValidationTextRange(astRoot))); + anyAttribute.getMapping().getValidationTextRange())); } } } - protected void validateXmlAnyElementMapping(List<IMessage> messages, CompilationUnit astRoot) { + protected void validateXmlAnyElementMapping(List<IMessage> messages) { Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>(); Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>(); @@ -977,7 +977,7 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( @@ -985,12 +985,12 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED, anyAttribute.getMapping(), - anyAttribute.getMapping().getValidationTextRange(astRoot))); + anyAttribute.getMapping().getValidationTextRange())); } } } - protected void validateXmlValueMapping(List<IMessage> messages, CompilationUnit astRoot) { + protected void validateXmlValueMapping(List<IMessage> messages) { Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>(); Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>(); @@ -1013,7 +1013,7 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( @@ -1021,12 +1021,12 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED, anyAttribute.getMapping(), - anyAttribute.getMapping().getValidationTextRange(astRoot))); + anyAttribute.getMapping().getValidationTextRange())); } } } - protected void validateXmlIDs(List<IMessage> messages, CompilationUnit astRoot) { + protected void validateXmlIDs(List<IMessage> messages) { Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>(); Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>(); @@ -1054,7 +1054,7 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( @@ -1062,24 +1062,24 @@ public class GenericJavaClassMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED, anyAttribute.getMapping(), - anyAttribute.getMapping().getValidationTextRange(astRoot))); + anyAttribute.getMapping().getValidationTextRange())); } } } - protected TextRange getFactoryClassTextRange(CompilationUnit astRoot) { + protected TextRange getFactoryClassTextRange() { TextRange result = getXmlTypeAnnotation().getFactoryClassTextRange(); - return (result != null) ? result : getValidationTextRange(astRoot); + return (result != null) ? result : getValidationTextRange(); } - protected TextRange getFactoryMethodTextRange(CompilationUnit astRoot) { + protected TextRange getFactoryMethodTextRange() { TextRange result = getXmlTypeAnnotation().getFactoryMethodTextRange(); - return (result != null) ? result : getValidationTextRange(astRoot); + return (result != null) ? result : getValidationTextRange(); } - protected TextRange getPropOrderTextRange(CompilationUnit astRoot) { + protected TextRange getPropOrderTextRange() { TextRange result = getXmlTypeAnnotation().getPropOrderTextRange(); - return (result != null) ? result : getValidationTextRange(astRoot); + return (result != null) ? result : getValidationTextRange(); } protected TextRange getPropTextRange(int index) { 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 9ede19c6d4..be563d02d3 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 @@ -199,18 +199,18 @@ public class GenericJavaElementFactoryMethod // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getXmlElementDeclAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getXmlElementDeclAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); - this.qName.validate(messages, reporter, astRoot); - this.substitutionHeadQName.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); + this.qName.validate(messages, reporter); + this.substitutionHeadQName.validate(messages, reporter); JavaResourceMethod resourceMethod = getResourceMethod(); - validateMethodReturnType(resourceMethod, messages, astRoot); + validateMethodReturnType(resourceMethod, messages); if (resourceMethod.getParametersSize() != 1) { messages.add( @@ -218,12 +218,12 @@ public class GenericJavaElementFactoryMethod IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } protected void validateMethodReturnType( - JavaResourceMethod resourceMethod, List<IMessage> messages, CompilationUnit astRoot) { + JavaResourceMethod resourceMethod, List<IMessage> messages) { if (! JAXB.JAXB_ELEMENT.equals(resourceMethod.getTypeBinding().getQualifiedName())) { messages.add( @@ -231,7 +231,7 @@ public class GenericJavaElementFactoryMethod IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } @@ -294,7 +294,7 @@ public class GenericJavaElementFactoryMethod } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) { String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope(); JaxbTypeMapping scopeTypeMapping = @@ -306,7 +306,7 @@ public class GenericJavaElementFactoryMethod } if (xsdType.getElement(getNamespace(), getName(), true) == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } @@ -314,7 +314,7 @@ public class GenericJavaElementFactoryMethod XsdSchema xsdSchema = this.getXsdSchema(); if (xsdSchema != null) { if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } @@ -388,7 +388,7 @@ public class GenericJavaElementFactoryMethod } @Override - protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateName(List<IMessage> messages, IReporter reporter) { // need to ignore the unspecified (null) case if ("".equals(getName())) { messages.add( @@ -397,7 +397,7 @@ public class GenericJavaElementFactoryMethod JaxbValidationMessages.QNAME__MISSING_NAME, new String[] { getReferencedComponentTypeDescription() }, this, - getNameTextRange(astRoot))); + getNameTextRange())); } else if (! StringTools.stringIsEmpty(getName())) { if (Tools.valuesAreEqual(getName(), GenericJavaElementFactoryMethod.this.getQName().getName())) { @@ -406,17 +406,17 @@ public class GenericJavaElementFactoryMethod IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME, this, - getNameTextRange(astRoot))); + getNameTextRange())); } } } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { XsdSchema xsdSchema = this.getXsdSchema(); if (xsdSchema != null) { if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } @@ -432,7 +432,7 @@ public class GenericJavaElementFactoryMethod JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL, new String[] { getNamespace(), getName() }, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } 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 bbe30a898e..f4bb276003 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 @@ -131,8 +131,8 @@ public class GenericJavaEnumConstant // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); String value = getValue(); XsdTypeDefinition<?> xsdType = getEnumMapping().getXsdTypeDefinition(); @@ -148,17 +148,17 @@ public class GenericJavaEnumConstant JaxbValidationMessages.XML_ENUM_VALUE__INVALID_LEXICAL_VALUE, new String[] { value, xsdType.getName() }, this, - getValueTextRange(astRoot))); + getValueTextRange())); } } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getResourceEnumConstant().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getResourceEnumConstant().getTextRange(); } - protected TextRange getValueTextRange(CompilationUnit astRoot) { + protected TextRange getValueTextRange() { TextRange enumValueTextRange = getXmlEnumValueAnnotation().getValueTextRange(); - return enumValueTextRange != null ? enumValueTextRange : getValidationTextRange(astRoot); + return enumValueTextRange != null ? enumValueTextRange : getValidationTextRange(); } } 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 89e9640282..630eeeb5f3 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 @@ -217,14 +217,14 @@ public class GenericJavaEnumMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); validateXmlType(messages, reporter); validateXmlEnum(messages, reporter); for (JaxbEnumConstant constant : getEnumConstants()) { - constant.validate(messages, reporter, astRoot); + constant.validate(messages, reporter); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java index 05a0a9d496..8bbd63f3b1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; import org.eclipse.jpt.jaxb.core.context.JaxbClass; import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping; @@ -131,11 +130,11 @@ public class GenericJavaJaxbClass // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlRegistry != null) { - this.xmlRegistry.validate(messages, reporter, astRoot); + this.xmlRegistry.validate(messages, reporter); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java index 9ad05a69bb..531d02a23c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java @@ -297,11 +297,7 @@ public class GenericJavaPackageInfo // ***** misc ***** - - protected CompilationUnit buildASTRoot() { - return this.resourcePackage.getJavaResourceCompilationUnit().buildASTRoot(); - } - + public String getNamespaceForPrefix(String prefix) { if (this.xmlSchema != null) { for (XmlNs xmlns : this.xmlSchema.getXmlNsPrefixes()) { @@ -355,10 +351,11 @@ public class GenericJavaPackageInfo // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { return this.resourcePackage.getNameTextRange(); } + @Override public void validate(List<IMessage> messages, IReporter reporter) { if (reporter.isCancelled()) { throw new ValidationCancelledException(); @@ -370,23 +367,16 @@ public class GenericJavaPackageInfo if ((file != null) && file.getProject().equals(getJaxbProject().getProject()) && (this.resourcePackage instanceof SourceNode)) { - // build the AST root here to pass down - this.validate(messages, reporter, this.buildASTRoot()); - } - } - @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); - - this.xmlSchema.validate(messages, reporter, astRoot); - - for (XmlSchemaType schemaType : getXmlSchemaTypes()) { - schemaType.validate(messages, reporter, astRoot); - } - - for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) { - adapter.validate(messages, reporter, astRoot); + this.xmlSchema.validate(messages, reporter); + + for (XmlSchemaType schemaType : getXmlSchemaTypes()) { + schemaType.validate(messages, reporter); + } + + for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) { + adapter.validate(messages, reporter); + } } } 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 5d0308e82c..bb5a567b33 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 @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; @@ -34,8 +33,8 @@ public class GenericJavaPackageXmlJavaTypeAdapter } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (getSpecifiedType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) { messages.add( DefaultValidationMessages.buildMessage( diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java index 04480116be..2805645707 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; @@ -45,8 +44,8 @@ public class GenericJavaPackageXmlSchemaType // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); String fqType = getFullyQualifiedType(); if (fqType == null || XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) { @@ -55,7 +54,7 @@ public class GenericJavaPackageXmlSchemaType IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java index 01edcb52ef..d98231e1ee 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java @@ -410,13 +410,13 @@ public class GenericJavaPersistentAttribute // **************** validation ******************************************** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.getJavaResourceAttribute().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.getJavaResourceAttribute().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); // validate that unsupported annotations are not present JavaAttributeMappingDefinition currentMappingDefinition = getCurrentMappingDefinition(); @@ -431,11 +431,11 @@ public class GenericJavaPersistentAttribute JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION, new String[] { annotation.getAnnotationName(), currentMappingDefinition.getAnnotationName() }, this, - annotation.getTextRange(astRoot))); + annotation.getTextRange())); } } - this.getMapping().validate(messages, reporter, astRoot); + this.getMapping().validate(messages, reporter); } protected JavaAttributeMappingDefinition getCurrentMappingDefinition() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java index a18a767616..71023f335b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import org.eclipse.core.resources.IResource; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; import org.eclipse.jpt.common.core.resource.java.JavaResourceType; @@ -125,7 +124,7 @@ public class GenericJavaXmlAdapter // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { return getJavaResourceType().getNameTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java index 6b94b4273d..0057f24dd0 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.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. @@ -11,7 +11,6 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; import java.util.Map; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping; @@ -45,8 +44,8 @@ public class GenericJavaXmlAnyAttributeMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Map.class.getName())) { messages.add( @@ -54,7 +53,7 @@ public class GenericJavaXmlAnyAttributeMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ANY_ATTRIBUTE__NON_MAP_TYPE, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java index a5d9f92acf..2adf2d4f33 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.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. @@ -334,10 +334,10 @@ public class GenericJavaXmlAnyElementMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - this.xmlElementRefs.validate(messages, reporter, astRoot); + this.xmlElementRefs.validate(messages, reporter); if (getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS) != null) { XmlElementRefAnnotation xmlElementRefAnnotation = @@ -349,16 +349,16 @@ public class GenericJavaXmlAnyElementMapping JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION, new String[] { JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS }, getPersistentAttribute(), - xmlElementRefAnnotation.getTextRange(astRoot))); + xmlElementRefAnnotation.getTextRange())); } } if (this.xmlElementWrapper != null) { - this.xmlElementWrapper.validate(messages, reporter, astRoot); + this.xmlElementWrapper.validate(messages, reporter); } if (this.xmlMixed != null) { - this.xmlMixed.validate(messages, reporter, astRoot); + this.xmlMixed.validate(messages, reporter); } } @@ -470,7 +470,7 @@ public class GenericJavaXmlAnyElementMapping XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation(); if (xmlElementRefsAnnotation == null) { - throw new IllegalArgumentException(String.valueOf(targetIndex) + ", " + String.valueOf(sourceIndex)); + throw new IllegalArgumentException(String.valueOf(targetIndex) + ", " + String.valueOf(sourceIndex)); //$NON-NLS-1$ } xmlElementRefsAnnotation.moveXmlElementRef(targetIndex, sourceIndex); } @@ -479,18 +479,18 @@ public class GenericJavaXmlAnyElementMapping return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation)); } - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation(); if (xmlElementRefsAnnotation != null) { - return xmlElementRefsAnnotation.getTextRange(astRoot); + return xmlElementRefsAnnotation.getTextRange(); } XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(); if (xmlElementRefAnnotation != null) { - return xmlElementRefAnnotation.getTextRange(astRoot); + return xmlElementRefAnnotation.getTextRange(); } - return GenericJavaXmlAnyElementMapping.this.getValidationTextRange(astRoot); + return GenericJavaXmlAnyElementMapping.this.getValidationTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java index e7ca2fc909..20148b48cb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.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.internal.context.java; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; @@ -39,7 +38,7 @@ public class GenericJavaXmlAttachmentRef } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.resourceXmlAttachmentRef.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.resourceXmlAttachmentRef.getTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java index 7d9428c5a5..6ff2e165a6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.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. @@ -180,18 +180,18 @@ public class GenericJavaXmlAttributeMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateQName(messages, reporter, astRoot); - validateSchemaType(messages, reporter, astRoot); + validateQName(messages, reporter); + validateSchemaType(messages, reporter); } - protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.qName.validate(messages, reporter, astRoot); + protected void validateQName(List<IMessage> messages, IReporter reporter) { + this.qName.validate(messages, reporter); } - protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateSchemaType(List<IMessage> messages, IReporter reporter) { XsdFeature xsdFeature = getXsdFeature(); if (xsdFeature == null) { return; @@ -220,7 +220,7 @@ public class GenericJavaXmlAttributeMapping JaxbValidationMessages.XML_ATTRIBUTE__INVALID_SCHEMA_TYPE, new String[] { getValueTypeName(), xsdFeature.getName() }, this, - this.qName.getNameTextRange(astRoot))); + this.qName.getNameTextRange())); } } @@ -268,11 +268,11 @@ public class GenericJavaXmlAttributeMapping } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition(); if (type != null) { if (type.getAttribute(getNamespace(), getName()) == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } @@ -307,18 +307,18 @@ public class GenericJavaXmlAttributeMapping return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName(); } - public TextRange getTypeTextRange(CompilationUnit astRoot) { + public TextRange getTypeTextRange() { // 1) if we're getting here, XmlIDREF will not be null // 2) use the @XmlIDREF text range, since there is no specific place where the type is specified - return GenericJavaXmlAttributeMapping.this.getXmlIDREF().getValidationTextRange(astRoot); + return GenericJavaXmlAttributeMapping.this.getXmlIDREF().getValidationTextRange(); } public XsdFeature getXsdFeature() { return GenericJavaXmlAttributeMapping.this.getXsdFeature(); } - public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) { - return GenericJavaXmlAttributeMapping.this.getQName().getNameTextRange(astRoot); + public TextRange getXsdFeatureTextRange() { + return GenericJavaXmlAttributeMapping.this.getQName().getNameTextRange(); } }); } 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 7a7cc19cf2..aefc1e4988 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 @@ -342,29 +342,29 @@ public class GenericJavaXmlElement // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { XmlElementAnnotation annotation = getAnnotation(false); - return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTextRange(astRoot); + return (annotation == null) ? getParent().getValidationTextRange() : annotation.getTextRange(); } - public TextRange getTypeTextRange(CompilationUnit astRoot) { + public TextRange getTypeTextRange() { XmlElementAnnotation annotation = getAnnotation(false); - return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTypeTextRange(); + return (annotation == null) ? getParent().getValidationTextRange() : annotation.getTypeTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); - validateQName(messages, reporter, astRoot); - validateType(messages, reporter, astRoot); - validateSchemaType(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); + validateQName(messages, reporter); + validateType(messages, reporter); + validateSchemaType(messages, reporter); } - protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.qName.validate(messages, reporter, astRoot); + protected void validateQName(List<IMessage> messages, IReporter reporter) { + this.qName.validate(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)) { messages.add( @@ -372,7 +372,7 @@ public class GenericJavaXmlElement IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT__UNSPECIFIED_TYPE, this, - getTypeTextRange(astRoot))); + getTypeTextRange())); } else if (! StringTools.stringIsEmpty(this.specifiedType) // verify that type actually exists before validating @@ -385,13 +385,13 @@ public class GenericJavaXmlElement JaxbValidationMessages.XML_ELEMENT__ILLEGAL_TYPE, new String[] { attributeBaseType }, this, - getTypeTextRange(astRoot))); + getTypeTextRange())); } } } - protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateSchemaType(List<IMessage> messages, IReporter reporter) { XsdElementDeclaration xsdElement = getXsdElement(); if (xsdElement == null) { return; @@ -430,7 +430,7 @@ public class GenericJavaXmlElement JaxbValidationMessages.XML_ELEMENT__INVALID_SCHEMA_TYPE, new String[] { typeName, xsdElement.getName() }, this, - this.qName.getNameTextRange(astRoot))); + this.qName.getNameTextRange())); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java index 75aae25adc..95517d2838 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.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. @@ -228,13 +228,13 @@ public class GenericJavaXmlElementMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - this.xmlElement.validate(messages, reporter, astRoot); + this.xmlElement.validate(messages, reporter); if (this.xmlElementWrapper != null) { - this.xmlElementWrapper.validate(messages, reporter, astRoot); + this.xmlElementWrapper.validate(messages, reporter); } } @@ -295,20 +295,20 @@ public class GenericJavaXmlElementMapping return GenericJavaXmlElementMapping.this.xmlElement.getType(); } - public TextRange getTypeTextRange(CompilationUnit astRoot) { + public TextRange getTypeTextRange() { // 1) if we're getting here, XmlIDREF will not be null // 2) if there is an @XmlElement annotation, use that, otherwise use the @XmlIDREF return (GenericJavaXmlElementMapping.this.getAnnotation() == null) ? - GenericJavaXmlElementMapping.this.getXmlIDREF().getValidationTextRange(astRoot) - : GenericJavaXmlElementMapping.this.xmlElement.getTypeTextRange(astRoot); + GenericJavaXmlElementMapping.this.getXmlIDREF().getValidationTextRange() + : GenericJavaXmlElementMapping.this.xmlElement.getTypeTextRange(); } public XsdFeature getXsdFeature() { return GenericJavaXmlElementMapping.this.getXsdFeature(); } - public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) { - return GenericJavaXmlElementMapping.this.xmlElement.getQName().getNameTextRange(astRoot); + public TextRange getXsdFeatureTextRange() { + return GenericJavaXmlElementMapping.this.xmlElement.getQName().getNameTextRange(); } }); } 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 182936e08f..1e14a794d6 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 @@ -229,8 +229,8 @@ public class GenericJavaXmlElementRef // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation().getTextRange(); } public TextRange getTypeTextRange() { @@ -238,9 +238,9 @@ public class GenericJavaXmlElementRef } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); - this.qName.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); + this.qName.validate(messages, reporter); validateType(messages, reporter); } @@ -343,16 +343,16 @@ public class GenericJavaXmlElementRef } @Override - protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateName(List<IMessage> messages, IReporter reporter) { // only validate if type is JAXBElement if (isTypeJAXBElement()) { - super.validateName(messages, reporter, astRoot); + super.validateName(messages, reporter); } } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validateReference(messages, reporter, astRoot); + protected void validateReference(List<IMessage> messages, IReporter reporter) { + super.validateReference(messages, reporter); // if type is JAXBElement, then name/namespace must also point at a valid XmlElementDecl if (! isTypeJAXBElement()) { @@ -367,7 +367,7 @@ public class GenericJavaXmlElementRef IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT_REF__NO_REGISTRY, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); return; } @@ -383,7 +383,7 @@ public class GenericJavaXmlElementRef JaxbValidationMessages.XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL, new String[] { getNamespace(), getName() }, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java index 9362158238..6faac68cb8 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.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 @@ -259,13 +259,13 @@ public class GenericJavaXmlElementRefMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - this.xmlElementRef.validate(messages, reporter, astRoot); + this.xmlElementRef.validate(messages, reporter); if (this.xmlElementWrapper != null) { - this.xmlElementWrapper.validate(messages, reporter, astRoot); + this.xmlElementWrapper.validate(messages, reporter); } } 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 c4168ea161..9695ca3750 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 @@ -131,22 +131,22 @@ public class GenericJavaXmlElementRefs // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.context.getValidationTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.context.getValidationTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateDuplicateTypesAndQNames(messages, reporter, astRoot); + validateDuplicateTypesAndQNames(messages, reporter); for (XmlElementRef elementRef : getXmlElementRefs()) { - elementRef.validate(messages, reporter, astRoot); + elementRef.validate(messages, reporter); } } - protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter) { Bag<String> xmlElementRefTypes = new HashBag<String>(); Bag<QName> xmlElementRefQnames = new HashBag<QName>(); @@ -185,7 +185,7 @@ public class GenericJavaXmlElementRefs JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME, new String[] { xmlElementName }, xmlElementRef, - xmlElementRef.getQName().getNameTextRange(astRoot))); + xmlElementRef.getQName().getNameTextRange())); } } } @@ -244,6 +244,6 @@ public class GenericJavaXmlElementRefs XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation); - TextRange getValidationTextRange(CompilationUnit astRoot); + TextRange getValidationTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java index 48bbf2022c..782d553e2a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.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 @@ -267,17 +267,17 @@ public class GenericJavaXmlElementRefsMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - this.xmlElementRefs.validate(messages, reporter, astRoot); + this.xmlElementRefs.validate(messages, reporter); if (this.xmlElementWrapper != null) { - this.xmlElementWrapper.validate(messages, reporter, astRoot); + this.xmlElementWrapper.validate(messages, reporter); } if (this.xmlMixed != null) { - this.xmlMixed.validate(messages, reporter, astRoot); + this.xmlMixed.validate(messages, reporter); } } @@ -309,8 +309,8 @@ public class GenericJavaXmlElementRefsMapping return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation)); } - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getXmlElementRefsAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getXmlElementRefsAnnotation().getTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java index 23f7c5aa00..179cf08df9 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.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. @@ -200,8 +200,8 @@ public class GenericJavaXmlElementWrapper //************* validation **************** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) { messages.add( @@ -209,19 +209,19 @@ public class GenericJavaXmlElementWrapper IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } - validateQName(messages, reporter, astRoot); + validateQName(messages, reporter); } - protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.qName.validate(messages, reporter, astRoot); + protected void validateQName(List<IMessage> messages, IReporter reporter) { + this.qName.validate(messages, reporter); } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation().getTextRange(); } @@ -292,14 +292,14 @@ public class GenericJavaXmlElementWrapper } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition(); if (type == null) { return; } if (type.getElement(getNamespace(), getName()) == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java index 993b48d308..bbcc19feb8 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.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 @@ -317,25 +317,25 @@ public class GenericJavaXmlElementsMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateDuplicateTypesAndQNames(messages, reporter, astRoot); + validateDuplicateTypesAndQNames(messages, reporter); for (XmlElement xmlElement : getXmlElements()) { - xmlElement.validate(messages, reporter, astRoot); + xmlElement.validate(messages, reporter); } if (this.xmlElementWrapper != null) { - this.xmlElementWrapper.validate(messages, reporter, astRoot); + this.xmlElementWrapper.validate(messages, reporter); } if (this.xmlIDREF != null) { - this.xmlIDREF.validate(messages, reporter, astRoot); + this.xmlIDREF.validate(messages, reporter); } } - protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter) { Bag<String> xmlElementTypes = new HashBag<String>(); Bag<QName> xmlElementQNames = new HashBag<QName>(); @@ -351,13 +351,13 @@ public class GenericJavaXmlElementsMapping } for (XmlElement xmlElement : getXmlElements()) { - validateDuplicateType(xmlElement, xmlElementTypes, messages, astRoot); - validateDuplicateQName(xmlElement, xmlElementQNames, messages, astRoot); + validateDuplicateType(xmlElement, xmlElementTypes, messages); + validateDuplicateQName(xmlElement, xmlElementQNames, messages); } } protected void validateDuplicateType(XmlElement xmlElement, Bag<String> xmlElementTypes, - List<IMessage> messages, CompilationUnit astRoot) { + List<IMessage> messages) { String xmlElementType = xmlElement.getFullyQualifiedType(); if (xmlElementTypes.count(xmlElementType) > 1) { messages.add( @@ -366,12 +366,12 @@ public class GenericJavaXmlElementsMapping JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE, new String[] { xmlElementType }, xmlElement, - xmlElement.getTypeTextRange(astRoot))); + xmlElement.getTypeTextRange())); } } protected void validateDuplicateQName(XmlElement xmlElement, Bag<QName> xmlElementQNames, - List<IMessage> messages, CompilationUnit astRoot) { + List<IMessage> messages) { String xmlElementNamespace = xmlElement.getQName().getNamespace(); String xmlElementName = xmlElement.getQName().getName(); if (xmlElementQNames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) { @@ -381,7 +381,7 @@ public class GenericJavaXmlElementsMapping JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME, new String[] { xmlElementName }, xmlElement, - xmlElement.getQName().getNameTextRange(astRoot))); + xmlElement.getQName().getNameTextRange())); } } @@ -479,16 +479,16 @@ public class GenericJavaXmlElementsMapping return o.getFullyQualifiedType(); } - public TextRange getTypeTextRange(CompilationUnit astRoot) { - return o.getTypeTextRange(astRoot); + public TextRange getTypeTextRange() { + return o.getTypeTextRange(); } public XsdFeature getXsdFeature() { return o.getXsdElement(); } - public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) { - return o.getQName().getNameTextRange(astRoot); + public TextRange getXsdFeatureTextRange() { + return o.getQName().getNameTextRange(); } }; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java index c9b039ad82..486c0529e4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlID; @@ -49,10 +48,10 @@ public class GenericJavaXmlID //************* validation **************** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateAttributeType(messages, astRoot); + validateAttributeType(messages); XsdFeature xsdFeature = getMapping().getXsdFeature(); if (xsdFeature == null) { @@ -67,23 +66,23 @@ public class GenericJavaXmlID JaxbValidationMessages.XML_ID__SCHEMA_TYPE_NOT_ID, new String [] { xsdFeature.getName() }, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } - protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) { + protected void validateAttributeType(List<IMessage> messages) { if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(String.class.getName())) { messages.add( DefaultValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ID__ATTRIBUTE_TYPE_NOT_STRING, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.resourceXmlID.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.resourceXmlID.getTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java index 903a8ead21..3ff756b67b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; @@ -51,13 +50,13 @@ public class GenericJavaXmlIDREF // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.context.getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.context.getAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); for (ValidatableReference ref : this.context.getReferences()) { String typeName = ref.getFullyQualifiedType(); @@ -73,7 +72,7 @@ public class GenericJavaXmlIDREF JaxbValidationMessages.XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID, new String[] { typeName }, this, - ref.getTypeTextRange(astRoot))); + ref.getTypeTextRange())); } } @@ -89,7 +88,7 @@ public class GenericJavaXmlIDREF JaxbValidationMessages.XML_ID_REF__SCHEMA_TYPE_NOT_IDREF, new String [] { xsdFeature.getName() }, this, - ref.getXsdFeatureTextRange(astRoot))); + ref.getXsdFeatureTextRange())); } } } @@ -109,10 +108,10 @@ public class GenericJavaXmlIDREF String getFullyQualifiedType(); - TextRange getTypeTextRange(CompilationUnit astRoot); + TextRange getTypeTextRange(); XsdFeature getXsdFeature(); - TextRange getXsdFeatureTextRange(CompilationUnit astRoot); + TextRange getXsdFeatureTextRange(); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java index 4898ebd157..9713608092 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.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.internal.context.java; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; @@ -42,7 +41,7 @@ public class GenericJavaXmlMixed //************* validation **************** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.resourceXmlMixed.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.resourceXmlMixed.getTextRange(); } } 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 75234dc5cf..9752b6048c 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 @@ -122,13 +122,13 @@ public class GenericJavaXmlNs int pos, Filter<String> filter, CompilationUnit astRoot) { if (getResourceXmlNs().namespaceURITouches(pos)) { - return getNamespaceURICompletionProposals(pos, filter, astRoot); + return getNamespaceURICompletionProposals(pos, filter); } return EmptyIterable.instance(); } protected Iterable<String> getNamespaceURICompletionProposals( - int pos, Filter<String> filter, CompilationUnit astRoot) { + int pos, Filter<String> filter) { String packageNamespace = getJaxbPackageInfo().getJaxbPackage().getNamespace(); Iterable<String> result = (StringTools.stringIsEmpty(packageNamespace)) ? @@ -144,8 +144,8 @@ public class GenericJavaXmlNs // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getResourceXmlNs().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getResourceXmlNs().getTextRange(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java index f4cea3511f..f2718fbb9d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java @@ -157,14 +157,14 @@ public class GenericJavaXmlRegistry // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - TextRange textRange = getAnnotation().getTextRange(astRoot); - return (textRange != null) ? textRange : getJaxbClass().getValidationTextRange(astRoot); + public TextRange getValidationTextRange() { + TextRange textRange = getAnnotation().getTextRange(); + return (textRange != null) ? textRange : getJaxbClass().getValidationTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(getJaxbPackage()); if (CollectionTools.size(registries) > 1) { @@ -173,17 +173,17 @@ public class GenericJavaXmlRegistry IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } - validateDuplicateQNames(messages, reporter, astRoot); + validateDuplicateQNames(messages, reporter); for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) { - efm.validate(messages, reporter, astRoot); + efm.validate(messages, reporter); } } - protected void validateDuplicateQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateDuplicateQNames(List<IMessage> messages, IReporter reporter) { Map<String, Bag<QName>> xmlElementDeclQnames = new HashMap<String, Bag<QName>>(); @@ -203,7 +203,7 @@ public class GenericJavaXmlRegistry String xmlElementNamespace = xmlElementDecl.getQName().getNamespace(); String xmlElementName = xmlElementDecl.getQName().getName(); if (xmlElementDeclQnames.get(fqScope).count(new QName(xmlElementNamespace, xmlElementName)) > 1) { - String scopeDesc = ""; + String scopeDesc = ""; //$NON-NLS-1$ if (! JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME.equals(fqScope)) { scopeDesc = NLS.bind(JptJaxbCoreMessages.XML_ELEMENT_DECL__SCOPE, fqScope); } @@ -213,7 +213,7 @@ public class GenericJavaXmlRegistry JaxbValidationMessages.XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME, new String[] { xmlElementName, scopeDesc }, xmlElementDecl, - xmlElementDecl.getQName().getNameTextRange(astRoot))); + xmlElementDecl.getQName().getNameTextRange())); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java index 5147639f89..3ab4c4de01 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.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. @@ -109,15 +109,15 @@ public class GenericJavaXmlRootElement // **************** validation ******************************************** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.annotation.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.annotation.getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - this.qName.validate(messages, reporter, astRoot); + this.qName.validate(messages, reporter); } @@ -178,7 +178,7 @@ public class GenericJavaXmlRootElement } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { String name = getName(); String namespace = getNamespace(); XsdSchema schema = this.getXsdSchema(); @@ -187,7 +187,7 @@ public class GenericJavaXmlRootElement // element must resolve XsdElementDeclaration schemaElement = schema.getElementDeclaration(namespace, name); if (schemaElement == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } else { // element type must agree with parent's schema type @@ -200,7 +200,7 @@ public class GenericJavaXmlRootElement JaxbValidationMessages.XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE, new String[] {name, namespace}, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } 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 89294103cb..d4aca90eed 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 @@ -292,15 +292,15 @@ public class GenericJavaXmlSchema // **************** validation ******************************************** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getXmlSchemaAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getXmlSchemaAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); // removing this validation message for now: see jaxb bug 823 (http://java.net/jira/browse/JAXB-823) // XsdSchema schema = getJaxbPackage().getXsdSchema(); 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 4c76e02259..562cdc8eac 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 @@ -145,15 +145,15 @@ public abstract class GenericJavaXmlSchemaType // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.annotation.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.annotation.getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - this.qName.validate(messages, reporter, astRoot); + this.qName.validate(messages, reporter); XsdTypeDefinition xsdType = getXsdTypeDefinition(); if (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) { @@ -163,7 +163,7 @@ public abstract class GenericJavaXmlSchemaType JaxbValidationMessages.XML_SCHEMA_TYPE__NON_SIMPLE_TYPE, new String[] { qName.getName() }, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } @@ -219,7 +219,7 @@ public abstract class GenericJavaXmlSchemaType } @Override - protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter) { String name = getName(); String namespace = getNamespace(); @@ -229,7 +229,7 @@ public abstract class GenericJavaXmlSchemaType if (schema != null) { XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name); if (schemaType == null) { - messages.add(getUnresolveSchemaComponentMessage(astRoot)); + messages.add(getUnresolveSchemaComponentMessage()); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java index d4216aa54f..8ffb4efc2b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.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.internal.context.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; import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping; @@ -66,8 +65,8 @@ public class GenericJavaXmlSeeAlso } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.annotation.getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.annotation.getTextRange(); } protected ListContainer<String, String> buildValueContainer() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java index be352f4c52..f8ab01a603 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.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.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlValueMapping; @@ -52,13 +51,13 @@ public class GenericJavaXmlValueMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateSchemaType(messages, reporter, astRoot); + validateSchemaType(messages, reporter); } - protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateSchemaType(List<IMessage> messages, IReporter reporter) { XsdTypeDefinition xsdClassType = getClassMapping().getXsdTypeDefinition(); if (xsdClassType == null) { @@ -71,7 +70,7 @@ public class GenericJavaXmlValueMapping IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_VALUE__NO_TEXT_CONTENT, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); return; } @@ -89,7 +88,7 @@ public class GenericJavaXmlValueMapping JaxbValidationMessages.XML_VALUE__INVALID_SCHEMA_TYPE, new String[] { getValueTypeName() }, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java index bbbc39dded..3695c3612f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java @@ -9,7 +9,6 @@ ******************************************************************************/ package org.eclipse.jpt.jaxb.core.internal.context.java; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute; import org.eclipse.jpt.common.core.resource.java.JavaResourceField; import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; @@ -109,8 +108,7 @@ public class PropertyAccessor //if (getterIsAnnotated() && setterIsAnnotated()) error to user @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - // TODO Auto-generated method stub + public TextRange getValidationTextRange() { return null; } }
\ No newline at end of file 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 6b4814ccb2..2aeb59801a 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 @@ -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; @@ -129,14 +128,6 @@ public class SourceXmlNsAnnotation public boolean namespaceURITouches(int pos) { return this.textRangeTouches(this.namespaceURITextRange, pos); } - - public TextRange getNamespaceURITextRange(CompilationUnit astRoot) { - return getElementTextRange(this.namespaceURIDeclarationAdapter, astRoot); - } - - public boolean namespaceURITouches(int pos, CompilationUnit astRoot) { - return elementTouches(this.namespaceURIDeclarationAdapter, pos, astRoot); - } // ***** prefix ***** 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 9f3bf2a956..0b90fc392f 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 @@ -12,7 +12,6 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source; import java.util.Arrays; import java.util.Vector; 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; @@ -117,7 +116,7 @@ public final class SourceXmlTypeAnnotation this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation); this.initializePropOrder(astAnnotation); this.propOrderTextRange = this.buildPropOrderTextRange(astAnnotation); - this.syncPropTextRanges((CompilationUnit) astAnnotation.getRoot()); + this.syncPropTextRanges(astAnnotation); } @Override @@ -134,7 +133,7 @@ public final class SourceXmlTypeAnnotation this.namespaceTextRange = this.buildNamespaceTextRange(astAnnotation); this.syncPropOrder(astAnnotation); this.propOrderTextRange = this.buildPropOrderTextRange(astAnnotation); - this.syncPropTextRanges((CompilationUnit) astAnnotation.getRoot()); + this.syncPropTextRanges(astAnnotation); } @Override @@ -354,11 +353,11 @@ public final class SourceXmlTypeAnnotation return this.textRangeTouches(this.propOrderTextRange, pos); } - //TODO I think we should be able to do this from the Annotation instead of the CompilationUnit - private void syncPropTextRanges(CompilationUnit astRoot) { + private void syncPropTextRanges(Annotation astAnnotation) { this.propTextRanges.clear(); for (int i = 0; i < this.propOrder.size(); i++) { - this.propTextRanges.add(i, getElementTextRange(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, i, astRoot), astRoot)); + TextRange propTextRange = this.getElementTextRange(this.propOrderDeclarationAdapter, i, astAnnotation); + this.propTextRanges.add(i, propTextRange); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java index 1065f4fd69..42725266f4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.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; @@ -250,15 +259,15 @@ public class ELJavaClassMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlDiscriminatorNode != null) { - this.xmlDiscriminatorNode.validate(messages, reporter, astRoot); + this.xmlDiscriminatorNode.validate(messages, reporter); } if (this.xmlDiscriminatorValue != null) { - this.xmlDiscriminatorValue.validate(messages, reporter, astRoot); + this.xmlDiscriminatorValue.validate(messages, reporter); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java index 54718bab6c..211952273d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod; import org.eclipse.jpt.jaxb.core.context.XmlRegistry; import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaElementFactoryMethod; @@ -30,7 +29,7 @@ public class ELJavaElementFactoryMethod @Override protected void validateMethodReturnType( - JavaResourceMethod resourceMethod, List<IMessage> messages, CompilationUnit astRoot) { + JavaResourceMethod resourceMethod, List<IMessage> messages) { if (! resourceMethod.getTypeBinding().isSubTypeOf(JAXB.JAXB_ELEMENT)) { messages.add( @@ -38,7 +37,7 @@ public class ELJavaElementFactoryMethod IMessage.HIGH_SEVERITY, ELJaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE, this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java index dc5fc5de21..b5e80cdcad 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java @@ -134,16 +134,16 @@ public class ELJavaXmlAnyAttributeMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlPath != null) { - validateXmlPath(messages, reporter, astRoot); + validateXmlPath(messages, reporter); } } - protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.xmlPath.validate(messages, reporter, astRoot); + protected void validateXmlPath(List<IMessage> messages, IReporter reporter) { + this.xmlPath.validate(messages, reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java index ee8b129d95..bc9621b330 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java @@ -154,16 +154,16 @@ public class ELJavaXmlAnyElementMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlPath != null) { - validateXmlPath(messages, reporter, astRoot); + validateXmlPath(messages, reporter); } } - protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.xmlPath.validate(messages, reporter, astRoot); + protected void validateXmlPath(List<IMessage> messages, IReporter reporter) { + this.xmlPath.validate(messages, reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java index 441844448c..3f81228661 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java @@ -235,17 +235,17 @@ public class ELJavaXmlAttributeMapping // ***** validation ***** @Override - protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateQName(List<IMessage> messages, IReporter reporter) { if (this.xmlPath == null) { - super.validateQName(messages, reporter, astRoot); + super.validateQName(messages, reporter); } else { - validateXmlPath(messages, reporter, astRoot); + validateXmlPath(messages, reporter); } } - protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.xmlPath.validate(messages, reporter, astRoot); + protected void validateXmlPath(List<IMessage> messages, IReporter reporter) { + this.xmlPath.validate(messages, reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java index f9679d350e..956f5fc730 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java @@ -9,7 +9,6 @@ *******************************************************************************/ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; -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.internal.context.java.AbstractJavaContextNode; @@ -31,8 +30,8 @@ public class ELJavaXmlCDATA @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.context.getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.context.getAnnotation().getTextRange(); } 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 daa689a07f..c984731697 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 @@ -109,13 +109,13 @@ public class ELJavaXmlDiscriminatorNode // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (StringTools.stringIsEmpty(this.value)) { messages.add( diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java index 2ae45cd1f3..6e2a6ada5c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode; @@ -82,13 +81,13 @@ public class ELJavaXmlDiscriminatorValue // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (StringTools.stringIsEmpty(this.value)) { messages.add( diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java index 54142993e5..d49e517d6f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElement; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -31,9 +30,9 @@ public class ELJavaXmlElement } @Override - protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateQName(List<IMessage> messages, IReporter reporter) { if (! getContext().hasXmlPath()) { - super.validateQName(messages, reporter, astRoot); + super.validateQName(messages, reporter); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java index 3567470085..3519eec2f7 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java @@ -310,16 +310,16 @@ public class ELJavaXmlElementMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (this.xmlPath != null) { - validateXmlPath(messages, reporter, astRoot); + validateXmlPath(messages, reporter); } } - protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - this.xmlPath.validate(messages, reporter, astRoot); + protected void validateXmlPath(List<IMessage> messages, IReporter reporter) { + this.xmlPath.validate(messages, reporter); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java index d92928ae5e..d2ca1eaad6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java @@ -1,7 +1,15 @@ +/******************************************************************************* + * 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; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementWrapper; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -21,9 +29,9 @@ public class ELJavaXmlElementWrapper } @Override - protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateQName(List<IMessage> messages, IReporter reporter) { if (! getContext().hasXmlPath()) { - super.validateQName(messages, reporter, astRoot); + super.validateQName(messages, reporter); } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java index 9f8089240a..a252c8f3a0 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java @@ -145,15 +145,15 @@ public class ELJavaXmlElementsMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (getXmlPathsSize() > 0 ) { - validateXmlPaths(messages, reporter, astRoot); + validateXmlPaths(messages, reporter); } } - protected void validateXmlPaths(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateXmlPaths(List<IMessage> messages, IReporter reporter) { Iterator<XmlElement> xmlElements = getXmlElements().iterator(); Iterator<ELJavaXmlPath> xmlPaths = this.xmlPathContainer.getContextElements().iterator(); @@ -168,7 +168,7 @@ public class ELJavaXmlElementsMapping IMessage.HIGH_SEVERITY, ELJaxbValidationMessages.XML_PATH__INSUFFICIENT_XML_PATHS_FOR_XML_ELEMENTS, this, - getXmlPathsTextRange(astRoot))); + getXmlPathsTextRange())); } while (xmlPaths.hasNext()) { @@ -178,29 +178,29 @@ public class ELJavaXmlElementsMapping IMessage.HIGH_SEVERITY, ELJaxbValidationMessages.XML_PATH__INSUFFICIENT_XML_ELEMENTS_FOR_XML_PATHS, this, - xmlPath.getValidationTextRange(astRoot))); + xmlPath.getValidationTextRange())); } for (ELJavaXmlPath xmlPath : this.xmlPathContainer.getContextElements()) { - xmlPath.validate(messages, reporter, astRoot); + xmlPath.validate(messages, reporter); } } @Override protected void validateDuplicateQName(XmlElement xmlElement, Bag<QName> xmlElementQNames, - List<IMessage> messages, CompilationUnit astRoot) { + List<IMessage> messages) { if (getXmlPathsSize() == 0) { - super.validateDuplicateQName(xmlElement, xmlElementQNames, messages, astRoot); + super.validateDuplicateQName(xmlElement, xmlElementQNames, messages); } } - protected TextRange getXmlPathsTextRange(CompilationUnit astRoot) { + protected TextRange getXmlPathsTextRange() { Annotation annotation = getJavaResourceAttribute().getAnnotation(ELJaxb.XML_PATHS); if (annotation == null) { annotation = getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH); } - return annotation.getTextRange(astRoot); + return annotation.getTextRange(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java index 7a158912b0..91da7e08ff 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; import java.util.List; -import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping; import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlID; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation; @@ -26,7 +25,7 @@ public class ELJavaXmlID @Override - protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) { + protected void validateAttributeType(List<IMessage> messages) { // no op - MOXy does not require String attribute types } } 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 3e9aa0c56d..c53dd0346b 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 @@ -161,20 +161,20 @@ public class ELJavaXmlInverseReferenceMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); - validateMappedBy(messages, reporter, astRoot); + validateMappedBy(messages, reporter); } - protected void validateMappedBy(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateMappedBy(List<IMessage> messages, IReporter reporter) { if (StringTools.stringIsEmpty(mappedBy)) { messages.add( ELJaxbValidationMessageBuilder.buildMessage( IMessage.HIGH_SEVERITY, ELJaxbValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_NOT_SPECIFIED, this, - getMappedByTextRange(astRoot))); + getMappedByTextRange())); return; } @@ -192,7 +192,7 @@ public class ELJavaXmlInverseReferenceMapping ELJaxbValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_NOT_RESOLVED, new String[] { mappedBy, referencedClassMapping.getJaxbType().getFullyQualifiedName() }, this, - getMappedByTextRange(astRoot))); + getMappedByTextRange())); } else if ( ! ArrayTools.contains( @@ -204,7 +204,7 @@ public class ELJavaXmlInverseReferenceMapping ELJaxbValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_ILLEGAL_MAPPING_TYPE, new String[] { mappedBy, referencedClassMapping.getJaxbType().getFullyQualifiedName() }, this, - getMappedByTextRange(astRoot))); + getMappedByTextRange())); } } @@ -219,8 +219,8 @@ public class ELJavaXmlInverseReferenceMapping MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY }; - protected TextRange getMappedByTextRange(CompilationUnit astRoot) { + protected TextRange getMappedByTextRange() { TextRange textRange = getXmlInverseReferenceAnnotation().getMappedByTextRange(); - return (textRange != null) ? textRange : getValidationTextRange(astRoot); + return (textRange != null) ? textRange : getValidationTextRange(); } } 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 ef8a40bb3a..63ae1c3b21 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 @@ -170,13 +170,13 @@ public class ELJavaXmlJoinNode // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); validateXmlPath(messages); validateReferencedXmlPath(messages); 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 898567e8b6..31edb8815e 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 @@ -175,8 +175,8 @@ public class ELJavaXmlJoinNodesMapping // ***** validation ***** @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); JaxbClassMapping referencedClass = getReferencedClassMapping(); @@ -187,13 +187,13 @@ public class ELJavaXmlJoinNodesMapping ELJaxbValidationMessages.XML_JOIN_NODES__INVALID_REFERENCED_CLASS, new String[] { getValueTypeName() }, ELJavaXmlJoinNodesMapping.this, - getValidationTextRange(astRoot))); + getValidationTextRange())); } validateDuplicateXmlPaths(messages, reporter); for (ELJavaXmlJoinNode xmlJoinNode : this.xmlJoinNodeContainer.getContextElements()) { - xmlJoinNode.validate(messages, reporter, astRoot); + xmlJoinNode.validate(messages, reporter); } } @@ -247,12 +247,12 @@ public class ELJavaXmlJoinNodesMapping } @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { + public TextRange getValidationTextRange() { Annotation annotation = getAnnotation(); if (annotation == null) { annotation = getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_JOIN_NODE); } - return annotation.getTextRange(astRoot); + return annotation.getTextRange(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java index 4f0122a7bc..3c644f21d1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java @@ -9,7 +9,6 @@ *******************************************************************************/ package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java; -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.internal.context.java.AbstractJavaContextNode; @@ -31,8 +30,8 @@ public class ELJavaXmlKey @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.context.getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return this.context.getAnnotation().getTextRange(); } 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 d73eefeb6c..6e9339b0f7 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 @@ -119,13 +119,13 @@ public class ELJavaXmlPath // ***** validation ***** @Override - public TextRange getValidationTextRange(CompilationUnit astRoot) { - return getAnnotation().getTextRange(astRoot); + public TextRange getValidationTextRange() { + return getAnnotation().getTextRange(); } @Override - public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { - super.validate(messages, reporter, astRoot); + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); if (StringTools.stringIsEmpty(this.value)) { messages.add( diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java index 44573efafb..c728adfeb3 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.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 BinaryXmlDiscriminatorValueAnnotation 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 f1957a6844..6ceb40daab 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 @@ -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; |