Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse')
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseLogger.java53
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDL11ValidatorDelegate.java60
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDLValidatorDelegate.java72
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/InlineSchemaModelGrammarPoolImpl.java50
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/URIResolverWrapper.java58
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidateWSDLPlugin.java307
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/Validator.java155
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLDelegatingValidator.java31
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidationMessages.java32
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidator.java52
-rw-r--r--bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/wsdlvalidation.properties14
11 files changed, 0 insertions, 884 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseLogger.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseLogger.java
deleted file mode 100644
index 6d82f4af5..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseLogger.java
+++ /dev/null
@@ -1,53 +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.wsdl.validation.internal.eclipse;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.wsdl.validation.internal.logging.ILogger;
-
-/**
- * A logger that will log to the log file in the Eclipse metadata directory.
- */
-public class EclipseLogger implements ILogger
-{
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.validation.internal.logging.ILogger#log(java.lang.String, int)
- */
- public void log(String message, int severity)
- {
- log(message, severity, null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.validation.internal.logging.ILogger#log(java.lang.String, int, java.lang.Throwable)
- */
- public void log(String message, int severity, Throwable throwable)
- {
- // Don't log verbose information in the Eclipse log.
- if(severity == ILogger.SEV_VERBOSE)
- {
- return;
- }
- int status = IStatus.INFO;
- if(severity == ILogger.SEV_WARNING)
- {
- status = IStatus.WARNING;
- }
- else if(severity == ILogger.SEV_ERROR)
- {
- status = IStatus.ERROR;
- }
- ValidateWSDLPlugin.getInstance().getLog().log(new Status(status, ValidateWSDLPlugin.getInstance().getBundle().getSymbolicName(), IStatus.OK, message, throwable));
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDL11ValidatorDelegate.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDL11ValidatorDelegate.java
deleted file mode 100644
index a9ab6b7ef..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDL11ValidatorDelegate.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wsdl.validation.internal.eclipse;
-
-import org.eclipse.wst.wsdl.validation.internal.logging.ILogger;
-import org.eclipse.wst.wsdl.validation.internal.logging.LoggerFactory;
-import org.eclipse.wst.wsdl.validation.internal.wsdl11.IWSDL11Validator;
-import org.eclipse.wst.wsdl.validation.internal.wsdl11.WSDL11ValidatorDelegate;
-import org.osgi.framework.Bundle;
-
-public class EclipseWSDL11ValidatorDelegate extends WSDL11ValidatorDelegate
-{
- private String validatorClassname = null;
- private Bundle bundle = null;
-
- /**
- * Create a delegate for a validator by its class name and
- * a class loader to load the validator.
- *
- * @param validatorClassname The name of the validator class.
- * @param bundle The bundle to use to load the validator.
- */
- public EclipseWSDL11ValidatorDelegate(String validatorClassname, Bundle bundle)
- {
- this.validatorClassname = validatorClassname;
- this.bundle = bundle;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.WSDL11ValidatorDelegate#loadValidator()
- */
- protected IWSDL11Validator loadValidator()
- {
- IWSDL11Validator validator = null;
- if(bundle != null)
- {
- try
- {
- Class validatorClass = bundle.loadClass(validatorClassname);
-
- validator = (IWSDL11Validator)validatorClass.newInstance();
-
- }
- catch (Throwable t)
- {
- LoggerFactory.getInstance().getLogger().log("Unable to load validator " + validatorClassname, ILogger.SEV_ERROR, t);
- }
- }
- return validator;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDLValidatorDelegate.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDLValidatorDelegate.java
deleted file mode 100644
index c3e181cb3..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/EclipseWSDLValidatorDelegate.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wsdl.validation.internal.eclipse;
-
-import org.eclipse.wst.wsdl.validation.internal.WSDLValidatorDelegate;
-import org.eclipse.wst.wsdl.validation.internal.IWSDLValidator;
-import org.eclipse.wst.wsdl.validation.internal.logging.ILogger;
-import org.eclipse.wst.wsdl.validation.internal.logging.LoggerFactory;
-import org.osgi.framework.Bundle;
-
-
-/**
- * A delegate holds a validator's information and can instantiate it
- * when requested to.
- */
-public class EclipseWSDLValidatorDelegate extends WSDLValidatorDelegate
-{
- private String validatorClassname = null;
- private Bundle bundle = null;
-
- /**
- * Create a delegate for a validator by its class name and
- * an OSGI bundle to load the validator.
- *
- * @param validatorClassname The name of the validator class.
- * @param bundle The OSGI bundle to use to load the validator.
- */
- public EclipseWSDLValidatorDelegate(String validatorClassname, Bundle bundle)
- {
- this.validatorClassname = validatorClassname;
- this.bundle = bundle;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.validation.internal.AbstractWSDLValidatorDelegate#loadValidator()
- */
- protected IWSDLValidator loadValidator()
- {
- IWSDLValidator validator = null;
- if(bundle != null)
- {
- try
- {
- Class validatorClass = bundle.loadClass(validatorClassname);
-
- validator = (IWSDLValidator)validatorClass.newInstance();
- }
- catch(Throwable t)
- {
- LoggerFactory.getInstance().getLogger().log("Unable to load validator " + validatorClassname, ILogger.SEV_ERROR, t);
- }
- }
- return validator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.wsdl.validation.internal.AbstractWSDLValidatorDelegate#getValidatorName()
- */
- public String getValidatorName()
- {
- return validatorClassname;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/InlineSchemaModelGrammarPoolImpl.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/InlineSchemaModelGrammarPoolImpl.java
deleted file mode 100644
index 2089bb7e8..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/InlineSchemaModelGrammarPoolImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wsdl.validation.internal.eclipse;
-
-import org.apache.xerces.util.XMLGrammarPoolImpl;
-import org.apache.xerces.xni.grammars.Grammar;
-import org.apache.xerces.xni.grammars.XMLGrammarDescription;
-
-/**
- * A grammar pool for inline schemas. This grammar pool restricts inline schemas
- * from being cached.
- */
-public class InlineSchemaModelGrammarPoolImpl extends XMLGrammarPoolImpl
-{
- public void putGrammar(Grammar grammar)
- {
- if (grammar == null)
- return;
- // we overide this method to perform 'selective' caching of schemas
- XMLGrammarDescription description = grammar.getGrammarDescription();
- if (!fPoolIsLocked && !containsGrammar(grammar.getGrammarDescription()))
- {
- // in order to avoid caching the inline schemas
- // we ensure the literal system id does not end with wsdl
- // before we attempt to 'put' the grammar
- String litSysId = description.getLiteralSystemId();
- String basSysId = description.getBaseSystemId();
- if (litSysId != null && litSysId.endsWith("xsd")
- && basSysId != null && basSysId.endsWith("wsdl"))
- {
- /*
- * System.out.println("putGramamr : " +
- * schemaDescription.getNamespace() + ", " +
- * schemaDescription.getExpandedSystemId() + ", " +
- * schemaDescription.getBaseSystemId());
- */
- super.putGrammar(grammar);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/URIResolverWrapper.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/URIResolverWrapper.java
deleted file mode 100644
index c6b4830b6..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/URIResolverWrapper.java
+++ /dev/null
@@ -1,58 +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.wsdl.validation.internal.eclipse;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.wsdl.validation.internal.resolver.IExtensibleURIResolver;
-import org.eclipse.wst.wsdl.validation.internal.resolver.IURIResolutionResult;
-
-/**
- * An wrapper URI resolver that wraps the Web Standard Tools URI resolver
- * in a WSDL validator URI resolver.
- */
-public class URIResolverWrapper implements IExtensibleURIResolver
-{
- /**
- * Constructor.
- */
- public URIResolverWrapper()
- {
- }
-
- /**
- * @see org.eclipse.wst.wsdl.validation.internal.resolver.IExtensibleURIResolver#resolve(java.lang.String, java.lang.String, java.lang.String, org.eclipse.wst.wsdl.validation.internal.resolver.IURIResolutionResult)
- */
- public void resolve(String baseLocation, String publicId, String systemId, IURIResolutionResult result)
- {
- URIResolver resolver = URIResolverPlugin.createResolver();
- String location = null;
- if (publicId != null || systemId != null)
- {
- location = resolver.resolve(baseLocation, publicId, systemId);
- }
-
- if (location != null)
- {
- result.setLogicalLocation(location);
- String physical = resolver.resolvePhysicalLocation(baseLocation, publicId, location);
- if(physical != null)
- {
- result.setPhysicalLocation(physical);
- }
- else
- {
- result.setPhysicalLocation(location);
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidateWSDLPlugin.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidateWSDLPlugin.java
deleted file mode 100644
index dfcd1cdf1..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidateWSDLPlugin.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.wsdl.validation.internal.eclipse;
-
-import java.io.IOException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.wsdl.validation.internal.Constants;
-import org.eclipse.wst.wsdl.validation.internal.logging.LoggerFactory;
-import org.eclipse.wst.wsdl.validation.internal.wsdl11.WSDL11ValidatorDelegate;
-import org.eclipse.wst.wsdl.validation.internal.xml.XMLCatalog;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class required for eclipse.
- */
-public class ValidateWSDLPlugin extends Plugin
-{
- protected final String PROPERTIES_FILE = "validatewsdlui";
- protected static ValidateWSDLPlugin instance;
- protected ResourceBundle resourcebundle = null;
- protected ResourceBundle wsdlValidatorResourceBundle = null;
-
- /**
- * Constructor.
- */
- public ValidateWSDLPlugin()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- instance = this;
- wsdlValidatorResourceBundle = ResourceBundle.getBundle(Constants.WSDL_VALIDATOR_PROPERTIES_FILE);
- resourcebundle = ResourceBundle.getBundle(PROPERTIES_FILE);
-
- LoggerFactory.getInstance().setLogger(new EclipseLogger());
-
- new WSDLValidatorPluginRegistryReader(
- "extvalidator",
- "extvalidator",
- WSDLValidatorPluginRegistryReader.EXT_VALIDATOR)
- .readRegistry();
-
- // register any WSDL 1.1 validators defined
- new WSDL11ValidatorPluginRegistryReader("wsdl11validator", "validator").readRegistry();
- }
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception
- {
- super.stop(context);
- XMLCatalog.reset();
- }
-
- /**
- * Return the instance of this plugin object.
- *
- * @return the instance of this plugin object
- */
- public static ValidateWSDLPlugin getInstance()
- {
- return instance;
- }
-
- /**
- * Get the install URL of this plugin.
- *
- * @return the install url of this plugin
- */
- public String getInstallURL()
- {
- try
- {
- return FileLocator.resolve(getBundle().getEntry("/")).getFile();
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- /*************************************************************
- * ResourceBundle helper methods
- *
- *************************************************************/
- /**
- * Returns the resource bundle for this plugin.
- *
- * @return the resource bundle for this plugin
- */
- public ResourceBundle getResourceBundle()
- {
- return resourcebundle;
- }
-
- /**
- * Returns the resource bundle for the WSDL validator.
- *
- * @return the resource bundle for the WSDL validator
- */
- public ResourceBundle getWSDLValidatorResourceBundle()
- {
- return wsdlValidatorResourceBundle;
- }
-
- /**
- * Returns the string for the given id.
- *
- * @param stringID - the id for the string
- * @return the string for the given id
- */
- public String getString(String stringID)
- {
- return getResourceBundle().getString(stringID);
- }
-}
-
-/**
- * This class reads the plugin manifests and registers each WSDLExtensionValidator
- */
-class WSDLValidatorPluginRegistryReader
-{
- protected static final String PLUGIN_ID = "org.eclipse.wst.wsdl.validation";
- protected static final String ATT_CLASS = "class";
- protected static final String ATT_NAMESPACE = "namespace";
- protected static final int WSDL_VALIDATOR = 0;
- protected static final int EXT_VALIDATOR = 1;
- protected String extensionPointId;
- protected String tagName;
- protected int validatorType;
-
- /**
- *
- */
- public WSDLValidatorPluginRegistryReader(String extensionPointId, String tagName, int validatorType)
- {
- this.extensionPointId = extensionPointId;
- this.tagName = tagName;
- this.validatorType = validatorType;
- }
-
- /**
- * read from plugin registry and parse it.
- */
- public void readRegistry()
- {
- IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, extensionPointId);
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
- }
-
- /**
- * readElement() - parse and deal with an extension like:
- *
- * <extension point="org.eclipse.validate.wsdl.WSDLExtensionValidator"
- * id="soapValidator"
- * name="SOAP Validator">>
- * <validator>
- * <run class=" org.eclipse.validate.wsdl.soap.SOAPValidator"/>
- * </validator>
- * <attribute name="namespace" value="http://schemas.xmlsoap.org/wsdl/soap/"/>
- * </extension>
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(tagName))
- {
- String validatorClass = element.getAttribute(ATT_CLASS);
- String namespace = element.getAttribute(ATT_NAMESPACE);
-
- if (validatorClass != null)
- {
- try
- {
- // ClassLoader pluginLoader =
- // element.getDeclaringExtension().getDeclaringPluginDescriptor().getPlugin().getClass().getClassLoader();
- // modified to resolve certain situations where the plugin has not been initialized
-
- Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName());
-
- if (validatorType == EXT_VALIDATOR)
- {
- EclipseWSDLValidatorDelegate delegate = new EclipseWSDLValidatorDelegate(validatorClass, pluginBundle);
- WSDLValidator.getInstance().registerWSDLExtensionValidator(namespace, delegate);
- }
- }
- catch (Exception e)
- {
- }
- }
- }
- }
-}
-
-/**
- * Read WSDl 1.1 extension validators.
- *
- * <extension
- * point="com.ibm.etools.validation.validator"
- * id="wsdlValidator"
- * name="%_UI_WSDL_VALIDATOR">
- * <wsdl11validator
- * namespace="http://schemas.xmlsoap.org/wsdl/soap/"
- * class="org.eclipse.wsdl.validate.soap.wsdl11.SOAPValidator"
- * resourcebundle="validatewsdlsoap"/>
- * </extension>
- *
- */
-class WSDL11ValidatorPluginRegistryReader
-{
- protected static final String PLUGIN_ID = "org.eclipse.wst.wsdl.validation";
- protected static final String ATT_CLASS = "class";
- protected static final String ATT_NAMESPACE = "namespace";
- protected String extensionPointId;
- protected String tagName;
-
- /**
- * Constructor.
- *
- * @param extensionPointId - the id of the extension point
- * @param tagName - the tag name of the extension point
- */
- public WSDL11ValidatorPluginRegistryReader(String extensionPointId, String tagName)
- {
- this.extensionPointId = extensionPointId;
- this.tagName = tagName;
- }
-
- /**
- * Read from plugin registry and handle the configuration elements that match
- * the spedified elements.
- */
- public void readRegistry()
- {
- IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, extensionPointId);
- if (point != null)
- {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++)
- {
- readElement(elements[i]);
- }
- }
- }
-
- /**
- * Parse and deal with the extension points.
- *
- * @param element The extension point element.
- */
- protected void readElement(IConfigurationElement element)
- {
- if (element.getName().equals(tagName))
- {
- String validatorClass = element.getAttribute(ATT_CLASS);
- String namespace = element.getAttribute(ATT_NAMESPACE);
-
- if (validatorClass != null && namespace != null)
- {
- try
- {
- Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName());
- WSDL11ValidatorDelegate delegate = new EclipseWSDL11ValidatorDelegate(validatorClass, pluginBundle);
- WSDLValidator.getInstance().registerWSDL11Validator(namespace, delegate);
- }
- catch (Exception e)
- {
- }
- }
- }
- }
-}
-
-
-
-
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/Validator.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/Validator.java
deleted file mode 100644
index 99fdeea77..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/Validator.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.eclipse.wst.wsdl.validation.internal.eclipse;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.xerces.util.XMLGrammarPoolImpl;
-import org.apache.xerces.xni.grammars.XMLGrammarPool;
-import org.eclipse.wst.wsdl.validation.internal.Constants;
-import org.eclipse.wst.wsdl.validation.internal.IValidationMessage;
-import org.eclipse.wst.wsdl.validation.internal.IValidationReport;
-import org.eclipse.wst.wsdl.validation.internal.WSDLValidationConfiguration;
-import org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-
-/**
- * A WSDL validator to contribute to the WTP validation framework.
- */
-public class Validator extends AbstractNestedValidator
-{
- protected HashMap xsdGrammarPools = new HashMap();
- protected HashMap xmlGrammarPools = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorName()
- */
- protected String getValidatorName()
- {
- return WSDLValidationMessages.Message_WSDL_validation_message_ui;
- }
-
- /**
- * Create and configure the two grammar pools for this WSDL validation context.
- *
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#setupValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- protected void setupValidation(NestedValidatorContext context)
- {
- super.setupValidation(context);
-
- XMLGrammarPool xsdGrammarPool = new InlineSchemaModelGrammarPoolImpl();
- XMLGrammarPool xmlGrammarPool = new XMLGrammarPoolImpl();
-
- xsdGrammarPools.put(context, xsdGrammarPool);
- xmlGrammarPools.put(context, xmlGrammarPool);
- }
-
- /**
- * Remove two grammar pools for this WSDL validation context.
- *
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#teardownValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- protected void teardownValidation(NestedValidatorContext context)
- {
- XMLGrammarPool xsdGrammarPool = (XMLGrammarPool)xsdGrammarPools.remove(context);
- if(xsdGrammarPool != null)
- xsdGrammarPool.clear();
- XMLGrammarPool xmlGrammarPool = (XMLGrammarPool)xmlGrammarPools.remove(context);
- if(xmlGrammarPool != null)
- xmlGrammarPool.clear();
-
- super.teardownValidation(context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#validate(java.lang.String, java.io.InputStream, org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext)
- */
- public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context)
- {
- XMLGrammarPool xsdGrammarPool = (XMLGrammarPool)xsdGrammarPools.get(context);
- XMLGrammarPool xmlGrammarPool = (XMLGrammarPool)xmlGrammarPools.get(context);
-
- WSDLValidator validator = WSDLValidator.getInstance();
-
- WSDLValidationConfiguration configuration = new WSDLValidationConfiguration();
- configuration.setProperty(Constants.XMLSCHEMA_CACHE_ATTRIBUTE, xsdGrammarPool);
- configuration.setProperty(Constants.XML_CACHE_ATTRIBUTE, xmlGrammarPool);
-
- IValidationReport valreport = null;
- if (inputstream != null)
- {
- valreport = validator.validate(uri, inputstream, configuration);
- }
- else
- {
- valreport = validator.validate(uri, null, configuration);
- }
-
- return convertReportToXMLReport(valreport);
- }
-
- /**
- * Convert a WSDL IValidationReport to an XML Validation Report.
- *
- * @param report
- * The WSDL IValidationReport to convert.
- * @return
- * An XML Validation Report representing the information contained in the IValidationReport.
- */
- protected ValidationReport convertReportToXMLReport(IValidationReport report)
- {
- ValidationInfo convertedReport = new ValidationInfo(report.getFileURI());
- IValidationMessage[] messages = report.getValidationMessages();
- int numMessages = messages.length;
- for(int i = 0; i < numMessages; i++)
- {
- convertMessage(messages[i], convertedReport);
- }
-
- return convertedReport;
- }
-
- /**
- * Convert a WSDL IValidationMessage by reporting it in the ValidationInfo object.
- *
- * @param message
- * The IValidationMessage to convert.
- * @param convertedReport
- * The ValidationInfo object represting the converted report.
- */
- protected void convertMessage(IValidationMessage message, ValidationInfo convertedReport)
- {
- List nestedMessages = message.getNestedMessages();
- if(nestedMessages != null && nestedMessages.size() > 0)
- {
- Iterator messageIter = nestedMessages.iterator();
- while(messageIter.hasNext())
- {
- convertMessage((IValidationMessage)messageIter.next(), convertedReport);
- }
- }
- else
- {
- if(message.getSeverity() == IValidationMessage.SEV_WARNING)
- convertedReport.addWarning(message.getMessage(), message.getLine(), message.getColumn(), message.getURI());
- else
- convertedReport.addError(message.getMessage(), message.getLine(), message.getColumn(), message.getURI());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.xml.core.internal.validation.core.AbstractNestedValidator#getValidatorID()
- */
- protected String getValidatorID()
- {
- // Because this class is used as a delegate, return the id of the validator
- // which delegates to this class.
-
- return WSDLDelegatingValidator.class.getName(); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLDelegatingValidator.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLDelegatingValidator.java
deleted file mode 100644
index 1d20d4c70..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLDelegatingValidator.java
+++ /dev/null
@@ -1,31 +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.wsdl.validation.internal.eclipse;
-
-import org.eclipse.wst.validation.internal.delegates.DelegatingValidator;
-
-/**
- * This class provides a unique name (class name) which the validation framework
- * will use to identify the WSDL validator. The actual delegating validator
- * functionality is provided by the base class. The actual validation
- * functionality is provided by the delegates registered with this class as
- * their target.
- */
-public class WSDLDelegatingValidator extends DelegatingValidator
-{
- /**
- * Default constructor.
- */
- public WSDLDelegatingValidator()
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidationMessages.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidationMessages.java
deleted file mode 100644
index 38ac09bf3..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidationMessages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- */
-package org.eclipse.wst.wsdl.validation.internal.eclipse;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by WSDL Validation
- */
-public class WSDLValidationMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.wsdl.validation.internal.eclipse.wsdlvalidation";//$NON-NLS-1$
-
- public static String Message_WSDL_validation_message_ui;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, WSDLValidationMessages.class);
- }
-
- private WSDLValidationMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidator.java b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidator.java
deleted file mode 100644
index 516c555e7..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidator.java
+++ /dev/null
@@ -1,52 +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.wsdl.validation.internal.eclipse;
-
-
-
-/**
- * An Eclipse WSDL validator. This validator is the default validator
- * used in the validation framework. There is only a single instance of
- * this validator. When created, this validator registers all extension
- * URI resolvers.
- */
-public class WSDLValidator extends org.eclipse.wst.wsdl.validation.internal.WSDLValidator
-{
- private static WSDLValidator instance = null;
-
- /**
- * The constructor registers all of the URI resolvers defined via the
- * WSDL URI resolver extension point with the WSDL validator.
- *
- */
- protected WSDLValidator()
- {
- super();
- URIResolverWrapper resolver = new URIResolverWrapper();
- addURIResolver(resolver);
- }
-
- /**
- * Get the one and only instance of this Eclipse WSDL validator.
- *
- * @return The one and only instance of this Eclipse WSDL validator.
- */
- public static WSDLValidator getInstance()
- {
- if(instance == null)
- {
- instance = new WSDLValidator();
- }
- return instance;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/wsdlvalidation.properties b/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/wsdlvalidation.properties
deleted file mode 100644
index 3adb534a7..000000000
--- a/bundles/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/wsdlvalidation.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-!-- Constants for strings
-
-# validation strings
-Message_WSDL_validation_message_ui=WSDL Validator validating {0}

Back to the top