diff options
Diffstat (limited to 'plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal')
16 files changed, 0 insertions, 1789 deletions
diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/EmptySchedulingRule.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/EmptySchedulingRule.java deleted file mode 100644 index d59249a3e..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/EmptySchedulingRule.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.wst.validation.internal.core; - -import org.eclipse.core.runtime.jobs.ISchedulingRule; - -public class EmptySchedulingRule implements ISchedulingRule { - - public boolean contains(ISchedulingRule rule) - { - return rule == this; - } - - public boolean isConflicting(ISchedulingRule rule) { - return rule == this; - } - - -// public static ISchedulingRule getDefaultRule(){ -// IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory(); -// EmptySchedulingRule emptyRule = new EmptySchedulingRule(); -// ISchedulingRule rule = MultiRule.combine(ruleFactory.markerRule(fileResource), emptyRule); -// } -} diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/FileDelta.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/FileDelta.java deleted file mode 100644 index a0229a5d9..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/FileDelta.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - - - -/** - * <p> - * Default implementation of the IFileDelta - * </p> - * - * @see org.eclipse.wst.validation.internal.core.IFileDelta - * - * [issue: CS - is there a reason that we need to expose this impl class as an API? - * It would seem better to only expose IFileDelta. I can't think of a reason where - * a typical client would need to create one of these.] - */ -public class FileDelta implements IFileDelta { - private int fileDelta = 0; - private String fileName = null; - - /** - * <p> - * Creates a default instance of the FileDelta - * </p> - */ - public FileDelta() { - super(); - } - - /** - * <p> - * Constructor is used to initialize the fields. - * </p> - * - * @param aFileName specifies the file name - * @param aFileDelta specifies the - */ - public FileDelta(String aFileName, int aFileDelta) { - fileName = aFileName; - fileDelta = aFileDelta; - } - - /** - * @see IFileDelta#getDeltaType() - */ - public int getDeltaType() { - return fileDelta; - } - - /** - * @see IFileDelta#getFileName() - */ - public String getFileName() { - return fileName; - } - - /** - * <p> - * Set the flag which indicates the type of change that the file - * has undergone. - * </p> - */ - public void setDeltaType(int deltaType) { - fileDelta = deltaType; - } - - /** - * <p> - * Set the name of the file which has changed. - * </p> - */ - public void setFileName(String aFileName) { - fileName = aFileName; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/IFileDelta.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/IFileDelta.java deleted file mode 100644 index 170a74bc2..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/IFileDelta.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - -/** - * <p> - * This interface is used, for incremental validation, to encapsulate the change - * status of a resource. IFileDelta contains the name of the file which has - * changed, and a flag which indicates the type of change which has occurred. - * - * @plannedfor 1.0 - * </p> - * [issue: LM - From speaking with Vijay the name IFileDelta doesn't really capture - * what this interface is for. Validation may occur of files, it may occur on resources, - * or it may occur on something more abstract simply known as an artifact. The delta part - * of the name also seems misleading as this interface doesn't provide the delta but - * rather provides the type of change. I suggest renaming this interface to IModifiedArtifact - * or something along those lines to better capture its use. ] - */ -public interface IFileDelta { - public static final int ADDED = 1; // the file has been added - public static final int CHANGED = 2; // the file has been changed - public static final int DELETED = 3; // the file has been deleted - - /** - * <p> - * Returns the flag which indicates the type of change which has occurred: - * IFileDelta.ADDED, IFileDelta.CHANGED, or IFileDelta.DELETED. - * </p> - * @return returns the delta type. - * @plannedfor WTP 1.0 - * - * [issue: LM - From my experience a validator simply needs to know what artifact needs - * to be validated. Can you provide a use case where the type of change is needed for - * validation? ] - */ - public int getDeltaType(); - - /** - * <p> - * Returns the name of the eclipse resource file which has changed. The return value must not be - * null or the empty string (""). - * </p> - * @return returns the file name. - * @plannedfor WTP 1.0 - * - * [issue: LM - Following my comments above this method should be renamed to getArtifactName or - * something that follows along with the interface rename. ] - */ - public String getFileName(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/IMessageAccess.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/IMessageAccess.java deleted file mode 100644 index 88d6eca71..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/IMessageAccess.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - - -import java.util.List; -import java.util.Locale; - - -/** - * <p> - * Interface which can be used to access messages which are stored within a reporter which retains - * its message history. - * </p> - * - * [issue: CS - This interface seems like overkill. I'd think that an IReport should simply have a getMessages() method. - * I think MessageFiltering should take place at the 'display' level and not at this level of the API.] - */ -public interface IMessageAccess { - /** - * @param filter - * A filter which specifies a subset of messages to retrieve. null specifies, "all - * messages". - * @return List list of messages related to the target object - */ - public abstract List getMessages(MessageFilter filter); - - /** - * @param filter - * A filter which specifies a subset of messages to retrieve. null specifies, "all - * messages". - * @param locale - * The target local to translate the messages into. null specifies, "use default - * locale". - * @return List a list of messages related to the target object, translated into the specified - * locale. - */ - public abstract List getMessagesAsText(MessageFilter filter, Locale targetLocale); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/Message.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/Message.java deleted file mode 100644 index af78d644c..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/Message.java +++ /dev/null @@ -1,386 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - - -import java.util.HashMap; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * <p> - * Default implementation of the IMessage interface, provided for the convenience of the - * IValidators. If an IValidator needs to run in both AAT and WSAD then this IMessage implementation - * should be used; if the IValidator runs in WSAD alone, the WSAD LocalizedMessage may be used in - * place of this implementation. - * <p> - * @see org.eclipse.wst.validation.internal.provisional.core.IMessage - * - * [issue: CS - I'd suggest splitting this class into Message and BundleMessage (where the latter inherits - * from the former. We have many messages that come (from xerces) pretranslated and don't require 'bundle' - * related fields and methods. Splitting this class would make it easier to understand where bundle related - * function is coming into play. Below I've listed out what would go into BundleMessage to demonstrate how - * we can simplify the 'Message' class by factoring out the bundle related details. - * - * Message - * private Object targetObject = null; - * private String groupName = null; - * private int lineNumber = IMessage.LINENO_UNSET; - * private int length = IMessage.OFFSET_UNSET; - * private int offset = IMessage.OFFSET_UNSET; - * - * - * BundleMessage - * private String id = null; - * private String[] params = null; - * private String bundleName = null; - * - * - getId() - * - getBundle(...) - * - getBundleName() - * - getParams() - * - getText(Locale) - * - getText(ClassLoader) - * - getText(Locale, ClassLoader) - * - setId(String) - * - setBundleName(String) - * - setParams(String[]) - * ] - */ -public class Message implements IMessage { - private String id = null; - private String[] params = null; - private int severity = MessageFilter.ANY_SEVERITY; - private Object targetObject = null; - private String bundleName = null; - private String groupName = null; - private int lineNumber = IMessage.LINENO_UNSET; - private int length = IMessage.OFFSET_UNSET; - private int offset = IMessage.OFFSET_UNSET; - private HashMap messageAttributes; - private String markerId = null; - - /** - * <p> - * Creates a default instance of the Message - * </p> - */ - public Message() { - super(); - } - - /** - * <p> - * Creates a Message object with bundle name, severity and a unique id - * </p> - * - * @param aBundleName - * Must not be null or the empty string (""). - * @param aSeverity - * Must be one of the severities specified in IMessage. - * @param anId - * Must not be null or the empty string (""). - */ - public Message(String aBundleName, int aSeverity, String anId) { - this(aBundleName, aSeverity, anId, null, null); - } - - /** - * <p> - * Creates a Message object with bundle name, severity, a unique id, and - * a list of parameters. - * </p> - * - * @param aBundleName - * Must not be null or the empty string (""). - * @param aSeverity - * Must be one of the severities specified in IMessage. - * @param anId - * Must not be null or the empty string (""). - * @param aParams - * May be null, if there are no parameters in the message. - */ - public Message(String aBundleName, int aSeverity, String anId, String[] aParams) { - this(aBundleName, aSeverity, anId, aParams, null); - } - - /** - * <p> - * Creates a Message object with bundle name, severity, a unique id, and - * a list of parameters and the target object. - * </p> - * - * @param aBundleName - * Must not be null or the empty string (""). - * @param aSeverity - * Must be one of the severities specified in IMessage. - * @param anId - * Must not be null or the empty string (""). - * @param aParams - * May be null, if there are no parameters in the message. - * @param targetObject - * May be null, if the message does not pertain to a particular - * object. - */ - public Message(String aBundleName, int aSeverity, String anId, String[] aParams, Object aTargetObject) { - bundleName = aBundleName; - severity = aSeverity; - id = anId; - params = aParams; - targetObject = aTargetObject; - } - - public Message(String aBundleName, int aSeverity, String anId, String[] aParams, Object aTargetObject, String aGroupName) { - bundleName = aBundleName; - severity = aSeverity; - id = anId; - params = aParams; - targetObject = aTargetObject; - groupName = aGroupName; - } - - /** - * @return the resource bundle which contains the messages, as identified by - * - * @link #getBundleName() - */ - public ResourceBundle getBundle(Locale locale, ClassLoader classLoader) { - ResourceBundle bundle = null; - try { - if (classLoader == null) { - bundle = ResourceBundle.getBundle(getBundleName(), locale); - } else { - bundle = ResourceBundle.getBundle(getBundleName(), locale, classLoader); - } - } catch (MissingResourceException e) { - e.printStackTrace(); - } - return bundle; - } - - /** - * @see IMessage#getBundleName() - */ - public String getBundleName() { - return bundleName; - } - - /** - * @see IMessage#getGroupName() - */ - public String getGroupName() { - return groupName; - } - - /** - * @see IMessage#getId() - */ - public String getId() { - return id; - } - - /** - * @see IMessage#getLength() - */ - public int getLength() { - return length; - } - - /** - * @see IMessage#getLineNumber() - */ - public int getLineNumber() { - return lineNumber; - } - - /** - * @see IMessage#getOffset() - */ - public int getOffset() { - return offset; - } - - /** - * @see IMessage#getParams() - */ - public String[] getParams() { - return params; - } - - /** - * @see IMessage#getSeverity() - */ - public int getSeverity() { - return severity; - } - - /** - * @see IMessage#getTargetObject() - */ - public Object getTargetObject() { - return targetObject; - } - - /** - * @see IMessage#getText() - */ - public String getText() { - return getText(Locale.getDefault(), null); - } - - /** - * @see IMessage#getText(ClassLoader) - */ - public String getText(ClassLoader classLoader) { - return getText(Locale.getDefault(), classLoader); - } - - /** - * @see IMessage#getText(Locale) - */ - public String getText(Locale locale) { - return getText(locale, null); - } - - /** - * @see IMessage#getText(Locale, ClassLoader) - */ - public java.lang.String getText(Locale locale, ClassLoader classLoader) { - String message = ""; //$NON-NLS-1$ - - if (locale == null) { - return message; - } - - ResourceBundle bundle = getBundle(locale, classLoader); - if (bundle == null) { - return message; - } - - try { - message = bundle.getString(getId()); - - if (getParams() != null) { - message = java.text.MessageFormat.format(message, getParams()); - } - } catch (MissingResourceException exc) { - System.err.println(exc.getMessage()); - System.err.println(getId()); - } catch (NullPointerException exc) { - System.err.println(exc.getMessage()); - System.err.println(getId()); - } - - return message; - } - - /** - * @see IMessage#setBundleName(String) - */ - public void setBundleName(String aBundleName) { - bundleName = aBundleName; - } - - /** - * @see IMessage#setGroupName(String) - */ - public void setGroupName(String name) { - groupName = name; - } - - /** - * @see IMessage#setId(String) - */ - public void setId(String newId) { - id = newId; - } - - /** - * @see IMessage#setLength(int) - */ - public void setLength(int length) { - if (length < 0) { - length = IMessage.OFFSET_UNSET; - } - this.length = length; - } - - /** - * @see IMessage#setLineNo(int) - */ - public void setLineNo(int lineNumber) { - if (lineNumber < 0) { - this.lineNumber = IMessage.LINENO_UNSET; - } else { - this.lineNumber = lineNumber; - } - } - - /** - * @see IMessage#setOffset(int) - */ - public void setOffset(int offset) { - if (offset < 0) { - offset = IMessage.OFFSET_UNSET; - } - this.offset = offset; - } - - /** - * @see IMessage#setParams(String[]) - */ - public void setParams(String[] newParams) { - params = newParams; - } - - /** - * @see IMessage#setSeverity(int) - */ - public void setSeverity(int newSeverity) { - severity = newSeverity; - } - - /** - * @see IMessage#setTargetObject(Object) - */ - public void setTargetObject(Object obj) { - targetObject = obj; - } - - public Object getAttribute(String attributeName) { - if(messageAttributes != null) { - return messageAttributes.get(attributeName); - } - return null; - } - - public void setAttribute(String attributeName, Object value) { - if(messageAttributes == null) { - messageAttributes = new HashMap(); - } - messageAttributes.put(attributeName,value); - } - - public HashMap getAttributes() { - return messageAttributes; - } - - public String getMarkerId() { - return markerId; - } - - public void setMarkerId(String markerId) { - this.markerId = markerId; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/MessageFilter.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/MessageFilter.java deleted file mode 100644 index a3800613e..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/MessageFilter.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - -import org.eclipse.wst.validation.internal.provisional.core.IValidator; - - -/** - * <p> - * Encapsulates common message filtering parameters. Message Filters are used when retrieving - * messages via an IMessageAccess. The filter encapsulates a simple set of typical filter criteria - * which is used to select a subset of messages to retrieve. If multiple attributes of the message - * filter are specified, they should be logically AND'd together by the MessageAccess - * implementation. - * </p> - */ -public class MessageFilter { - public static final int ANY_SEVERITY = -1; - - /** - * <p> - * Messages matching this severity(s) will be retrieved. One of SeverityEnum XXX_severity - * constants, or ANY_SEVERITY to specify that messages of any severity will be returned. This - * field can be combined with other filter attributes to narrow the selection set further. - * </p> - */ - private int severity = ANY_SEVERITY; - - /** - * <p> - * The validator which reported the messages that should be returned. All messages which were - * reported using validator matching this validator will be returned. This field can be combined - * with other filter attributes to narrow the selection set further. - * </p> - */ - private IValidator validator; - - /** - * <p> - * The target object of the messages that should be returned, or null to specify to retrieve - * messages of any target. All messages having a target object matching this object will be - * returned. This field can be combined with other filter attributes to narrow the selection set - * further. - * </p> - */ - private Object targetObject; - - /** - * @deprecated - */ - public MessageFilter() { - super(); - } - - /** - * - * @param aSeverity - * Severity of the message - * @param validator - * IValidator which reported the message - * @param aTargetObject - * Target object of the message - */ - public MessageFilter(int aSeverity, IValidator validator, Object aTargetObject) { - super(); - severity = aSeverity; - this.validator = validator; - targetObject = aTargetObject; - } - - /** - * @return the severity filter constraint. - */ - public int getSeverity() { - return severity; - } - - /** - * @return the target object filter constraint. - */ - public java.lang.Object getTargetObject() { - return targetObject; - } - - /** - * @return the validator to filter on. - */ - public IValidator getValidator() { - return validator; - } - - /** - * Set the severity filter constraint. - * - * @param newSeverity - * severity filter constraint - */ - public void setSeverity(int newSeverity) { - severity = newSeverity; - } - - /** - * Set the target object filter constraint. - * - * @param newTargetObject - * target object filter constraint - */ - public void setTargetObject(java.lang.Object newTargetObject) { - targetObject = newTargetObject; - } - - /** - * Set the validator to return messages for. - * - * @param validator - * validator to return messages for - */ - public void setValidator(IValidator validator) { - this.validator = validator; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/ValidationException.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/ValidationException.java deleted file mode 100644 index e5fb20aee..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/ValidationException.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - - -import java.util.Locale; - -import org.eclipse.wst.validation.internal.provisional.core.IMessage; - -/** - * <p> - * This exception is the only exception which should be thrown by IValidators. The message in this - * exception must be suitable for showing to the user. All ValidationExceptions will have their - * message extracted when they're caught, and the message will be shown to the user. - * - * @plannedfor 1.0 - * </p> - */ -public class ValidationException extends Exception { - private Throwable _lowLevelException = null; - private IMessage _message = null; - private ClassLoader _loader = null; - private final static long serialVersionUID = -3387516993124229949L; - - - - /** - * Constructs a new exception with a given message string. <br> - * <br> - * - * @param message - * IMessage, which is Locale-independent, which contains the message to be shown to - * be shown to the user. - */ - public ValidationException(IMessage message) { - this(message, null); - } - - /** - * Constructs a new exception with a given message string, and low-level exception. <br> - * <br> - * - * @param message - * IMessage Locale-independent message to be shown to the user. - * @param exception - * relevant low-level exception, or <code>null</code> if none. <br> - *   For example, when a method fails because of a network - * communications   problem, this would be the - * <code>java.io.IOException</code>   describing the exact nature - * of the problem. - */ - public ValidationException(IMessage message, Throwable exception) { - super(); - _message = message; - _lowLevelException = exception; - } - - /** - * @return the low-level exception associated with this ValidationException. - */ - public Throwable getAssociatedException() { - return _lowLevelException; - } - - /** - * @return the IMessage to be shown to the user, or null if this exception should be handled - * internally. - */ - public IMessage getAssociatedMessage() { - return _message; - } - - /** - * @return if the IValidator which threw this exception was loaded by a different ClassLoader than the - * framework, this method returns the ClassLoader of the IValidator. - */ - public ClassLoader getClassLoader() { - return _loader; - } - - /** - * @return the error message string of this <code>Throwable</code> object if it was - * {@link java.lang.Throwable#Throwable(String) created}with an error message string; - * or <code>null</code> if it was {@link java.lang.Throwable#Throwable() created}with - * no error message. - * - */ - public String getMessage() { - return _message.getText(getClassLoader()); - } - - /** - * @param locale - * The locale of which to get the message. - * @return the error message string of this <code>Throwable</code> object if it was - * {@link java.lang.Throwable#Throwable(String) created}with an error message string; - * or <code>null</code> if it was {@link java.lang.Throwable#Throwable() created}with - * no error message. - */ - public String getMessage(Locale locale) { - return _message.getText(locale, getClassLoader()); - } - - /** - * <p> - * If the IValidator which threw this exception was loaded by a different ClassLoader than the - * framework, this method should set the ClassLoader to be the ClassLoader of the IValidator. - * </p> - * @param loader - * ClassLoader of the validator - */ - public void setClassLoader(ClassLoader loader) { - _loader = loader; - } - - /** - * <p> - * Returns a short description of this throwable object. If this <code>Throwable</code> object - * was {@link java.lang.Throwable#Throwable(String) created}with an error message string, then - * the result is the concatenation of three strings: - * <ul> - * <li>The name of the actual class of this object - * <li>": " (a colon and a space) - * <li>The result of the {@link #getMessage}method for this object - * </ul> - * If this <code>Throwable</code> object was {@link java.lang.Throwable#Throwable() created} - * with no error message string, then the name of the actual class of this object is returned. - * </p> - * - * @return a string representation of this <code>Throwable</code>. - */ - public String toString() { - return toString(Locale.getDefault()); - } - - /** - * <p> - * Returns a short description of this throwable object. If this <code>Throwable</code> object - * was {@link java.lang.Throwable#Throwable(String) created}with an error message string, then - * the result is the concatenation of three strings: - * <ul> - * <li>The name of the actual class of this object - * <li>": " (a colon and a space) - * <li>The result of the {@link #getMessage}method for this object - * </ul> - * If this <code>Throwable</code> object was {@link java.lang.Throwable#Throwable() created} - * with no error message string, then the name of the actual class of this object is returned. - * </p> - * - * @return a string representation of this <code>Throwable</code>. - */ - public String toString(Locale locale) { - String s = getClass().getName(); - String message = getMessage(locale); - return (message != null) ? (s + ": " + message) : s; //$NON-NLS-1$ - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/ValidatorLauncher.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/ValidatorLauncher.java deleted file mode 100644 index cae39724f..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/core/ValidatorLauncher.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.core; - -import org.eclipse.wst.validation.internal.provisional.core.IReporter; -import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; -import org.eclipse.wst.validation.internal.provisional.core.IValidator; - - - -/** - * <p> - * This singleton launches the validation on a single validator. Clients should call this class's - * <code>start</code> method to begin the validation. - * </p> - */ -public class ValidatorLauncher { - private static ValidatorLauncher _launcher = null; - - - /** - * Default constructor - */ - private ValidatorLauncher() { - //Default constructor - } - - /** - * @return the singleton launcher. - */ - public static ValidatorLauncher getLauncher() { - if (_launcher == null) { - _launcher = new ValidatorLauncher(); - } - return _launcher; - } - - /** - * <p> - * This method is the launch point of the validation. It runs validation on the validator - * accessed by the IValidationContext. When the validation is complete, each validator may perform resource - * cleanup, if necessary. - * - * <br> - * <br> - * If <code>helper</code>,<code>validator</code>, or <code>reporter</code> are null, - * validation is not performed. <code>changedFiles</code> may be null, or empty, if a full - * build should be done. - * </p> - * - * @param helper - * loads an object. - * @param validator - * validator object to launch validation. - * @param reporter - * Is an instance of an IReporter interface, which is used for - * interaction with the user. - * @param changedFiles - * Is an array of files which have been added, changed, or deleted - * since the last validation. If <code>changedFiles</code> is null, or if it is an empty - * array, then a full validation should be performed. Otherwise, validation on just the files - * listed in the array should performed if the validator supports incremental validation. - */ - public void start(final IValidationContext helper, final IValidator validator, final IReporter reporter) throws ValidationException { - if ((helper == null) || (validator == null) || (reporter == null)) { - return; - } - - // Can't force each validator to check if it's cancelled or not, - // so check for cancellation here. Hopefully the user won't wait - // too long. - if (reporter.isCancelled()) { - return; - } - - // If the validator is about to perform a full build, remove all of its previous validation - // messages. - if ((helper.getURIs() == null) || (helper.getURIs().length == 0)) { - reporter.removeAllMessages(validator); - } - - validator.validate(helper, reporter); - validator.cleanup(reporter); - - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IMessage.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IMessage.java deleted file mode 100644 index 28de1c376..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IMessage.java +++ /dev/null @@ -1,347 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - - -import java.util.HashMap; -import java.util.Locale; - -/** - * <p> - * This interface represents a locale-independent validation message. - * </p> - * <p> - * Given these three values as input, this interface can be queried for the final message string. - * (i.e., the message with the parameters already substituted in.) Either the default Locale can be - * used, or the caller can specify a Locale. - * - * @plannedfor 1.0 - * </p> - * - * [issue: CS - The 'IMessage' interface would be simpler without the bundle related details. I'd like to understand - * why we can 'precompute' the translated message. Is there some benefit to perform 'late computation' of these messages? - * How does this compare to the eclipse Marker (as far as I know the Marker's text() is preLocalized). - * Here's a list of the methods that are related to 'bundle specific' aspects and could be separate out (or designed away)? - * - * - getId() - * - getBundle(...) - * - getBundleName() - * - getParams() - * - getText(Locale) - * - getText(ClassLoader) - * - getText(Locale, ClassLoader) - * - setId(String) - * - setBundleName(String) - * - setParams(String[]) - * ] - * - * - void setAttribute(String attributeName, Object value) - * - Object getAttribute(String attributeName); - * ] - */ -public interface IMessage { - public static final int OFFSET_UNSET = -1; // see getLength(), getOffset() - public static final int LINENO_UNSET = 0; - /** - * Typically used to specify error messages. - */ - public static final int HIGH_SEVERITY = 0x0001; - /** - * Typically used to specify warning messages. - */ - public static final int NORMAL_SEVERITY = 0x0002; - /** - * Typically used to specify information messages. - */ - public static final int LOW_SEVERITY = 0x0004; - /** - * Specify high (error) and normal (warning) messages. Typically used with a MessageFilter, to - * filter out information messages. - */ - public static final int ERROR_AND_WARNING = HIGH_SEVERITY | NORMAL_SEVERITY; - /** - * Specify all types of messages. Typically used with a MessageFilter. - */ - public static final int ALL_MESSAGES = ERROR_AND_WARNING | LOW_SEVERITY; - - /** - * @return the name of the bundle which this message is contained in. - */ - public String getBundleName(); - - /** - * <p> - * To support removal of a subset of validation messages, an IValidator may assign group names - * to IMessages. An IMessage subset will be identified by the name of its group. Default (null) - * means no group. - * </p> - * @return the name of the group to which the message belongs. - */ - public String getGroupName(); - - /** - * <p> - * Returns the id of the message. Message ids are used as the constants in property bundles - * which localize the description of the message in a locale-independent fashion. The id is the - * key, in the resource bundle, which identifies the string to be loaded. The id may not be null - * or the empty string. - * </p> - * @return the id of the message - */ - public java.lang.String getId(); - - /** - * @return the length of the problem area, starting from the offset. If unset, value = - * IMessage.OFFSET_UNSET. - * - * @see #getOffset() - */ - public int getLength(); - - /** - * <p> - * If there is a target object associated with this IMessage, and that target object is a file, - * then an optional line number may be set. The line number identifies the location of the - * problem identified by this message. If no line number has been set, #LINENO_UNSET will be - * returned. - * </p> - * @return line number of the location of the problem. - * - */ - public int getLineNumber(); - - /** - * <p> - * Returns the offset of the message. If unset, value = IMessage.OFFSET_UNSET. For example, if - * the java compiler were a validator, and it reported that a variable name was unknown, offset - * would identify the position of the first character of the unknown variable. (The position is - * identified by the number of characters from the start of the file.) - * </p> - * - * @return offset of the message - */ - public int getOffset(); - - /** - * <p> - * Returns the parameters of the message. Message parameters are the values which are - * substituted into parameter slots in localized message text ddscriptions. - * </p> - * - * @return parameters of the message - */ - public java.lang.String[] getParams(); - - /** - * <p> - * Returns the severity level of the message. One of SeverityEnum constants. - * - * @see IMessage#HIGH_SEVERITY - * @see IMessage#NORMAL_SEVERITY - * @see IMessage#LOW_SEVERITY - * </p> - * - * @return the severity level of the message - */ - public int getSeverity(); - - /** - * <p> - * Return the object that this IMessage is reporting the problem against, if any. null will be - * returned if this is a general message which does not apply to a particular object; for - * example, "internal error". - * </p> - * - * @return the target object for the message - */ - public Object getTargetObject(); - - /** - * @return a text representation of this message formatted in the default Locale, with the - * bundle loaded by the default ClassLoader. - */ - public java.lang.String getText(); - - /** - * @param classLoader - * The ClassLoader which will be used to load the ResourceBundle. - * - * @return a text representation of this message formatted in the default locale, with the - * bundle loaded by the specified ClassLoader. - */ - public java.lang.String getText(ClassLoader classLoader); - - /** - * @param locale - * The locale to translate the message text into. - * - * @return a text representation of this message formatted in the specified locale, with the - * bundle loaded by the default ClassLoader. - */ - public java.lang.String getText(Locale locale); - - /** - * @param locale - * The locale to translate the message text into. - * @param classLoader - * The ClassLoader which will be used to load the ResourceBundle. - * - * @return a text representation of this message formatted in the specified locale, with the - * bundle loaded by the specified ClassLoader. - */ - public java.lang.String getText(Locale locale, ClassLoader classLoader); - - /** - * Provides a way to store some additional attributes that a message would like to store - * that can used by some other parties that are interested in those attribute values. Basically - * a convienince to pass object values around that can consumed by other Objects it they need it - * @param attributeName - * @return an Object basically the value associated with the object name. - */ - - public Object getAttribute(String attributeName); - - /** - * Set the attributeName and value as key value pair - * @see getAttribute(String attributeName). - * @param attributeName - */ - - void setAttribute(String attributeName, Object value); - - - /** - * Set the name of the bundle which this message is contained in. - * - * @param bundleName - * Name of the bundle which contains the message. - */ - public void setBundleName(String bundleName); - - /** - * <p> - * To support removal of a subset of validation messages, an IValidator may assign group names - * to IMessages. An IMessage subset will be identified by the name of its group. Default (null) - * means no group. - * </p> - * - * @param name - * Name of the group. - */ - public void setGroupName(String name); - - /** - * <p> - * Set the id of the message. Message ids are used as the constants in property bundles which - * localize the description of the message in a locale-independent fashion. The id is the key, - * in the resource bundle, which identifies the string to be loaded. The id may not be null or - * the empty string. - * </p> - * - * @param newId - * Id of the message. - */ - public void setId(java.lang.String newId); - - /** - * <p> - * Sets the length of the problem, starting from the offset. If unset, value = - * IMessage.OFFSET_UNSET. - * - * @see #setOffset(int) - * </p> - * - * @param length - * sets the length - */ - public void setLength(int length); - - /** - * <p> - * If there is a target object associated with this IMessage, and that target object is a file, - * then an optional line number may be set. The line number identifies the location of the - * problem identified by this message. To indicate no line number, use #LINENO_UNSET. - * </p> - * @param lineNumber - * sets the line no. - */ - public void setLineNo(int lineNumber); - - /** - * <p> - * Sets the offset of the message. If unset, value = IMessage.OFFSET_UNSET. For example, if the - * java compiler were a validator, and it reported that a variable name was unknown, offset - * would identify the position of the first character of the unknown variable. (The position is - * identified by the number of characters from the start of the file.) - * </p> - * @param offset - * sets the offset of the message. - */ - public void setOffset(int offset); - - /** - * <p> - * Sets the parameters of the message. Message parameters are the values which are substituted - * into parameter slots in localized message text descriptions. - * </p> - * <p> - * For example, if getId() returns "MY_ID", then the ResourceBundle identified by - * getBundleName() is searched for the message named "MY_ID", and if found, - * </p> - * - * @see java.text.MessageFormat#format(String, Object[]) is invoked on the message, with - * <code>newParams</code> passed in as the Object[]. - * @param newParams - * parameters of the message. - */ - public void setParams(java.lang.String[] newParams); - - /** - * Sets the severity level of the message. One of SeverityEnum constants. - * - * @see IMessage#HIGH_SEVERITY - * @see IMessage#NORMAL_SEVERITY - * @see IMessage#LOW_SEVERITY - * - * @param newSeverity - * severity level of the message - */ - public void setSeverity(int newSeverity); - - /** - * <p> - * Associate this IMessage with the object that has the problem. A null value is permitted. If a - * message is applicable to one object, then this value should be set. Otherwise, the default - * value (null) should be kept. Given this target object, it should be possible to calculate the - * exact location of the problem. - * </p> - * - * @param obj - * The object that has the problem. - */ - public void setTargetObject(Object obj); - - /** - * return all the attributes of a Message object - * @return - */ - public HashMap getAttributes(); - - /** - * return the marker id if one is set on this object when created - */ - public String getMarkerId(); - - /** - * set the marker id on a Message object - */ - public void setMarkerId(String markerId); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IMetaModelContext.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IMetaModelContext.java deleted file mode 100644 index 37a9cfe2a..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IMetaModelContext.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - -public interface IMetaModelContext extends IValidationContext { - - public Object getModel(String URI); - -} diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IProjectValidationContext.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IProjectValidationContext.java deleted file mode 100644 index 95533dba3..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IProjectValidationContext.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.wst.validation.internal.provisional.core; - -import org.eclipse.core.resources.IProject; - -/** - * IProjectValidationContext extends IValidationContext to provide access to a - * reference to the project on which a validator is being invoked. - * <p> - * <b>Note:</b> This class/interface is part of an interim API that is still - * under development and expected to change significantly before reaching - * stability. It is being made available at this early stage to solicit feedback - * from pioneering adopters on the understanding that any code that uses this - * API will almost certainly be broken (repeatedly) as the API evolves. - * </p> - */ -public interface IProjectValidationContext extends IValidationContext -{ - /** - * Provides the project on which the validator is being invoked. - * - * @return an IProject reference to the project on which the validator is - * being invoked. - */ - IProject getProject(); -} diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IReporter.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IReporter.java deleted file mode 100644 index a2cd946cb..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IReporter.java +++ /dev/null @@ -1,164 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - -import java.util.List; - - - - -/* - * CCM - Reporter is now passed locale-independent messages. - * Messages should only be translated to a locale upon access. - * Or in special locale-dependent reporter implementations (console logger). - */ - -/** - * The interface used by IValidator's to report messages. The implementation of the IReporter could - * simply log the messages to stdout, a file, or retain them in a buffer for later access by a user - * interface. - * - * Reporter implementations should keep non-localized versions of their messages - * - * Any messages which need to be displayed to the user are done through this class, and if the user - * cancels the current function, this class is the one which registers the cancellation. - * - * The IReporter instance is created at the time validation begins and ends when validation is complete. - * There is only one IReporter instance created for all validators that are run on a IResource. The IResource - * provides a way to get messages put out each validator and add and delete messages for one validator - * at a time. - * ] - */ -public interface IReporter { - /** - * <p> - * Add a locale-independent validation message. It will be displayed later, with all of the - * other validation messages. - * </p> - * <p> - * The IValidator passed in is needed for incremental validation (when a message needs to be - * removed, one validator should not remove messages entered by another validator.) The - * validator is also queried for information about its resource bundle, to enable support for - * localization of messages in a client-server environment. - * </p> - * <p> - * Both parameters must not be null. - * </p> - * @param origin - * The validator which is the source of the message. - * @param message - * A message to be reported - * @exception MessageLimitException - * is thrown when the total number of messages reported exceeds the maximum - * allowed. - * [issue: LM - This exception seems questionable to me. Why do validators need to know how - * to handle a MessageLimitException? Seems to me that this is a validation framework - * specific issue and that client validators shouldn't know about this at all. ] - */ - public abstract void addMessage(IValidator origin, IMessage message); - - /** - * <p> - * Show a text representation of this message, formatted in the default Locale, to the user - * immediately. This message indicates which subtask is currently being processed. The message - * is not stored. The subtask message in this context is the subtask in a IProgressMontior - * - * @see subTask(String name) in IProgressMonitor - * </p> - * <p> - * Both parameters must not be null. - * </p> - * - * @param IValidator - * validator The validator issuing the subtask message. - * @param IMessage - * message The message to be displayed to the user. - * - */ - public abstract void displaySubtask(IValidator validator, IMessage message); - - /** - * @return the message access interface to this reporter, or null if message access is not - * supported. - * - */ - public List getMessages(); - - /** - * <p> - * Return true if the user cancelled validation, and false otherwise. This method should be - * called by IValidators periodically, because no event is fired to notify IValidators that the - * user cancelled validation. If a validator does not check this method, a cancellation request - * is ignored. - * </p> - * - * @return true if the user cancelled validation, and false otherwise. - * - */ - public abstract boolean isCancelled(); - - /** - * <p> - * Remove all validation messages entered by the identified validator. This method is provided - * for incremental validation. - * </p> - * <p> - * The IValidator parameter must not be null. - * </p> - * @param origin - * originator validator of the message. - */ - public abstract void removeAllMessages(IValidator origin); - - /** - * Remove all validation messages, entered by the identified validator, pertaining to the Object - * provided. This method is provided for incremental validation. <br> - * <br> - * If <code>object</code> is null, then this method should remove all messages owned by the - * validator. (i.e., the same behaviour as the removeAllMessages(IValidator) method.) <br> - * <br> - * <p> - * The IValidator parameter must not be null. - * </p> - * @param origin - * originator validator of the message. - * @param object - * Object to which the message belongs. Object is the target object that was set on the IMessage - * when adding the message as problem marker. - * - */ - public abstract void removeAllMessages(IValidator origin, Object object); - - /** - * To support removal of a subset of validation messages, an IValidator may assign group names - * to IMessages. An IMessage subset will be identified by the name of its group. This method - * will remove only the IMessage's that are in the group identified by groupName. <br> - * <br> - * <br> - * - * The IValidator parameter must not be null. <br> - * <br> - * - * If <code>object</code> is null, then this method should remove all messages owned by the - * validator. (i.e., the same behaviour as the removeAllMessages(IValidator) method.) - * - * If groupName is null, that's the same as no group (i.e., the same behaviour as the - * <code>removeAllMessages(IValidator, Object)</code> method.) <br> - * - * @param origin - * originator validator of the message. - * @param object - * Object to which the message belongs. - * @param groupName - * name of the group to which the message belongs. - */ - public void removeMessageSubset(IValidator validator, Object obj, String groupName); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidationContext.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidationContext.java deleted file mode 100644 index 135a80fa1..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidationContext.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - - - -/** - * <p> - * This class is used to to separate the IValidator from the model loading. A model - * is a group of object(s) that must follow some rules. - * </p> - * <p> - * The model is loaded differently depending on whether the validator is running in - * UI or headless context. If the <code>loadModel</code> method was a method on the IValidator, - * then there would need to be two versions of validators, one for headless and one for - * UI. Because <code>loadModel</code> is separate from the IValidator, we provide - * two different IHelpers instead, and ship the one specific to the environment. - * </p> - * <p> - * Each IValidationContext implementation loads a specific model as identified by a String - * <code>symbolicName</code>. The symbolicName can be any value except null or the - * empty string. Each validator identifies the symbolic names which it needs, and the - * type of model which needs to be returned when that symbolic name is loaded via a - * <code>loadModel</code> method. An IValidationContext can support more than one IValidator; - * the helper needs to support every model that each validator needs. - * </p> - */ -public interface IValidationContext { - /** - * <p> - * Load the model identified by <code>symbolicName</code>.<code>symbolicName</code> - * must not be null or the empty string if the validator needs to be run in both - * Headless and UI. - * - * The symbolicName is a string name that is registered in the implementation of the - * IValidatorContext. For an example our internal implementation of the loadModel use - * method names for symbolicNames to load the model object to be validated. Users can - * use their own model load mechanism. - * @see <code>WorkbenchContext</code> - * - * </p> - * @plannedfor 1.0 - */ - public Object loadModel(String symbolicName); - - /** - * <p> - * Load the model identified by <code>symbolicName</code> and <code>parms</code>. - * <code>symbolicName</code> must not be null or the empty string if the validator - * needs to be run in both Headless and UI. If <code>parms</code> is null then this - * method behaves the same as - * - * @link #loadModel(String). - * - * This method differs from - * @link #loadModel(String) because it takes parameters, from the IValidator, which - * are available only at runtime. If you need to pass a live object to the IValidationContext, - * this is the loadModel method to use. - * </p> - * @param symbolicName String identifier for model - * @param parms parms list of parameters that the model takes for invocation - * - * [issue : CS - It's not at all clear how these parameters would get passed into a helper. I'd suggest - * providing getProperty() and setProperty() methods on the class to allow contextual information to be - * supplied and queried in a generic manner.] - */ - public Object loadModel(String symbolicName, Object[] parms); - - /** - * @return a string array with the list of URI's that need to be validated in the - * case of Incremental build - */ - - public String[] getURIs(); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidator.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidator.java deleted file mode 100644 index 366df5fe9..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidator.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - -import org.eclipse.wst.validation.internal.core.ValidationException; - -/** - * This is the base interface for all Validators. A Validator is a class which verifies that objects - * follow some rules. For example, in a MOF model which represents an EJB jar, the EJB specification - * determines the rules. <br> - * <br> - * A validator can perform full validation or incremental validation. All validators must implement - * full validation but incremental validation is optional. <br> - * <br> - * Each validator must not be tied to any particular workbench implementation. <br> - * <br> - * A validator's verification starts when the ValidatorLauncher singleton calls - * <code>validate</code>. - * - * [issue: LM - This interface will be implemented by clients. This should be considered a candidate for - * an abstract class. ] - */ -public interface IValidator{ - /** - * <p> - * Perform any resource cleanup once validation is complete. If cleanup will take some time, the - * IValidator should report subtask information to the user through the IReporter parameter. The - * IReporter parameter will not be null. - * </p> - * @param reporter used for the interaction with the user - * @plannedfor WTP 1.0 - * - * [issue : CS - Perhaps the IValidator should be required to provide a 'name' that can be used describe - * the running validation 'Job'. Then the framework could automatically say something like 'XYZ validator : cleanup'. - * Relying on the IValidator to provide subtask information seems error prone.] - * [issue: LM - Is the cleanup method necessary? Can the framework put a requirement that client validators 'clean up' - * before returning from the validate method? ] - */ - public void cleanup(IReporter reporter); - - /** - * This is the method which performs the validation on the objects. <br> - * <br> - * <code>helper</code> and <code>reporter</code> may not be null. <code>changedFiles</code> - * may be null, if a full build is desired. <br> - * <br> - * @param helper - * loads an object. - * @param reporter - * Is an instance of an IReporter interface, which is used for - * interaction with the user. - * @param changedFiles - * Is an array of files which have been added, changed, or deleted - * since the last validation. If <code>changedFiles</code> is null, or if it is an empty - * array, then a full validation should be performed. Otherwise, validation on just the files - * listed in the array should performed if the validator supports incremental validation. - * - * [issue : CS - I'm curious to understand why the validator is not invoked directly on a file. It seems it should be the - * domain of another API to manage manage incremental file changes and triggering validations accordingly. - * Do we have a current use case in WTP where the validator does anything more validate a file from the changedFiles list?] - */ - public void validate(IValidationContext helper, IReporter reporter) throws ValidationException; -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidatorJob.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidatorJob.java deleted file mode 100644 index 595151b33..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/IValidatorJob.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.wst.validation.internal.core.ValidationException; - -/** - * This is the Job interface for the validator. Validators implementing this interface are executed as - * background jobs. - * Following is a sequence of call <br/> - * validator.getSchedulingRule(helper) <br/> - * validator.validate(reporter) - */ - -public interface IValidatorJob extends IValidator{ - - public static IStatus OK_STATUS = new Status(IStatus.OK, "org.eclipse.wst.validation", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$ - - - - /** - * This is the method which performs the validation on the objects. <br> - * <br> - * <code>reporter</code> may not be null. <code>changedFiles</code> - * may be null, if a full build is desired. <br> - * <br> - * - * @param reporter - * Is an instance of an IReporter interface, which is used for interaction with the - * user. - * @param helper will not be null, - * loads an object. - */ - public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException; - - /** - * Get the scheduling rule, which the framework applies to the Validator job, - * @param helper will not be null, - * loads an object. - * @return - */ - public ISchedulingRule getSchedulingRule(IValidationContext helper); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/MessageLimitException.java b/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/MessageLimitException.java deleted file mode 100644 index 4a9c63eec..000000000 --- a/plugins/org.eclipse.wst.validation/validate_core/org/eclipse/wst/validation/internal/provisional/core/MessageLimitException.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * 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: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.validation.internal.provisional.core; - - -/** - * This exception is thrown by - * - * @see IReporter#addMessage(IValidator, IMessage) method if no more messages can be reported - * because the maximum number of messages has been reported. - * [issue: LM - Going along with my comment on the addMessage method in IReporter I - * think this class should be internal to the validation framework. - * I don't think there's a need for this class to be exposed to clients. If too many - * messages are added the framework should handle this without notifying the client - * validator. ] - * @deprecated This class is not longer used by the framework. The framework is - * not going to limit the number of messages displayed by a validator. - */ -public class MessageLimitException extends RuntimeException { - private final static long serialVersionUID = -7034897190745766940L; -}
\ No newline at end of file |