diff options
author | Brian Vosburgh | 2013-02-22 01:29:33 +0000 |
---|---|---|
committer | Brian Vosburgh | 2013-02-22 01:35:09 +0000 |
commit | 536cb65551f738e3442e8057f584b36a0a507840 (patch) | |
tree | c547f26a30e596691bc755e7172bc4fdb6412930 /jaxb | |
parent | 50f7313d6b9cd3291af17984069ad8b0e681b95a (diff) | |
download | webtools.dali-536cb65551f738e3442e8057f584b36a0a507840.tar.gz webtools.dali-536cb65551f738e3442e8057f584b36a0a507840.tar.xz webtools.dali-536cb65551f738e3442e8057f584b36a0a507840.zip |
move default severity into ValidationMessage
Diffstat (limited to 'jaxb')
47 files changed, 184 insertions, 229 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/AbstractQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/AbstractQName.java index 72e4dea291..d26c6d9bd4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/AbstractQName.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/AbstractQName.java @@ -267,7 +267,7 @@ public abstract class AbstractQName protected void validateName(List<IMessage> messages, IReporter reporter) { if (StringTools.isBlank(getName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getNameTextRange(), JptJaxbCoreValidationMessages.QNAME__MISSING_NAME, getReferencedComponentTypeDescription() @@ -279,7 +279,7 @@ public abstract class AbstractQName protected abstract void validateReference(List<IMessage> messages, IReporter reporter); protected IMessage getUnresolveSchemaComponentMessage() { - return this.buildErrorValidationMessage( + return this.buildValidationMessage( getNameTextRange(), JptJaxbCoreValidationMessages.QNAME__UNRESOLVED_COMPONENT, getReferencedComponentTypeDescription(), diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java index d551b0c00d..2bb0e55945 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java @@ -1126,7 +1126,7 @@ public abstract class AbstractJaxbProject } if (! lp.isEnabledFor(facetedProject, facetVersion) || ! lid.validate().isOK()) { messages.add( - ValidationMessageTools.buildErrorValidationMessage(this.project, + ValidationMessageTools.buildValidationMessage(this.project, JptJaxbCoreValidationMessages.PROJECT_INVALID_LIBRARY_PROVIDER)); } lid.dispose(); diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java index 511091e990..c5c5bcbc74 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java @@ -129,7 +129,7 @@ public class SchemaLibraryImpl if (! entry.isLoaded()) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( this.project.getProject(), JptJaxbCoreValidationMessages.PROJECT__UNRESOLVED_SCHEMA, entry.getLocation() @@ -141,7 +141,7 @@ public class SchemaLibraryImpl String namespace = stream.next(); if (namespaces.count(namespace) > 1) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( this.project.getProject(), JptJaxbCoreValidationMessages.PROJECT__DUPLICATE_NAMESPACE, namespace 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 9253f814bb..d9c48f768d 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 @@ -120,122 +120,66 @@ public abstract class AbstractJaxbContextNode } /** - * @see #buildErrorValidationMessage(JaxbNode, ValidationMessage) + * @see #buildValidationMessage(JaxbNode, ValidationMessage) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(ValidationMessage message) { - return this.buildErrorValidationMessage(this, message); + protected IMessage buildValidationMessage(ValidationMessage message) { + return this.buildValidationMessage(this, message); } /** - * @see ValidationMessageTools#buildErrorValidationMessage(IResource, ValidationMessage) + * @see ValidationMessageTools#buildValidationMessage(IResource, ValidationMessage) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(JaxbNode target, ValidationMessage message) { - return ValidationMessageTools.buildErrorValidationMessage(target.getResource(), message); + protected IMessage buildValidationMessage(JaxbNode target, ValidationMessage message) { + return ValidationMessageTools.buildValidationMessage(target.getResource(), message); } /** - * @see #buildValidationMessage(JaxbNode, int, ValidationMessage) - */ - protected IMessage buildValidationMessage(int defaultSeverity, ValidationMessage message) { - return this.buildValidationMessage(this, defaultSeverity, message); - } - - /** - * @see ValidationMessageTools#buildValidationMessage(IResource, int, ValidationMessage) - */ - protected IMessage buildValidationMessage(JaxbNode target, int defaultSeverity, ValidationMessage message) { - return ValidationMessageTools.buildValidationMessage(target.getResource(), defaultSeverity, message); - } - - /** - * @see #buildErrorValidationMessage(JaxbNode, ValidationMessage, Object[]) + * @see #buildValidationMessage(JaxbNode, ValidationMessage, Object[]) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(ValidationMessage message, Object... args) { - return this.buildErrorValidationMessage(this, message, args); + protected IMessage buildValidationMessage(ValidationMessage message, Object... args) { + return this.buildValidationMessage(this, message, args); } /** - * @see ValidationMessageTools#buildErrorValidationMessage(IResource, ValidationMessage, Object[]) + * @see ValidationMessageTools#buildValidationMessage(IResource, ValidationMessage, Object[]) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(JaxbNode target, ValidationMessage message, Object... args) { - return ValidationMessageTools.buildErrorValidationMessage(target.getResource(), message, args); - } - - /** - * @see #buildValidationMessage(JaxbNode, int, ValidationMessage, Object[]) - */ - protected IMessage buildValidationMessage(int defaultSeverity, ValidationMessage message, Object... args) { - return this.buildValidationMessage(this, defaultSeverity, message, args); - } - - /** - * @see ValidationMessageTools#buildValidationMessage(IResource, int, ValidationMessage, Object[]) - */ - protected IMessage buildValidationMessage(JaxbNode target, int defaultSeverity, ValidationMessage message, Object... args) { - return ValidationMessageTools.buildValidationMessage(target.getResource(), defaultSeverity, message, args); + protected IMessage buildValidationMessage(JaxbNode target, ValidationMessage message, Object... args) { + return ValidationMessageTools.buildValidationMessage(target.getResource(), message, args); } /** - * @see #buildErrorValidationMessage(JaxbNode, TextRange, ValidationMessage) + * @see #buildValidationMessage(JaxbNode, TextRange, ValidationMessage) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(TextRange textRange, ValidationMessage message) { - return this.buildErrorValidationMessage(this, textRange, message); + protected IMessage buildValidationMessage(TextRange textRange, ValidationMessage message) { + return this.buildValidationMessage(this, textRange, message); } /** - * @see ValidationMessageTools#buildErrorValidationMessage(IResource, TextRange, ValidationMessage) + * @see ValidationMessageTools#buildValidationMessage(IResource, TextRange, ValidationMessage) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(JaxbNode target, TextRange textRange, ValidationMessage message) { - return ValidationMessageTools.buildErrorValidationMessage(target.getResource(), textRange, message); + protected IMessage buildValidationMessage(JaxbNode target, TextRange textRange, ValidationMessage message) { + return ValidationMessageTools.buildValidationMessage(target.getResource(), textRange, message); } /** - * @see #buildValidationMessage(JaxbNode, TextRange, int, ValidationMessage) - */ - protected IMessage buildValidationMessage(TextRange textRange, int defaultSeverity, ValidationMessage message) { - return this.buildValidationMessage(this, textRange, defaultSeverity, message); - } - - /** - * @see ValidationMessageTools#buildValidationMessage(IResource, TextRange, int, ValidationMessage) - */ - protected IMessage buildValidationMessage(JaxbNode target, TextRange textRange, int defaultSeverity, ValidationMessage message) { - return ValidationMessageTools.buildValidationMessage(target.getResource(), textRange, defaultSeverity, message); - } - - /** - * @see #buildErrorValidationMessage(JaxbNode, TextRange, ValidationMessage, Object[]) + * @see #buildValidationMessage(JaxbNode, TextRange, ValidationMessage, Object[]) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(TextRange textRange, ValidationMessage message, Object... args) { - return this.buildErrorValidationMessage(this, textRange, message, args); + protected IMessage buildValidationMessage(TextRange textRange, ValidationMessage message, Object... args) { + return this.buildValidationMessage(this, textRange, message, args); } /** - * @see ValidationMessageTools#buildErrorValidationMessage(IResource, TextRange, ValidationMessage, Object[]) + * @see ValidationMessageTools#buildValidationMessage(IResource, TextRange, ValidationMessage, Object[]) * @see IMessage#HIGH_SEVERITY */ - protected IMessage buildErrorValidationMessage(JaxbNode target, TextRange textRange, ValidationMessage message, Object... args) { - return ValidationMessageTools.buildErrorValidationMessage(target.getResource(), textRange, message, args); - } - - /** - * @see #buildValidationMessage(JaxbNode, TextRange, int, ValidationMessage, Object[]) - */ - protected IMessage buildValidationMessage(TextRange textRange, int defaultSeverity, ValidationMessage message, Object... args) { - return this.buildValidationMessage(this, textRange, defaultSeverity, message, args); - } - - /** - * @see ValidationMessageTools#buildValidationMessage(IResource, TextRange, int, ValidationMessage, Object[]) - */ - protected IMessage buildValidationMessage(JaxbNode target, TextRange textRange, int defaultSeverity, ValidationMessage message, Object... args) { - return ValidationMessageTools.buildValidationMessage(target.getResource(), textRange, defaultSeverity, message, args); + protected IMessage buildValidationMessage(JaxbNode target, TextRange textRange, ValidationMessage message, Object... args) { + return ValidationMessageTools.buildValidationMessage(target.getResource(), textRange, message, args); } } 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 6f39c0185b..10b16ac8f9 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 @@ -133,7 +133,6 @@ public class GenericPackage if (getJaxbProject().getSchemaLibrary().getSchema(getNamespace()) == null) { messages.add( this.buildValidationMessage( - IMessage.NORMAL_SEVERITY, JptJaxbCoreValidationMessages.PACKAGE_NO_SCHEMA_FOR_NAMESPACE, getNamespace(), this.name 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 9095d3ee31..269a9d6e6a 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 @@ -457,7 +457,7 @@ public abstract class AbstractJavaTypeMapping getNamespace(), buildDefaultNamespace())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getXmlTypeAnnotation().getNamespaceTextRange(), JptJaxbCoreValidationMessages.XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE )); 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 f76fa1751f..21a5c8ea4e 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 @@ -244,7 +244,7 @@ public abstract class AbstractJavaXmlNodeMapping<A extends Annotation> protected void validateXmlList(List<IMessage> messages, IReporter reporter) { if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getXmlListValidationTextRange(), JptJaxbCoreValidationMessages.XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE )); @@ -256,7 +256,7 @@ public abstract class AbstractJavaXmlNodeMapping<A extends Annotation> || ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().getVariety() == XSDVariety.LIST_LITERAL)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE, getValueTypeName() 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 13ac850a05..06c0e47fce 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 @@ -58,7 +58,7 @@ public class GenericJavaAttributeMappingXmlSchemaType String fqType = getFullyQualifiedType(); if (fqType != null && ! XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getTypeTextRange(), JptJaxbCoreValidationMessages.XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE )); 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 d52edafeab..52568c5d5e 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 @@ -50,7 +50,7 @@ public class GenericJavaAttributeXmlJavaTypeAdapter super.validate(messages, reporter); if (getType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getAnnotation().getTypeTextRange(), JptJaxbCoreValidationMessages.ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED )); 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 c457f3fb79..fd1ab7c700 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 @@ -745,7 +745,7 @@ public class GenericJavaClassMapping if (! JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS.equals(getFactoryClass())) { if (StringTools.isBlank(getFactoryMethod())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getFactoryClassTextRange(), JptJaxbCoreValidationMessages.XML_TYPE__UNSPECIFIED_FACTORY_METHOD )); @@ -756,7 +756,7 @@ public class GenericJavaClassMapping && getJavaType().getXmlJavaTypeAdapter() == null && ! getJavaResourceType().hasPublicOrProtectedNoArgConstructor()) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR )); @@ -826,7 +826,7 @@ public class GenericJavaClassMapping for (int i : duplicateProps) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getPropTextRange(i), JptJaxbCoreValidationMessages.XML_TYPE__DUPLICATE_PROP, getProp(i))); @@ -834,7 +834,7 @@ public class GenericJavaClassMapping for (String missingProp : missingProps) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getPropOrderTextRange(), JptJaxbCoreValidationMessages.XML_TYPE__MISSING_PROP, missingProp)); @@ -842,7 +842,7 @@ public class GenericJavaClassMapping for (int i : nonexistentProps) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getPropTextRange(i), JptJaxbCoreValidationMessages.XML_TYPE__NONEXISTENT_PROP, getProp(i))); @@ -850,7 +850,7 @@ public class GenericJavaClassMapping for (int i : transientProps) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getPropTextRange(i), JptJaxbCoreValidationMessages.XML_TYPE__TRANSIENT_PROP, getProp(i))); @@ -876,14 +876,14 @@ public class GenericJavaClassMapping if (allAttributes.size() > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED )); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( anyAttribute.getMapping(), anyAttribute.getMapping().getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED @@ -911,14 +911,14 @@ public class GenericJavaClassMapping if (allAttributes.size() > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED )); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( anyAttribute.getMapping(), anyAttribute.getMapping().getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED @@ -946,14 +946,14 @@ public class GenericJavaClassMapping if (allAttributes.size() > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED )); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( anyAttribute.getMapping(), anyAttribute.getMapping().getValidationTextRange(), JptJaxbCoreValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED @@ -986,14 +986,14 @@ public class GenericJavaClassMapping if (allAttributes.size() > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED )); for (JaxbPersistentAttribute anyAttribute : localAttributes) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( anyAttribute.getMapping(), anyAttribute.getMapping().getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED 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 d1474af7a8..918c75dba8 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 @@ -212,7 +212,7 @@ public class GenericJavaElementFactoryMethod if (resourceMethod.getParametersSize() != 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM )); @@ -224,7 +224,7 @@ public class GenericJavaElementFactoryMethod if (! JAXB.JAXB_ELEMENT.equals(resourceMethod.getTypeBinding().getQualifiedName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE )); @@ -388,7 +388,7 @@ public class GenericJavaElementFactoryMethod // need to ignore the unspecified (null) case if ("".equals(getName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getNameTextRange(), JptJaxbCoreValidationMessages.QNAME__MISSING_NAME, getReferencedComponentTypeDescription())); @@ -396,7 +396,7 @@ public class GenericJavaElementFactoryMethod else if (! StringTools.isBlank(getName())) { if (ObjectTools.equals(getName(), GenericJavaElementFactoryMethod.this.getQName().getName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getNameTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME )); @@ -420,7 +420,7 @@ public class GenericJavaElementFactoryMethod } } messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL, getNamespace(), 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 3e059ea97c..7f63d12ebd 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 @@ -140,7 +140,7 @@ public class GenericJavaEnumConstant if (! ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().isValidLiteral(value)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValueTextRange(), JptJaxbCoreValidationMessages.XML_ENUM_VALUE__INVALID_LEXICAL_VALUE, value, 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 947489c9ac..d72f88dbbc 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 @@ -242,7 +242,6 @@ public class GenericJavaEnumMapping messages.add( this.buildValidationMessage( annotation.getFactoryClassTextRange(), - IMessage.NORMAL_SEVERITY, JptJaxbCoreValidationMessages.XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM )); } @@ -251,7 +250,6 @@ public class GenericJavaEnumMapping messages.add( this.buildValidationMessage( annotation.getFactoryMethodTextRange(), - IMessage.NORMAL_SEVERITY, JptJaxbCoreValidationMessages.XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM )); } @@ -260,7 +258,6 @@ public class GenericJavaEnumMapping messages.add( this.buildValidationMessage( annotation.getPropOrderTextRange(), - IMessage.NORMAL_SEVERITY, JptJaxbCoreValidationMessages.XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM )); } @@ -273,7 +270,7 @@ public class GenericJavaEnumMapping if ((xsdSchema != null && xsdType == null) || (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getXmlEnumValueTextRange(), JptJaxbCoreValidationMessages.XML_ENUM__NON_SIMPLE_SCHEMA_TYPE, getValue())); 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 3c044be179..7fc5ad5fe3 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 @@ -36,7 +36,7 @@ public class GenericJavaPackageXmlJavaTypeAdapter super.validate(messages, reporter); if (getSpecifiedType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getAnnotation().getTypeTextRange(), JptJaxbCoreValidationMessages.PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED )); 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 22d1d71b58..c4b8fe62fb 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 @@ -49,7 +49,7 @@ public class GenericJavaPackageXmlSchemaType String fqType = getFullyQualifiedType(); if (fqType == null || XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE )); 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 64023acd37..10e92af7c3 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 @@ -423,7 +423,7 @@ public class GenericJavaPersistentAttribute if (ObjectTools.notEquals(currentMappingDefinition.getAnnotationName(), annotation.getAnnotationName()) && ! IterableTools.contains(supportingAnnotationNames, annotation.getAnnotationName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( annotation.getTextRange(), JptJaxbCoreValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION, annotation.getAnnotationName(), 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 bd40a5ebb8..5e00e4e4a8 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 @@ -48,7 +48,7 @@ public class GenericJavaXmlAnyAttributeMapping if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Map.class.getName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ANY_ATTRIBUTE__NON_MAP_TYPE )); 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 099798c700..1e6c9f6afd 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 @@ -341,7 +341,7 @@ public class GenericJavaXmlAnyElementMapping (XmlElementRefAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF); if (xmlElementRefAnnotation != null) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getPersistentAttribute(), xmlElementRefAnnotation.getTextRange(), JptJaxbCoreValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION, 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 36dfcea150..3b87d05458 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 @@ -213,7 +213,7 @@ public class GenericJavaXmlAttributeMapping boolean isItemType = isXmlList() && this.xmlSchemaType == null; if (! xsdFeature.typeIsValid(expectedSchemaType, isItemType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( this.qName.getNameTextRange(), JptJaxbCoreValidationMessages.XML_ATTRIBUTE__INVALID_SCHEMA_TYPE, getValueTypeName(), 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 99aa93d312..773fffdde4 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 @@ -361,7 +361,7 @@ public class GenericJavaXmlElement String fqType = getFullyQualifiedType(); if (StringTools.isBlank(fqType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT__UNSPECIFIED_TYPE )); @@ -379,7 +379,7 @@ public class GenericJavaXmlElement String attributeBaseType = getAttributeMapping().getValueTypeName(); if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeBaseType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT__ILLEGAL_TYPE, attributeBaseType)); @@ -422,7 +422,7 @@ public class GenericJavaXmlElement if (! xsdElement.typeIsValid(expectedSchemaType, this.context.hasXmlList())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( this.qName.getNameTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT__INVALID_SCHEMA_TYPE, typeName, 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 5cc0e3b6a9..f34daee23a 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 @@ -241,7 +241,7 @@ public class GenericJavaXmlElementRef String fqType = getFullyQualifiedType(); if (StringTools.isBlank(fqType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REF__UNSPECIFIED_TYPE )); @@ -252,7 +252,7 @@ public class GenericJavaXmlElementRef String attributeValueType = getContext().getAttributeMapping().getValueTypeName(); if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeValueType)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REF__ILLEGAL_TYPE, attributeValueType)); @@ -263,7 +263,7 @@ public class GenericJavaXmlElementRef JaxbTypeMapping typeMapping = getJaxbProject().getContextRoot().getTypeMapping(fqType); if (typeMapping != null && ! typeMapping.hasRootElementInHierarchy()) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REF__NO_ROOT_ELEMENT, attributeValueType)); @@ -350,7 +350,7 @@ public class GenericJavaXmlElementRef if (registry == null) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REF__NO_REGISTRY )); @@ -364,7 +364,7 @@ public class GenericJavaXmlElementRef } } messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL, getNamespace(), 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 55efb30820..5d503cd28f 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 @@ -163,7 +163,7 @@ public class GenericJavaXmlElementRefs boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName); if (! isJaxbElement && xmlElementRefTypes.count(typeName) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( xmlElementRef, xmlElementRef.getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE, @@ -174,7 +174,7 @@ public class GenericJavaXmlElementRefs String xmlElementName = xmlElementRef.getQName().getName(); if (isJaxbElement && xmlElementRefQnames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( xmlElementRef, xmlElementRef.getQName().getNameTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME, 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 c6ec6583eb..481c5102e8 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 @@ -203,7 +203,7 @@ public class GenericJavaXmlElementWrapper if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION )); 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 3b713d6f61..f70f803443 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 @@ -352,7 +352,7 @@ public class GenericJavaXmlElementsMapping String xmlElementType = xmlElement.getFullyQualifiedType(); if (xmlElementTypes.count(xmlElementType) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( xmlElement, xmlElement.getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE, @@ -366,7 +366,7 @@ public class GenericJavaXmlElementsMapping String xmlElementName = xmlElement.getQName().getName(); if (xmlElementQNames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( xmlElement, xmlElement.getQName().getNameTextRange(), JptJaxbCoreValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME, 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 96e41048b5..0eaea696e6 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 @@ -60,7 +60,7 @@ public class GenericJavaXmlID XsdTypeDefinition idrefType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID"); if (! xsdFeature.typeIsValid(idrefType, false)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ID__SCHEMA_TYPE_NOT_ID, xsdFeature.getName())); @@ -70,7 +70,7 @@ public class GenericJavaXmlID protected void validateAttributeType(List<IMessage> messages) { if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(String.class.getName())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ID__ATTRIBUTE_TYPE_NOT_STRING )); 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 9a7c874a40..e877544b12 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 @@ -66,7 +66,7 @@ public class GenericJavaXmlIDREF JaxbClassMapping classMapping = getContextRoot().getClassMapping(typeName); if (classMapping == null || classMapping.getXmlIdMapping() == null) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ref.getTypeTextRange(), JptJaxbCoreValidationMessages.XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID, typeName)); @@ -80,7 +80,7 @@ public class GenericJavaXmlIDREF if (xsdFeature != null && ! xsdFeature.typeIsValid(XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF"), this.context.isList())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ref.getXsdFeatureTextRange(), JptJaxbCoreValidationMessages.XML_ID_REF__SCHEMA_TYPE_NOT_IDREF, xsdFeature.getName())); 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 f795087434..4239837a6e 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 @@ -171,7 +171,7 @@ public class GenericJavaXmlRegistry Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(getJaxbPackage()); if (IterableTools.size(registries) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE )); @@ -209,7 +209,7 @@ public class GenericJavaXmlRegistry scopeDesc = NLS.bind(JptJaxbCoreMessages.XML_ELEMENT_DECL__SCOPE, fqScope); } messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( xmlElementDecl, xmlElementDecl.getQName().getNameTextRange(), JptJaxbCoreValidationMessages.XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME, 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 8b190c6c07..218780e97f 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 @@ -194,7 +194,7 @@ public class GenericJavaXmlRootElement if (schemaType != null) { if (! schemaType.equals(schemaElement.getType())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE, name, 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 51ccf8b7e0..f5d1d362e5 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 @@ -155,7 +155,7 @@ public abstract class GenericJavaXmlSchemaType XsdTypeDefinition xsdType = getXsdTypeDefinition(); if (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_SCHEMA_TYPE__NON_SIMPLE_TYPE, qName.getName())); 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 18015a6b7a..ffe15aacbd 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 @@ -65,7 +65,7 @@ public class GenericJavaXmlValueMapping if (! xsdClassType.hasTextContent()) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_VALUE__NO_TEXT_CONTENT )); @@ -81,7 +81,7 @@ public class GenericJavaXmlValueMapping if (! xsdType.typeIsValid(expectedSchemaType, isXmlList())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbCoreValidationMessages.XML_VALUE__INVALID_SCHEMA_TYPE, getValueTypeName())); diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java index ff02c1b765..4f331e80a6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java @@ -138,7 +138,7 @@ public class JaxbValidator } private IMessage buildValidationFailedMessage(IProject project) { - return ValidationMessageTools.buildErrorValidationMessage( + return ValidationMessageTools.buildValidationMessage( project, JptJaxbCoreValidationMessages.JAXB_VALIDATION_FAILED ); diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/validation/JptJaxbCoreValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/validation/JptJaxbCoreValidationMessages.java index 85b7834a14..68348df4d8 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/validation/JptJaxbCoreValidationMessages.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/validation/JptJaxbCoreValidationMessages.java @@ -14,6 +14,7 @@ import org.eclipse.jpt.common.core.internal.utility.ValidationMessageLoader; import org.eclipse.jpt.common.core.utility.ValidationMessage; import org.eclipse.jpt.common.utility.internal.ObjectTools; import org.eclipse.jpt.jaxb.core.JaxbProject; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; /** * Localized validation messages used by Dali JAXB core. @@ -25,31 +26,6 @@ import org.eclipse.jpt.jaxb.core.JaxbProject; */ public class JptJaxbCoreValidationMessages { - private static final ValidationMessageLoader.PreferencesAdapter PREFERENCES_ADAPTER = new PreferencesAdapter(); - private static class PreferencesAdapter - implements ValidationMessageLoader.PreferencesAdapter - { - PreferencesAdapter() { - super(); - } - // TODO - public int getSeverity(IProject project, String messageID, int defaultSeverity) { - return defaultSeverity; - // return JaxbPreferences.getValidationMessageSeverity(project, messageID, defaultSeverity); - } - @Override - public String toString() { - return ObjectTools.toString(this); - } - } - - private static final String MESSAGE_BUNDLE_NAME = "jpt_jaxb_core_validation"; //$NON-NLS-1$ - private static final String DESCRIPTION_BUNDLE_NAME = "jpt_jaxb_core_validation_description"; //$NON-NLS-1$ - private static final Class<?> BUNDLE_CLASS = JptJaxbCoreValidationMessages.class; - static { - ValidationMessageLoader.load(BUNDLE_CLASS, MESSAGE_BUNDLE_NAME, DESCRIPTION_BUNDLE_NAME, JaxbProject.MARKER_TYPE, PREFERENCES_ADAPTER); - } - // validation on project public static ValidationMessage NO_JAXB_PROJECT; @@ -153,4 +129,41 @@ public class JptJaxbCoreValidationMessages { public static ValidationMessage QNAME__MISSING_NAME; public static ValidationMessage QNAME__UNRESOLVED_COMPONENT; + + + // ********** static initialization ********** + + private static final ValidationMessageLoader.PreferencesAdapter PREFERENCES_ADAPTER = new PreferencesAdapter(); + private static class PreferencesAdapter + implements ValidationMessageLoader.PreferencesAdapter + { + PreferencesAdapter() { + super(); + } + // TODO + public int getSeverity(IProject project, String messageID, int defaultSeverity) { + return defaultSeverity; + // return JaxbPreferences.getValidationMessageSeverity(project, messageID, defaultSeverity); + } + @Override + public String toString() { + return ObjectTools.toString(this); + } + } + + private static final String MESSAGE_BUNDLE_NAME = "jpt_jaxb_core_validation"; //$NON-NLS-1$ + private static final String DESCRIPTION_BUNDLE_NAME = "jpt_jaxb_core_validation_description"; //$NON-NLS-1$ + private static final Class<?> BUNDLE_CLASS = JptJaxbCoreValidationMessages.class; + static { + ValidationMessageLoader.load(BUNDLE_CLASS, MESSAGE_BUNDLE_NAME, DESCRIPTION_BUNDLE_NAME, JaxbProject.MARKER_TYPE, PREFERENCES_ADAPTER); + + // WARNINGs + PACKAGE_NO_SCHEMA_FOR_NAMESPACE.setDefaultSeverity(IMessage.NORMAL_SEVERITY); + XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM.setDefaultSeverity(IMessage.NORMAL_SEVERITY); + XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM.setDefaultSeverity(IMessage.NORMAL_SEVERITY); + XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM.setDefaultSeverity(IMessage.NORMAL_SEVERITY); + + // INFOs + // none... + } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRootImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRootImpl.java index bac48cb559..80ac19dd55 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRootImpl.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRootImpl.java @@ -265,7 +265,7 @@ public class ELJaxbContextRootImpl } messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getJaxbProject(), JptJaxbEclipseLinkCoreValidationMessages.PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY )); 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 c0c4d9e851..edb65c8831 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 @@ -32,7 +32,7 @@ public class ELJavaElementFactoryMethod if (! resourceMethod.getTypeBinding().isSubTypeOf(JAXB.JAXB_ELEMENT)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getValidationTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE )); 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 0be9a2c7f9..47bb19869d 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 @@ -115,7 +115,7 @@ public class ELJavaXmlDiscriminatorNode if (StringTools.isBlank(this.value)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlDiscriminatorNode.this, getValueTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_DISCRIMINATOR_NODE__NOT_SPECIFIED @@ -125,7 +125,7 @@ public class ELJavaXmlDiscriminatorNode if (this.value.startsWith(XPath.DELIM)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlDiscriminatorNode.this, getValueTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XPATH__ROOT_NOT_SUPPORTED 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 36827edb6e..422b4571d4 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 @@ -90,7 +90,7 @@ public class ELJavaXmlDiscriminatorValue if (StringTools.isBlank(this.value)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlDiscriminatorValue.this, getValueTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_DISCRIMINATOR_VALUE__NOT_SPECIFIED 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 c3da8e2d23..346337a8ff 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 @@ -161,7 +161,7 @@ public class ELJavaXmlElementsMapping if (xmlElements.hasNext()) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getXmlPathsTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_PATH__INSUFFICIENT_XML_PATHS_FOR_XML_ELEMENTS )); @@ -170,7 +170,7 @@ public class ELJavaXmlElementsMapping while (xmlPaths.hasNext()) { ELJavaXmlPath xmlPath = xmlPaths.next(); messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( xmlPath.getValidationTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_PATH__INSUFFICIENT_XML_ELEMENTS_FOR_XML_PATHS )); 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 e18b1bdc3f..6c8bdfd798 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 @@ -164,7 +164,7 @@ public class ELJavaXmlInverseReferenceMapping protected void validateMappedBy(List<IMessage> messages, IReporter reporter) { if (StringTools.isBlank(mappedBy)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getMappedByTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_NOT_SPECIFIED )); @@ -180,7 +180,7 @@ public class ELJavaXmlInverseReferenceMapping JaxbPersistentAttribute referencedAttribute = getReferencedAttribute(); if (referencedAttribute == null) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getMappedByTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_NOT_RESOLVED, mappedBy, @@ -191,7 +191,7 @@ public class ELJavaXmlInverseReferenceMapping getValidReferencedAttributeMappingKeys(), referencedAttribute.getMappingKey())) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( getMappedByTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_ILLEGAL_MAPPING_TYPE, mappedBy, 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 d3ee548c7a..8dede2f3db 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 @@ -184,7 +184,7 @@ public class ELJavaXmlJoinNode protected void validateXmlPath(List<IMessage> messages) { if (StringTools.isBlank(this.xmlPath)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlJoinNode.this, getXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_JOIN_NODE__XML_PATH_NOT_SPECIFIED @@ -194,7 +194,7 @@ public class ELJavaXmlJoinNode if (this.xmlPath.startsWith(XPath.DELIM)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlJoinNode.this, getXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XPATH__ROOT_NOT_SUPPORTED @@ -210,7 +210,7 @@ public class ELJavaXmlJoinNode protected void validateReferencedXmlPath(List<IMessage> messages) { if (StringTools.isBlank(this.referencedXmlPath)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlJoinNode.this, getReferencedXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_SPECIFIED @@ -220,7 +220,7 @@ public class ELJavaXmlJoinNode if (this.referencedXmlPath.startsWith(XPath.DELIM)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlJoinNode.this, getReferencedXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XPATH__ROOT_NOT_SUPPORTED @@ -232,7 +232,7 @@ public class ELJavaXmlJoinNode if (referencedClassMapping != null && ! IterableTools.contains(referencedClassMapping.getKeyXPaths(), this.referencedXmlPath)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlJoinNode.this, getReferencedXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_IN_REFERENCED_CLASS_KEYS, 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 acad97de6d..4e63e37f41 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 @@ -178,7 +178,7 @@ public class ELJavaXmlJoinNodesMapping if (referencedClass == null) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlJoinNodesMapping.this, getValidationTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_JOIN_NODES__INVALID_REFERENCED_CLASS, @@ -218,7 +218,7 @@ public class ELJavaXmlJoinNodesMapping String xmlPath = joinNode.getXmlPath(); if (xmlPaths.count(xmlPath) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( joinNode, joinNode.getXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_JOIN_NODES__DUPLICATE_XML_PATH, @@ -231,7 +231,7 @@ public class ELJavaXmlJoinNodesMapping String referencedXmlPath = joinNode.getReferencedXmlPath(); if (referencedXmlPaths.count(referencedXmlPath) > 1) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( joinNode, joinNode.getReferencedXmlPathTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_JOIN_NODES__DUPLICATE_REFERENCED_XML_PATH, 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 0f83771e7e..b0dfa52646 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 @@ -125,7 +125,7 @@ public class ELJavaXmlPath if (StringTools.isBlank(this.value)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlPath.this, getValueTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XML_PATH__NOT_SPECIFIED @@ -135,7 +135,7 @@ public class ELJavaXmlPath if (this.value.startsWith(XPath.DELIM)) { messages.add( - this.buildErrorValidationMessage( + this.buildValidationMessage( ELJavaXmlPath.this, getValueTextRange(), JptJaxbEclipseLinkCoreValidationMessages.XPATH__ROOT_NOT_SUPPORTED diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/AbstractOxmTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/AbstractOxmTypeMapping.java index 68e070eed3..ca20e4ef9f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/AbstractOxmTypeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/AbstractOxmTypeMapping.java @@ -604,7 +604,7 @@ public abstract class AbstractOxmTypeMapping this.getNamespace(),
this.buildDefaultNamespace())) {
messages.add(
- this.buildErrorValidationMessage(
+ this.buildValidationMessage(
this.proxy.getNamespaceTextRange(),
JptJaxbCoreValidationMessages.XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE
));
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java index 960623c628..ad21aa98ec 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java @@ -162,14 +162,14 @@ public class OxmFileImpl if (getJaxbPackage() == null) {
if (StringTools.isBlank(getPackageName())) {
messages.add(
- this.buildErrorValidationMessage(
+ this.buildValidationMessage(
getPackageNameTextRange(),
JptJaxbEclipseLinkCoreValidationMessages.OXM_FILE__NO_PACKAGE_SPECIFIED
));
}
else {
messages.add(
- this.buildErrorValidationMessage(
+ this.buildValidationMessage(
getPackageNameTextRange(),
JptJaxbEclipseLinkCoreValidationMessages.OXM_FILE__NO_SUCH_PACKAGE,
getPackageName()));
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmJavaTypeImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmJavaTypeImpl.java index 520150c900..2bc6c72c0d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmJavaTypeImpl.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmJavaTypeImpl.java @@ -621,7 +621,7 @@ public class OxmJavaTypeImpl // type name must be specified
if (StringTools.isBlank(this.specifiedName)) {
messages.add(
- this.buildErrorValidationMessage(
+ this.buildValidationMessage(
getNameTextRange(),
JptJaxbEclipseLinkCoreValidationMessages.OXM_JAVA_TYPE__NAME_NOT_SPECIFIED
));
@@ -632,7 +632,7 @@ public class OxmJavaTypeImpl String packageName = TypeDeclarationTools.packageName(this.specifiedName);
if (! StringTools.isBlank(packageName) && ! ObjectTools.equals(packageName, getXmlBindings().getPackageName())) {
messages.add(
- this.buildErrorValidationMessage(
+ this.buildValidationMessage(
getNameTextRange(),
JptJaxbEclipseLinkCoreValidationMessages.OXM_JAVA_TYPE__PACKAGE_NAME_NOT_UNIFORM
));
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlRootElementImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlRootElementImpl.java index 42cf1c0aea..0c6f7f4139 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlRootElementImpl.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlRootElementImpl.java @@ -160,7 +160,7 @@ public class OxmXmlRootElementImpl if (schemaType != null) {
if (! schemaType.equals(schemaElement.getType())) {
messages.add(
- this.buildErrorValidationMessage(
+ this.buildValidationMessage(
getValidationTextRange(),
JptJaxbCoreValidationMessages.XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE,
name,
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java index e76f16f08d..604f069ed2 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java @@ -236,7 +236,7 @@ public class XPath { if (getNextStep() != null) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__ATTRIBUTE_SEGMENT_MUST_BE_LAST_SEGMENT @@ -254,7 +254,7 @@ public class XPath { XsdAttributeUse xsdAttribute= previousType.getAttribute(namespace, this.localName); if (xsdAttribute == null) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__UNRESOLVED_ATTRIBUTE, @@ -304,7 +304,7 @@ public class XPath { XsdElementDeclaration xsdElement = previousType.getElement(namespace, this.localName); if (xsdElement == null) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__UNRESOLVED_ELEMENT, @@ -351,7 +351,7 @@ public class XPath { protected void validate( Context context, XsdTypeDefinition previousType, List<IMessage> messages) { - messages. add(ValidationMessageTools.buildErrorValidationMessage( + messages. add(ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__INVALID_FORM_ILLEGAL_SEGMENT, @@ -413,7 +413,7 @@ public class XPath { if (namespace == null) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__INVALID_NS_PREFIX, @@ -461,7 +461,7 @@ public class XPath { if (getIndex() != 0) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__SELF_SEGMENT_MUST_BE_FIRST_SEGMENT @@ -577,7 +577,7 @@ public class XPath { if (getNextStep() != null) { messages.add( - ValidationMessageTools.buildErrorValidationMessage( + ValidationMessageTools.buildValidationMessage( context.getContextObject().getResource(), getTextRange(context), JptJaxbEclipseLinkCoreValidationMessages.XPATH__TEXT_SEGMENT_MUST_BE_LAST_SEGMENT diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/validation/JptJaxbEclipseLinkCoreValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/validation/JptJaxbEclipseLinkCoreValidationMessages.java index dfb7d01cf8..8c3a398724 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/validation/JptJaxbEclipseLinkCoreValidationMessages.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/validation/JptJaxbEclipseLinkCoreValidationMessages.java @@ -24,32 +24,6 @@ import org.eclipse.jpt.jaxb.core.JaxbProject; * @see ValidationMessageLoader */ public class JptJaxbEclipseLinkCoreValidationMessages { - - private static final ValidationMessageLoader.PreferencesAdapter PREFERENCES_ADAPTER = new PreferencesAdapter(); - private static class PreferencesAdapter - implements ValidationMessageLoader.PreferencesAdapter - { - PreferencesAdapter() { - super(); - } - // TODO - public int getSeverity(IProject project, String messageID, int defaultSeverity) { - return defaultSeverity; - // return JaxbEclipseLinkPreferences.getValidationMessageSeverity(project, messageID, defaultSeverity); - } - @Override - public String toString() { - return ObjectTools.toString(this); - } - } - - private static final String MESSAGE_BUNDLE_NAME = "jpt_jaxb_eclipselink_core_validation"; //$NON-NLS-1$ - private static final String DESCRIPTION_BUNDLE_NAME = "jpt_jaxb_eclipselink_core_validation_description"; //$NON-NLS-1$ - private static final Class<?> BUNDLE_CLASS = JptJaxbEclipseLinkCoreValidationMessages.class; - static { - ValidationMessageLoader.load(BUNDLE_CLASS, MESSAGE_BUNDLE_NAME, DESCRIPTION_BUNDLE_NAME, JaxbProject.MARKER_TYPE, PREFERENCES_ADAPTER); - } - // validation on project public static ValidationMessage PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY; @@ -102,4 +76,32 @@ public class JptJaxbEclipseLinkCoreValidationMessages { public static ValidationMessage XPATH__INVALID_NS_PREFIX; public static ValidationMessage XPATH__UNRESOLVED_ELEMENT; public static ValidationMessage XPATH__UNRESOLVED_ATTRIBUTE; + + + // ********** static initialization ********** + + private static final ValidationMessageLoader.PreferencesAdapter PREFERENCES_ADAPTER = new PreferencesAdapter(); + private static class PreferencesAdapter + implements ValidationMessageLoader.PreferencesAdapter + { + PreferencesAdapter() { + super(); + } + // TODO + public int getSeverity(IProject project, String messageID, int defaultSeverity) { + return defaultSeverity; + // return JaxbEclipseLinkPreferences.getValidationMessageSeverity(project, messageID, defaultSeverity); + } + @Override + public String toString() { + return ObjectTools.toString(this); + } + } + + private static final String MESSAGE_BUNDLE_NAME = "jpt_jaxb_eclipselink_core_validation"; //$NON-NLS-1$ + private static final String DESCRIPTION_BUNDLE_NAME = "jpt_jaxb_eclipselink_core_validation_description"; //$NON-NLS-1$ + private static final Class<?> BUNDLE_CLASS = JptJaxbEclipseLinkCoreValidationMessages.class; + static { + ValidationMessageLoader.load(BUNDLE_CLASS, MESSAGE_BUNDLE_NAME, DESCRIPTION_BUNDLE_NAME, JaxbProject.MARKER_TYPE, PREFERENCES_ADAPTER); + } } |