Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j')
-rw-r--r--bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLFactoryImpl.java52
-rw-r--r--bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLReaderImpl.java229
-rw-r--r--bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLWriterImpl.java138
3 files changed, 0 insertions, 419 deletions
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLFactoryImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLFactoryImpl.java
deleted file mode 100644
index b1bb1803c..000000000
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLFactoryImpl.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.internal.impl.wsdl4j;
-
-import javax.wsdl.Definition;
-import javax.wsdl.extensions.ExtensionRegistry;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.wsdl.xml.WSDLWriter;
-
-public final class WSDLFactoryImpl extends WSDLFactory
-{
-
- //public static WSDLFactory newInstance() throws WSDLException
- //{
- // return new WSDLFactoryImpl();
- //}
-
- public WSDLFactoryImpl()
- {
- }
-
- public Definition newDefinition()
- {
- return org.eclipse.wst.wsdl.internal.impl.WSDLFactoryImpl.eINSTANCE.createDefinition();
- }
-
- public ExtensionRegistry newPopulatedExtensionRegistry()
- {
- return null;
- }
-
- public WSDLReader newWSDLReader()
- {
- WSDLReader reader = new WSDLReaderImpl();
- reader.setFactoryImplName(getClass().getName());
- return reader;
- }
-
- public WSDLWriter newWSDLWriter()
- {
- return new WSDLWriterImpl();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLReaderImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLReaderImpl.java
deleted file mode 100644
index 3838d790d..000000000
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLReaderImpl.java
+++ /dev/null
@@ -1,229 +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.internal.impl.wsdl4j;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensionRegistry;
-import javax.wsdl.xml.WSDLLocator;
-import javax.wsdl.xml.WSDLReader;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
-import org.eclipse.wst.wsdl.util.WSDLResourceImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-
-
-public final class WSDLReaderImpl implements WSDLReader
-{
- private String factoryImplName;
- private ExtensionRegistry extReg;
-
- public ExtensionRegistry getExtensionRegistry()
- {
- return extReg;
- }
-
- public void setExtensionRegistry(ExtensionRegistry extReg)
- {
- this.extReg = extReg;
- }
-
- public String getFactoryImplName()
- {
- return factoryImplName;
- }
-
- public void setFactoryImplName(String factoryImplName) throws UnsupportedOperationException
- {
- this.factoryImplName = factoryImplName;
- }
-
-
- public boolean getFeature(String name) throws IllegalArgumentException
- {
- return false;
- }
-
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- throw new IllegalArgumentException("Not Implemented");
- }
-
- /**
- * Read the WSDL document accessible via the specified
- * URI into a WSDL definition.
- *
- * @param wsdlURI a URI (can be a filename or URL) pointing to a
- * WSDL XML definition.
- * @return the definition.
- */
- public Definition readWSDL(String wsdlURI) throws WSDLException
- {
- URI uri;
- if (hasProtocol(wsdlURI))
- uri = URI.createURI(wsdlURI);
- else
- uri = URI.createFileURI(wsdlURI);
-
- // Create a resource set, create a wsdl resource, and load the main wsdl file into it.
-
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
-
- WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl)resourceSet.createResource(URI.createURI("*.wsdl"));
- wsdlMainResource.setURI(uri);
-
- try
- {
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(uri);
- wsdlMainResource.load(inputStream, resourceSet.getLoadOptions());
- //wsdlMainResource.load(resourceSet.getLoadOptions());
- }
- catch (IOException e)
- {
- throw new WSDLException(WSDLException.INVALID_WSDL,"WSDL URI: "+wsdlURI,e);
- }
-
- // Return the definitions of the main resource.
- return wsdlMainResource.getDefinition();
- }
-
- private boolean hasProtocol(String uri)
- {
- boolean result = false;
- if (uri != null)
- {
- int index = uri.indexOf(":");
- if (index != -1 && index > 2) // assume protocol with be length 3 so that the'C' in 'C:/' is not interpreted as a protocol
- {
- result = true;
- }
- }
- return result;
- }
-
- /**
- * Read the WSDL document accessible via the specified
- * URI into a WSDL definition.
- *
- * @param contextURI the context in which to resolve the
- * wsdlURI, if the wsdlURI is relative. Can be null, in which
- * case it will be ignored.
- * @param wsdlURI a URI (can be a filename or URL) pointing to a
- * WSDL XML definition.
- * @return the definition.
- */
- public Definition readWSDL(String contextURI, String wsdlURI) throws WSDLException
- {
- throw new WSDLException(WSDLException.OTHER_ERROR,"Not Implemented");
- }
-
- /**
- * Read the specified <wsdl:definitions> element into a WSDL
- * definition.
- *
- * @param documentBaseURI the document base URI of the WSDL definition
- * described by the element. Will be set as the documentBaseURI
- * of the returned Definition. Can be null, in which case it
- * will be ignored.
- * @param definitionsElement the <wsdl:definitions> element
- * @return the definition described by the element.
- */
- public Definition readWSDL(String documentBaseURI, Element definitionsElement)
- throws WSDLException
- {
- throw new WSDLException(WSDLException.OTHER_ERROR,"Not Implemented");
- }
-
- /**
- * Read the specified WSDL document into a WSDL definition.
- *
- * @param documentBaseURI the document base URI of the WSDL definition
- * described by the document. Will be set as the documentBaseURI
- * of the returned Definition. Can be null, in which case it
- * will be ignored.
- * @param wsdlDocument the WSDL document, an XML
- * document obeying the WSDL schema.
- * @return the definition described in the document.
- */
- public Definition readWSDL(String documentBaseURI, Document wsdlDocument)
- throws WSDLException
- {
- throw new WSDLException(WSDLException.OTHER_ERROR,"Not Implemented");
- }
-
- /**
- * Read a WSDL document into a WSDL definition.
- *
- * @param documentBaseURI the document base URI of the WSDL definition
- * described by the document. Will be set as the documentBaseURI
- * of the returned Definition. Can be null, in which case it
- * will be ignored.
- * @param inputSource an InputSource pointing to the
- * WSDL document, an XML document obeying the WSDL schema.
- * @return the definition described in the document pointed to
- * by the InputSource.
- */
- public Definition readWSDL(String documentBaseURI, InputSource inputSource)
- throws WSDLException
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
- WSDLResourceImpl wsdlMainResource = (WSDLResourceImpl)resourceSet.createResource(URI.createURI("*.wsdl"));
-
- try
- {
- if (documentBaseURI != null)
- wsdlMainResource.setURI(createURI(documentBaseURI));
- resourceSet.getLoadOptions().put(WSDLResourceImpl.CONTINUE_ON_LOAD_ERROR,new Boolean(false));
- wsdlMainResource.load(inputSource.getByteStream(), resourceSet.getLoadOptions());
- }
- catch (IOException ioe)
- {
- throw new WSDLException(WSDLException.INVALID_WSDL, "", ioe);
- }
-
- Definition definition = wsdlMainResource.getDefinition();
- if (definition != null)
- definition.setDocumentBaseURI(documentBaseURI);
-
- return definition;
- }
-
- /**
- * Read a WSDL document into a WSDL definition.
- *
- * @param locator A WSDLLocator object used to provide InputSources
- * pointing to the wsdl file.
- * @return the definition described in the document
- */
- public Definition readWSDL(WSDLLocator locator) throws WSDLException
- {
- throw new WSDLException(WSDLException.OTHER_ERROR,"Not Implemented");
- }
-
- private URI createURI(String uriString)
- {
- if (hasProtocol(uriString))
- return URI.createURI(uriString);
- else
- return URI.createFileURI(uriString);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLWriterImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLWriterImpl.java
deleted file mode 100644
index 9baf1525c..000000000
--- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/wsdl4j/WSDLWriterImpl.java
+++ /dev/null
@@ -1,138 +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.internal.impl.wsdl4j;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.wst.wsdl.internal.impl.DefinitionImpl;
-import org.w3c.dom.Document;
-
-
-public final class WSDLWriterImpl implements WSDLWriter
-{
- /**
- * Sets the specified feature to the specified value.
- * <p>
- * There are no minimum features that must be supported.
- * <p>
- * All feature names must be fully-qualified, Java package style. All
- * names starting with javax.wsdl. are reserved for features defined
- * by the JWSDL specification. It is recommended that implementation-
- * specific features be fully-qualified to match the package name
- * of that implementation. For example: com.abc.featureName
- *
- * @param name the name of the feature to be set.
- * @param value the value to set the feature to.
- * @throws IllegalArgumentException if the feature name is not recognized.
- * @see #getFeature(String)
- */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- throw new IllegalArgumentException("Not Implemented");
- }
-
- /**
- * Gets the value of the specified feature.
- *
- * @param name the name of the feature to get the value of.
- * @throws IllegalArgumentException if the feature name is not recognized.
- * @see #setFeature(String, boolean)
- */
- public boolean getFeature(String name) throws IllegalArgumentException
- {
- throw new IllegalArgumentException("Not Implemented");
- }
-
- /**
- * Return a document generated from the specified WSDL model.
- */
- public Document getDocument(Definition wsdlDef) throws WSDLException
- {
- return ((DefinitionImpl)wsdlDef).getDocument();
- }
-
- /**
- * Write the specified WSDL definition to the specified Writer.
- *
- * @param wsdlDef the WSDL definition to be written.
- * @param sink the Writer to write the xml to.
- */
- public void writeWSDL(Definition wsdlDef, Writer sink) throws WSDLException
- {
- String encoding = null;
- try
- {
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- Transformer transformer = transformerFactory.newTransformer();
-
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
-
- // Unless a width is set, there will be only line breaks but no indentation.
- // The IBM JDK and the Sun JDK don't agree on the property name,
- // so we set them both.
- //
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- if (encoding != null)
- {
- transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
- }
-
- Document document = ((DefinitionImpl)wsdlDef).getDocument();
- if (document == null)
- {
- ((DefinitionImpl)wsdlDef).updateElement(true);
- document = ((DefinitionImpl)wsdlDef).getDocument();
- }
-
- transformer.transform(new DOMSource(document), new StreamResult(sink));
- }
- catch (TransformerException exception)
- {
- throw new WSDLException(WSDLException.OTHER_ERROR,"Failed to save Definitions.",exception);
- }
-
- }
-
- /**
- * Write the specified WSDL definition to the specified OutputStream.
- *
- * @param wsdlDef the WSDL definition to be written.
- * @param sink the OutputStream to write the xml to.
- */
- public void writeWSDL(Definition wsdlDef, OutputStream sink) throws WSDLException
- {
-
- Resource resource = ((DefinitionImpl)wsdlDef).eResource();
- try
- {
- resource.save(sink,null);
- }
- catch (IOException e)
- {
- throw new WSDLException(WSDLException.OTHER_ERROR,"Failed to save Definitions.",e);
- }
- }
-}

Back to the top