diff options
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java')
-rw-r--r-- | jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java index f0db845560..afadeb55d9 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 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 - ******************************************************************************/ + * Copyright (c) 2010 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.validation; import org.eclipse.jpt.core.utility.TextRange; @@ -14,11 +14,13 @@ import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin; import org.eclipse.wst.validation.internal.core.Message; import org.eclipse.wst.validation.internal.provisional.core.IMessage; + public class DefaultValidationMessages { private static String[] DEFAULT_PARMS = new String[0]; private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance(); + public static IMessage buildMessage( int defaultSeverity, String messageId, Object targetObject) { return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject); @@ -40,14 +42,15 @@ public class DefaultValidationMessages { //determine whether default severity should be overridden int severity = defaultSeverity; - // TODO JAXB validation preferences + // TODO - user override of errors/warnings // int severityPreference = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId); -// if (severityPreference!=JpaValidationPreferences.NO_SEVERITY_PREFERENCE){ +// if (severityPreference != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){ // severity = severityPreference; // } IMessage message = new Message(JaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject); message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID); + if (textRange == null) { //log an exception and then continue without setting location information //At least the user will still get the validation message and will |