diff options
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal')
48 files changed, 0 insertions, 21729 deletions
diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryDescriptor.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryDescriptor.java deleted file mode 100644 index 64a2fc7af..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryDescriptor.java +++ /dev/null @@ -1,54 +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.internal.extensibility; - -import org.eclipse.wst.wsdl.util.ExtensibilityElementFactory; -import org.osgi.framework.Bundle; - -public class ExtensibilityElementFactoryDescriptor -{ - private final static String CLASS_LOADING_ERROR = "CLASS_LOADING_ERROR"; - - protected Bundle bundle; - protected String namespace; - protected String className; - protected Object factory; - - public ExtensibilityElementFactoryDescriptor(String className, String namespace, Bundle bundle) - { - this.bundle = bundle; - this.className = className; - this.namespace = namespace; - } - - public ExtensibilityElementFactory getExtensiblityElementFactory() - { - if (factory == null) - { - try - { - Class theClass = bundle.loadClass(className); - factory = (ExtensibilityElementFactory)theClass.newInstance(); - } - catch (Exception e) - { - factory = CLASS_LOADING_ERROR; - e.printStackTrace(); - } - } - return factory != CLASS_LOADING_ERROR ? (ExtensibilityElementFactory)factory : null; - } - - public void setExtensiblityElementFactory(ExtensibilityElementFactory factory) - { - this.factory = factory; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryRegistryImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryRegistryImpl.java deleted file mode 100644 index fbbc01408..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryRegistryImpl.java +++ /dev/null @@ -1,45 +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.extensibility; - -import java.util.HashMap; - -import org.eclipse.wst.wsdl.util.ExtensibilityElementFactory; -import org.eclipse.wst.wsdl.util.ExtensibilityElementFactoryRegistry; - - -public class ExtensibilityElementFactoryRegistryImpl implements ExtensibilityElementFactoryRegistry -{ - protected HashMap map = new HashMap(); - - public void put(String namespace, ExtensibilityElementFactoryDescriptor descriptor) - { - map.put(namespace, descriptor); - } - - public ExtensibilityElementFactory getExtensibilityElementFactory(String namespace) - { - ExtensibilityElementFactory result = null; - ExtensibilityElementFactoryDescriptor descriptor = (ExtensibilityElementFactoryDescriptor)map.get(namespace); - if (descriptor != null) - { - result = descriptor.getExtensiblityElementFactory(); - } - return result; - } - - public void registerFactory(String namespace, ExtensibilityElementFactory factory) - { - ExtensibilityElementFactoryDescriptor descriptor = new ExtensibilityElementFactoryDescriptor(null,namespace,null); - descriptor.setExtensiblityElementFactory(factory); - map.put(namespace,descriptor); - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryRegistryReader.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryRegistryReader.java deleted file mode 100644 index 57be9ad8e..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/extensibility/ExtensibilityElementFactoryRegistryReader.java +++ /dev/null @@ -1,81 +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.extensibility; -import java.net.URL; - -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.wst.wsdl.WSDLPlugin; -import org.osgi.framework.Bundle; - - -public class ExtensibilityElementFactoryRegistryReader -{ - protected static final String PLUGIN_ID = WSDLPlugin.getPlugin().getSymbolicName(); - protected static final String EXTENSION_POINT_ID = "extensibilityElementFactories"; - protected static final String ELEMENT_NAME = "extensibilityElementFactory"; - protected static final String ATT_NAMESPACE = "namespace"; - protected static final String ATT_CLASS = "class"; - protected ExtensibilityElementFactoryRegistryImpl extensibilityElementFactoryRegistry; - - public ExtensibilityElementFactoryRegistryReader(ExtensibilityElementFactoryRegistryImpl extensibilityElementFactoryRegistry) - { - this.extensibilityElementFactoryRegistry = extensibilityElementFactoryRegistry; - } - - /** - * read from plugin registry and parse it. - */ - public void readRegistry() - { - IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry(); - IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID); - if (point != null) - { - IConfigurationElement[] elements = point.getConfigurationElements(); - for (int i = 0; i < elements.length; i++) - { - readElement(elements[i]); - } - } - } - - public String resolve(URL platformURL, String relativePath) throws Exception - { - URL resolvedURL = FileLocator.resolve(platformURL); - return resolvedURL.toString() + relativePath; - } - - protected void readElement(IConfigurationElement element) - { - if (element.getName().equals(ELEMENT_NAME)) - { - try - { - IConfigurationElement childElement = (IConfigurationElement) element; - String namespace = childElement.getAttribute(ATT_NAMESPACE); - if (namespace != null) - { - Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName()); - String className = childElement.getAttribute(ATT_CLASS); - ExtensibilityElementFactoryDescriptor descriptor = new ExtensibilityElementFactoryDescriptor(className,namespace,pluginBundle); - extensibilityElementFactoryRegistry.put(namespace, descriptor); - } - } - catch (Exception e) - { - } - } - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/BaseGenerator.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/BaseGenerator.java deleted file mode 100644 index cf9345f3b..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/BaseGenerator.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator; - -import org.eclipse.wst.wsdl.Definition; - -public abstract class BaseGenerator { - private String name; - private String refName; - private boolean overwrite; - protected Definition definition; - protected ContentGenerator contentGenerator; - - - public void setContentGenerator(ContentGenerator generator) { - contentGenerator = generator; - } - - public ContentGenerator getContentGenerator() { - return contentGenerator; - } - - public void setOverwrite(boolean overwrite) { - this.overwrite = overwrite; - } - - public boolean getOverwrite() { - return overwrite; - } - - public void setName(String name) { - this.name = name; - } - - public void setRefName(String refName) { - this.refName = refName; - } - - public String getName() { - return name; - } - - public String getRefName() { - return refName; - } - - public Definition getDefinition() { - return definition; - } - - public String getProtocol() { - if (contentGenerator != null) { - return contentGenerator.getProtocol(); - } - - return null; - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/BindingGenerator.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/BindingGenerator.java deleted file mode 100644 index 2ba499ce3..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/BindingGenerator.java +++ /dev/null @@ -1,617 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.ExtensibleElement; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.internal.generator.extension.ContentGeneratorExtensionFactoryRegistry; - -/* - * Class used to generate the Binding and it's content. We look in the registry for - * appropriate ContentGenerator classes based on the existing Binding Content's namespace. - * Alternatively, users can pass in a namespace through the constructor to specify which - * namespace to use when searching the registry. - * - * The ContentGenerator may also be set manually by calling - * setContentGenerator(ContentGenerator). - */ -public class BindingGenerator extends BaseGenerator { - private WSDLFactory factory = WSDLFactory.eINSTANCE; - private Binding binding; - - /* - * When the constructor is used, automatically attempt to retrieve a proper - * ContentGenerator based on the Binding given. The ContentGenerator may - * be replaced by calling setContentGenerator(ContentGenerator). - */ - public BindingGenerator(Definition definition, Binding binding) { - this.definition = definition; - this.binding = binding; - contentGenerator = getContentGenerator(binding); - } - - /* - * When the constructor is used, automatically attempt to retrieve a proper - * ContentGenerator based on the namespace given. The ContentGenerator may - * be replaced by calling setContentGenerator(ContentGenerator). - */ - public BindingGenerator(Definition definition, Binding binding, String namespace) { - this.definition = definition; - this.binding = binding; - contentGenerator = getContentGenerator(namespace); - } - - public static ContentGenerator getContentGenerator(Binding binding) { - if (binding == null) { - return null; - } - /****************************************************** - * Find the regeistered Content Generator for the Binding - ******************************************************/ - // Get BindingContent namespace - String namespace = null; - List eeList = binding.getEExtensibilityElements(); - if (eeList.size() > 0) { - ExtensibilityElement ee = (ExtensibilityElement) eeList.get(0); - // TODO: QName qName = ee.getElementType(); go get the namespace instead? - namespace = ee.getElement().getNamespaceURI(); - return getContentGenerator(namespace); - } - - return null; - } - - public static ContentGenerator getContentGenerator(String namespace) { - ContentGenerator contentGen = null; - if (namespace != null) { - ContentGeneratorExtensionFactoryRegistry factoryRegistry = ContentGeneratorExtensionFactoryRegistry.getInstance(); - contentGen = factoryRegistry.getGeneratorClassFromNamespace(namespace); - } - - return contentGen; - } - - private Binding createEmptyBinding(String localName) { - Binding newBinding = WSDLFactory.eINSTANCE.createBinding(); - newBinding.setQName(new QName(definition.getTargetNamespace(),localName)); - newBinding.setEnclosingDefinition(definition); - definition.addBinding(newBinding); - - return newBinding; - } - - /* - * TODO: Scenario: - * 1)overwrite == false - * 2)BindingOperation with 1 input - * 3)Corresponding Operation (with same name) with 1 input and 1 output - * If we generate with overwrite == false, nothing is done. Thus, an - * output is not generated on the BindingOperation. This is because we - * search for existing Elements only at the level of BindingOperations. - * For example, if there is a corresponding BindingOperation with the same - * name as our Operation, leave it alone.... but since there is already - * a BindingOperation with the same name, we don't create a new BindingOperation. - * - * The correct implementation is reduce this granularity to the MessageReference - * level. The code is almost there except for how we generate the Binding element - * content. Look at BindingGenrator.generateBindingOperation() and - * SOAPContentGenerator.java and it's content generation method - * for a good place to start. - * - * For wtp RC1, We shall only look at the Operation level (as we do in the previous - * version). - */ - public Binding generateBinding() { - try { - // If Binding is null (No Binding was passed into the constructor), we create an empty Binding first. - if (binding == null) { - binding = createEmptyBinding(getName()); - } - if (getName() != null && !binding.getQName().getLocalPart().equals(getName())) { - binding.setQName(new QName(binding.getQName().getNamespaceURI(), getName())); - } - if (getRefName() != null) { - PortType portType = getPortType(); - binding.setEPortType(portType); - if (portType == null) { - //The model doesn't reconile with it's Element properly when we're setting a null for it's PortType - binding.getElement().setAttribute("type", ""); - } - } - - List bindingOperations = binding.getEBindingOperations(); - PortType portType = binding.getEPortType(); - - if (!getOverwrite()) { - // Don't Overwrite - if (portType == null) { - return binding; - } - else { - addRequiredNamespaces(binding); - List operations = portType.getOperations(); - - /******************************************************************************* - * Determine which Operations require new a new corresponding BindingOperations - *******************************************************************************/ - List newBindingOpsNeeded = new ArrayList(); - for (int index = 0; index < operations.size(); index++) { - Operation operation = (Operation) operations.get(index); - - boolean foundMatch = false; - Iterator bindingOperationsIt = bindingOperations.iterator(); - while (bindingOperationsIt.hasNext()) { - BindingOperation bindingOperation = (BindingOperation) bindingOperationsIt.next(); - - if (namesEqual(bindingOperation.getName(), operation.getName())) { - foundMatch = true; - break; - } - } - - if (!foundMatch){ - newBindingOpsNeeded.add(operation); - } - } - // newBindingOpsNeeded is the List of Operations needing new corresponding - // BindingOperation's - List newBindingOps = createNewBindingOperations(newBindingOpsNeeded); - - // Generate the contents of the new BindingOperation's - Iterator newBindingOpsIt = newBindingOps.iterator(); - while (newBindingOpsIt.hasNext()) { - BindingOperation newBindingOp = (BindingOperation) newBindingOpsIt.next(); - generateBindingOperation(newBindingOp); - generateBindingOperationContent(newBindingOp); - } - } - - generateBindingContent(binding); - } - else { - // Overwrite - if (portType == null) { - // We need to blow away everything under the Binding. No PortType associated with this Binding - bindingOperations.clear(); - return binding; - } - else { - addRequiredNamespaces(binding); - List operations = portType.getOperations(); - - /****************************************************** - * Compare the Operations - ******************************************************/ - // Remove any BindingOperations which are no longer used - for (int index = 0; index < bindingOperations.size(); index++) { - BindingOperation bindingOperation = (BindingOperation) bindingOperations.get(index); - - boolean foundMatch = false; - Iterator operationsIt = operations.iterator(); - while (operationsIt.hasNext()) { - Operation operation = (Operation) operationsIt.next(); - - if (namesEqual(bindingOperation.getName(), operation.getName())) { - foundMatch = true; - break; - } - } - - if (!foundMatch){ - // We need to remove this BindingFault from the bindingFaults List - bindingOperations.remove(index); - index--; - } - } - - // Remove any Operations which already exists in bindingOperations. What we - // have left are the Operations which needs newly created BindingOperations - List bindingOperationsNeeded = new ArrayList(); - for (int index = 0; index < operations.size(); index++) { - Operation operation = (Operation) operations.get(index); - - boolean foundMatch = false; - Iterator bindingOperationsIt = bindingOperations.iterator(); - while (bindingOperationsIt.hasNext()) { - BindingOperation bindingOperation = (BindingOperation) bindingOperationsIt.next(); - - if (namesEqual(bindingOperation.getName(), operation.getName())) { - foundMatch = true; - break; - } - } - - if (!foundMatch){ - // We need to remove this BindingFault from the bindingFaults List - bindingOperationsNeeded.add(operation); // Store the actual Operation - } - } - - // Create required BindingOperations - createNewBindingOperations(bindingOperationsNeeded); - - /****************************************************** - * Process the contents of the Operations - ******************************************************/ - Iterator bindingOperationsIt = binding.getEBindingOperations().iterator(); - while (bindingOperationsIt.hasNext()) { - generateBindingOperation((BindingOperation) bindingOperationsIt.next()); - } - - generateBindingContent(binding); - - return binding; - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - private List createNewBindingOperations(List operations) { - List newBindingOps = new ArrayList(); - - Iterator neededBindingOperationsIt = operations.iterator(); - while (neededBindingOperationsIt.hasNext()) { - Operation operation = (Operation) neededBindingOperationsIt.next(); - BindingOperation newBindingOperation = factory.createBindingOperation(); - newBindingOperation.setEOperation(operation); - newBindingOperation.setName(operation.getName()); - binding.addBindingOperation(newBindingOperation); - - newBindingOps.add(newBindingOperation); - } - - return newBindingOps; - } - - private void generateBindingOperation(BindingOperation bindingOperation) { - BindingInput bindingInput = bindingOperation.getEBindingInput(); - BindingOutput bindingOutput = bindingOperation.getEBindingOutput(); - List bindingFaults = bindingOperation.getEBindingFaults(); - - Operation operation = bindingOperation.getEOperation(); - Input input = operation.getEInput(); - Output output = operation.getEOutput(); - List faults = operation.getEFaults(); - - /****************************************************** - * Compare the Operation names - ******************************************************/ - if (!namesEqual(bindingOperation.getName(), operation.getName())) { - bindingOperation.setName(operation.getName()); - } - - - /****************************************************** - * Compare the Output - ******************************************************/ - if (output == null) { - bindingOperation.setBindingOutput(null); - } - else { - // Create BindingOutput if necessary - if (bindingOutput == null) { - BindingOutput newBindingOutput = factory.createBindingOutput(); - newBindingOutput.setEOutput(output); - newBindingOutput.setName(output.getName()); - bindingOperation.setBindingOutput(newBindingOutput); - } - else { - // Compare the Output names - if (!namesEqual(bindingOutput.getName(), output.getName())) { - bindingOutput.setName(output.getName()); - } - } - } - generateBindingOutputContent(bindingOperation.getEBindingOutput()); - - /****************************************************** - * Compare the Input - ******************************************************/ - if (input == null) { - bindingOperation.setBindingInput(null); - } - else { - // Create BindingInput if necessary - if (bindingInput == null) { - BindingInput newBindingInput = factory.createBindingInput(); - newBindingInput.setEInput(input); - newBindingInput.setName(input.getName()); - bindingOperation.setBindingInput(newBindingInput); - } - else { - // Compare the Input names - if (!namesEqual(bindingInput.getName(), input.getName())) { - bindingInput.setName(input.getName()); - } - } - } - generateBindingInputContent(bindingOperation.getEBindingInput()); - - - /****************************************************** - * Compare the Faults - ******************************************************/ - // Remove any BindingFaults which are no longer used - for (int index = 0; index < bindingFaults.size(); index++) { - BindingFault bindingFault = (BindingFault) bindingFaults.get(index); - - boolean foundMatch = false; - Iterator faultsIt = faults.iterator(); - while (faultsIt.hasNext()) { - Fault fault = (Fault) faultsIt.next(); - if (namesEqual(bindingFault.getName(), fault.getName())) { - foundMatch = true; - break; - } - } - - if (!foundMatch){ - // We need to remove this BindingFault from the bindingFaults List - bindingFaults.remove(index); - index--; - } - } - - // Remove any Faults which already exists in bindingFaults. What we - // have left are the Faults which needs newly created BindingFaults - List bindingFaultsNeeded = new ArrayList(); - for (int index = 0; index < faults.size(); index++) { - Fault fault = (Fault) faults.get(index); - - boolean foundMatch = false; - Iterator bindingFaultsIt = bindingFaults.iterator(); - while (bindingFaultsIt.hasNext()) { - BindingFault bindingFault = (BindingFault) bindingFaultsIt.next(); - if (namesEqual(bindingFault.getName(), fault.getName())) { - foundMatch = true; - break; - } - } - - if (!foundMatch){ - // We need to remove this BindingFault from the bindingFaults List - bindingFaultsNeeded.add(fault); - } - } - - // bindingFaultsNeeded contains the needed BindingFault's we need to create - Iterator neededBindingFaultsIt = bindingFaultsNeeded.iterator(); - while (neededBindingFaultsIt.hasNext()) { - Fault fault = (Fault) neededBindingFaultsIt.next(); - BindingFault newBindingFault = factory.createBindingFault(); - newBindingFault.setEFault(fault); - newBindingFault.setName(fault.getName()); - bindingOperation.addBindingFault(newBindingFault); - } - - // Create the contents for each BindingFault - Iterator faultContentIt = bindingOperation.getEBindingFaults().iterator(); - while (faultContentIt.hasNext()) { - BindingFault bindingFault = (BindingFault) faultContentIt.next(); - generateBindingFaultContent(bindingFault); - } - - generateBindingOperationContent(bindingOperation); - } - - private boolean namesEqual(String name1, String name2) { - boolean match = false; - - if (name1 != null ^ name2 != null) { - // one is null - match = false; - } - else if (name1 != null && name2 != null) { - // neither is null - match = name1.equals(name2); - } - else { - // both are null - match = true; - } - - return match; - } - - protected void generateBindingContent(Binding binding) { - if (contentGenerator != null) { - if (getOverwrite() || binding.getEExtensibilityElements().size() == 0) { - contentGenerator.generateBindingContent(binding, (PortType) binding.getEPortType()); - } - } - else { - removeExtensibilityElements(binding); - } - } - - protected void generateBindingOperationContent(BindingOperation bindingOperation) { - if (bindingOperation != null && contentGenerator != null) { - contentGenerator.generateBindingOperationContent(bindingOperation, bindingOperation.getEOperation()); - } - else { - removeExtensibilityElements(bindingOperation); - } - } - - protected void generateBindingInputContent(BindingInput bindingInput) { - if (bindingInput != null && contentGenerator != null) { - contentGenerator.generateBindingInputContent(bindingInput, bindingInput.getEInput()); - } - else { - removeExtensibilityElements(bindingInput); - } - } - - protected void generateBindingOutputContent(BindingOutput bindingOutput) { - if (bindingOutput != null && contentGenerator != null) { - contentGenerator.generateBindingOutputContent(bindingOutput, bindingOutput.getEOutput()); - } - else { - removeExtensibilityElements(bindingOutput); - } - } - - protected void generateBindingFaultContent(BindingFault bindingFault) { - if (bindingFault != null && contentGenerator != null) { - contentGenerator.generateBindingFaultContent(bindingFault, bindingFault.getEFault()); - } - else { - removeExtensibilityElements(bindingFault); - } - } - - private void removeExtensibilityElements(ExtensibleElement ee) { - if (ee != null) { - ee.getEExtensibilityElements().clear(); - } - } - - /* - * Generate Port Content for all Ports with a reference to the Binding - * which was passed in through the constructor (or a reference to the - * newly created Binding). - */ - public void generatePortContent() { - if (binding != null && contentGenerator != null) { - List portsToUpdate = new ArrayList(); - - Iterator servicesIt = binding.getEnclosingDefinition().getEServices().iterator(); - while (servicesIt.hasNext()) { - Service service = (Service) servicesIt.next(); - Iterator portsIt = service.getEPorts().iterator(); - while (portsIt.hasNext()) { - Port port = (Port) portsIt.next(); - if (binding.equals(port.getEBinding())) { - // Found a match - portsToUpdate.add(port); - } - } - } - - Iterator portsToUpdateIt = portsToUpdate.iterator(); - while (portsToUpdateIt.hasNext()) { - contentGenerator.generatePortContent((Port) portsToUpdateIt.next()); - } - } - } - - /* - * methods addRequiredNamespaces() and computeUniquePrefix() are used to add necessary - * namespaces - * - * TODO: - * Does this belong here? This is copied from wsdl.ui. Can we sync up in some way? - */ - protected void addRequiredNamespaces(Binding binding) { - if (contentGenerator != null) { - String[] namespaceNames = contentGenerator.getRequiredNamespaces(); - String[] preferredPrefixes = new String[namespaceNames.length]; - for (int index = 0; index < namespaceNames.length; index++) { - preferredPrefixes[index] = contentGenerator.getPreferredNamespacePrefix(namespaceNames[index]); - } - - Map map = binding.getEnclosingDefinition().getNamespaces(); - - for (int i = 0; i < namespaceNames.length; i++) { - String namespace = namespaceNames[i]; - if (!map.containsValue(namespace)) { - String prefix = (i < preferredPrefixes.length) ? preferredPrefixes[i] : "p0"; - if (map.containsKey(prefix)) { - prefix = computeUniquePrefix("p", map); - } - binding.getEnclosingDefinition().addNamespace(prefix, namespace); - } - } - } - } - - private String computeUniquePrefix(String base, Map table){ - int i = 0; - String prefix = base; - while (true) { - if (!table.containsKey(prefix)) { - break; - } - else { - prefix = base + i; - i++; - } - } - return prefix; - } - - private PortType getPortType() { - if (getRefName().equals("")) { - // Means we should set the PortType to Unspecified - return null; - } - - if (getRefName() != null) { - Iterator portTypeIt = definition.getEPortTypes().iterator(); - - while (portTypeIt.hasNext()) { - PortType pt = (PortType) portTypeIt.next(); - List prefixedNames = getPrefixedNames(pt); - if (prefixedNames.contains(getRefName())) { - return pt; - } - } - } - - return binding.getEPortType(); - } - - private List getPrefixedNames(PortType portType) { - List prefixedNames = new ArrayList(); - String currentPortTypeName = portType.getQName().getLocalPart(); - String currentNamespace = portType.getQName().getNamespaceURI(); - - Map namespaceMap = definition.getNamespaces(); - Iterator keys = namespaceMap.keySet().iterator(); - while (keys.hasNext()) { - Object key = keys.next(); - Object value = namespaceMap.get(key); - - if (currentNamespace.equals(value)) { - // Found a match. Add to our list - prefixedNames.add(key + ":" + currentPortTypeName); - } - } - - return prefixedNames; - - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/ContentGenerator.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/ContentGenerator.java deleted file mode 100644 index 2fc848b61..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/ContentGenerator.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator; - -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.PortType; - -public interface ContentGenerator -{ - public static String ADDRESS_LOCATION = "http://www.example.org/"; - - public String[] getRequiredNamespaces(); - public String getPreferredNamespacePrefix(String namespace); - - // generates the 'address' extensiblity element for a port - public void generatePortContent(Port port); - - public void generateBindingContent(Binding binding, PortType portType); - public void generateBindingOperationContent(BindingOperation bindingOperation, Operation operation); - public void generateBindingInputContent(BindingInput bindingInput, Input input); - public void generateBindingOutputContent(BindingOutput bindingOutput, Output output); - public void generateBindingFaultContent(BindingFault bindingFault, Fault fault); - - public String getProtocol(); -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/PortGenerator.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/PortGenerator.java deleted file mode 100644 index c16557bd8..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/PortGenerator.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.WSDLFactory; - -public class PortGenerator extends BaseGenerator { - private Service service; - - /** - * Constructs a port generator given the target service. - * @param service the target Service, must not be null. - */ - public PortGenerator(Service service) { - this.service = service; - definition = service.getEnclosingDefinition(); - } - - /** - * Generates a service port given it's name and binding name. - * The port is then added to the service passed in the constructor. - * @return the Port instance - */ - public Port generatePort() { - String portName = getName(); - String bindingName = getRefName(); - - Binding binding = getBinding(bindingName); - - Port port = WSDLFactory.eINSTANCE.createPort(); - port.setName(portName); - port.setEnclosingDefinition(definition); - port.setBinding(binding); - - service.addPort(port); - - ContentGenerator contentGenerator = getContentGenerator(); - - if (contentGenerator != null) { - contentGenerator.generatePortContent(port); - } - - return port; - } - - /** - * Locates a binding given its prefixed name (someNSPrefix:someBindingName). - * - * @param bindingName the qname of the desired binding. - * @return a Binding with the given name, or null if one is not found. - */ - private Binding getBinding(String bindingName) { - List allBindings = getAllBindings(); - Iterator bindingIterator = allBindings.iterator(); - - while (bindingIterator.hasNext()) { - Binding binding = (Binding)bindingIterator.next(); - - List prefixedNames = getPrefixedNames(binding); - - if (prefixedNames.contains(bindingName)) { - return binding; - } - } - - return null; - } - - /** - * Locates all the bindings available in this definition and all its - * imported definitions. - * - * @return a List with all available bindings. - */ - public List getAllBindings() { - List allBindings = new ArrayList(); - List allDefinitions = getAllDefinitions(); - - Iterator defsIterator = allDefinitions.iterator(); - - while (defsIterator.hasNext()) { - Definition definition = (Definition) defsIterator.next(); - Map bindings = definition.getBindings(); - - // ISSUE A possible problem here if somehow a binding is duplicated in one of the imports? - // In that case we should iterate over and check them one by one. - - allBindings.addAll(bindings.values()); - } - - return allBindings; - } - - /** - * Attempts to locate and add to the list all the definitions imported by the - * definition passed in. Recursively tries to locate all definitions. - * - * @param definition the start Definition. Must not be null. - * @param list used to collect all the imported definitions. Must not be null. - */ - private void addDefinition(Definition definition, List list) { - list.add(definition); - List imports = definition.getEImports(); - Iterator importsIterator = imports.iterator(); - - while (importsIterator.hasNext()) { - Import theImport = (Import)importsIterator.next(); - - String importLocationURI = theImport.getLocationURI(); - if (importLocationURI != null && - // ISSUE This assumption seems a bit weak. - importLocationURI.endsWith("wsdl")) { - Definition importedDefinition = theImport.getEDefinition(); - - if (importedDefinition != null && - !list.contains(importedDefinition)) { - // Recursively try to locate all definitions. - - addDefinition(importedDefinition, list); - } - } - } - } - - /** - * Attempts to locate all definitions imported by the current definition and - * all their imports in turn. - * - * @return a List with all definitions imported by the current definition. - */ - private List getAllDefinitions() - { - List list = new ArrayList(); - addDefinition(definition, list); - return list; - } - - private List getPrefixedNames(Binding binding) { - List prefixedNames = new ArrayList(); - String currentBindingName = binding.getQName().getLocalPart(); - String currentNamespace = binding.getQName().getNamespaceURI(); - - Map namespaceMap = definition.getNamespaces(); - Iterator keys = namespaceMap.keySet().iterator(); - while (keys.hasNext()) { - Object key = keys.next(); - Object value = namespaceMap.get(key); - - if (currentNamespace.equals(value)) { - // Found a match. Add to our list - prefixedNames.add(key + ":" + currentBindingName); //$NON-NLS-1$ - } - } - - return prefixedNames; - } - - public Service getService() { - return service; - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionDescriptor.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionDescriptor.java deleted file mode 100644 index cd88bdf5c..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionDescriptor.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator.extension; - -import org.eclipse.wst.wsdl.internal.generator.ContentGenerator; -import org.osgi.framework.Bundle; - -/* - * Class which acts as a container to hold information about the extension. - */ -public class ContentGeneratorExtensionDescriptor { - protected Bundle bundle; - protected ContentGenerator contentGenerator; - protected String namespace; - protected String name; - protected String className; - - public ContentGeneratorExtensionDescriptor(Bundle bundle, String classString, String namespace, String name) { - this.bundle = bundle; - this.namespace = namespace; - this.name = name; - this.className = classString; - } - - - public Object getContentGenerator() { - try { - Class theClass = bundle.loadClass(className); - contentGenerator = (ContentGenerator) theClass.newInstance(); - } - catch (Exception e) { - e.printStackTrace(); - } - - return contentGenerator; - } - - public String getNamespace() { - return namespace; - } - - public String getName() { - return name; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionFactoryRegistry.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionFactoryRegistry.java deleted file mode 100644 index dbd9f96f5..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionFactoryRegistry.java +++ /dev/null @@ -1,168 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator.extension; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.wst.wsdl.internal.generator.ContentGenerator; - - - -public class ContentGeneratorExtensionFactoryRegistry { - protected Map map; - protected static ContentGeneratorExtensionFactoryRegistry instance; - - public static ContentGeneratorExtensionFactoryRegistry getInstance() { - if (instance == null) { - instance = new ContentGeneratorExtensionFactoryRegistry(); - - // TODO... don't read the registry until an 'get'occurs - // - ContentGeneratorExtensionRegistryReader reader = new ContentGeneratorExtensionRegistryReader(instance); - reader.readRegistry(); - } - - return instance; - } - - protected ContentGeneratorExtensionFactoryRegistry() { - map = new HashMap(); - } - - public void put(String namespace, String name, ContentGeneratorExtensionDescriptor descriptor) { - // Check if this namespace/name key is already in the Map - List foundKey = findExistingKey(namespace, name); - - // Did we find an existing key with the same namespace/key pairing? - if (foundKey != null) { - // Simply add the descriptor to the list of descriptors associated - // with this namespace/name key - List descriptorList = (List) map.get(foundKey); - descriptorList.add(descriptor); - } - else { - // We need to create a new entry in the Map for this namespace/name key - List newKey = new ArrayList(2); - newKey.add(namespace); - newKey.add(name); - - List newDescriptorList = new ArrayList(); - newDescriptorList.add(descriptor); - - map.put(newKey, newDescriptorList); - } - } - - /* - * Returns the 'name' attribute for this extension. - */ - public List getBindingExtensionNames() { - List list = new ArrayList(); - - Iterator keyIt = map.keySet().iterator(); - List key = null; - while (keyIt.hasNext()) { - key = (List) keyIt.next(); - list.add(key.get(1)); - } - - return list; - } - - /* - * Return the class specified for this extension based on the namespace - * attribute. - */ - public ContentGenerator getGeneratorClassFromNamespace(String namespace) { - ContentGenerator generatorClass = null; - List key = findExistingKeyFromNamespace(namespace); - - if (key != null) { - List descriptors = (List) map.get(key); - - // Grab the first descriptor available - if (descriptors.size() > 0) { - ContentGeneratorExtensionDescriptor extensionDescriptor = (ContentGeneratorExtensionDescriptor) descriptors.get(0); - generatorClass = (ContentGenerator) extensionDescriptor.getContentGenerator(); - } - } - - return generatorClass; - } - - /* - * Return the class specified for this extension based on the name - * attribute. - */ - public ContentGenerator getGeneratorClassFromName(String name) { - ContentGenerator generatorClass = null; - List key = findExistingKeyFromName(name); - - if (key != null) { - List descriptors = (List) map.get(key); - - // Grab the first descriptor available - if (descriptors.size() > 0) { - ContentGeneratorExtensionDescriptor extensionDescriptor = (ContentGeneratorExtensionDescriptor) descriptors.get(0); - generatorClass = (ContentGenerator) extensionDescriptor.getContentGenerator(); - } - } - - return generatorClass; - } - - // TODO: We need to common the following three methods up....... - private List findExistingKeyFromNamespace(String namespace) { - Iterator keyIt = map.keySet().iterator(); - List foundKey = null; - while (keyIt.hasNext()) { - foundKey = (List) keyIt.next(); - if (namespace.equals(foundKey.get(0))) { - break; - } - foundKey = null; - } - - return foundKey; - } - - private List findExistingKeyFromName(String name) { - Iterator keyIt = map.keySet().iterator(); - List foundKey = null; - while (keyIt.hasNext()) { - foundKey = (List) keyIt.next(); - if (name.equals(foundKey.get(1))) { - break; - } - foundKey = null; - } - - return foundKey; - } - - private List findExistingKey(String namespace, String name) { - Iterator keyIt = map.keySet().iterator(); - List foundKey = null; - while (keyIt.hasNext()) { - foundKey = (List) keyIt.next(); - if (namespace.equals(foundKey.get(0)) && name.equals(foundKey.get(1))) { - break; - } - foundKey = null; - } - - return foundKey; - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionRegistryReader.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionRegistryReader.java deleted file mode 100644 index 79c448de9..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/generator/extension/ContentGeneratorExtensionRegistryReader.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 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/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.internal.generator.extension; - -import java.net.URL; - -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.wst.wsdl.WSDLPlugin; -import org.osgi.framework.Bundle; - -public class ContentGeneratorExtensionRegistryReader { - protected static final String PLUGIN_ID = WSDLPlugin.getPlugin().getSymbolicName(); - protected static final String EXTENSION_POINT_ID = "contentGenerators"; - protected static final String ELEMENT_NAME = "contentGenerator"; - protected static final String ATT_NAMESPACE = "namespace"; - protected static final String ATT_NAME = "name"; - protected static final String ATT_CLASS = "class"; - protected ContentGeneratorExtensionFactoryRegistry contentGeneratorExtensionFactoryRegistry; - - public ContentGeneratorExtensionRegistryReader(ContentGeneratorExtensionFactoryRegistry generatorExtensionFactoryRegistry) { - this.contentGeneratorExtensionFactoryRegistry = generatorExtensionFactoryRegistry; - } - - - /** - * read from plugin registry and parse it. - */ - public void readRegistry() { - IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry(); - IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID); - if (point != null) { - IConfigurationElement[] elements = point.getConfigurationElements(); - for (int i = 0; i < elements.length; i++) { - readElement(elements[i]); - } - } - } - - public String resolve(URL platformURL, String relativePath) throws Exception { - URL resolvedURL = FileLocator.resolve(platformURL); - return resolvedURL.toString() + relativePath; - } - - protected void readElement(IConfigurationElement element) { - if (element.getName().equals(ELEMENT_NAME)) { - try { - IConfigurationElement childElement = (IConfigurationElement) element; - String name = childElement.getAttribute(ATT_NAME); - String namespace = childElement.getAttribute(ATT_NAMESPACE); - - if (namespace != null) { - Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getContributor().getName()); - String className = childElement.getAttribute(ATT_CLASS); - ContentGeneratorExtensionDescriptor descriptor = new ContentGeneratorExtensionDescriptor(pluginBundle, className, namespace, name); - contentGeneratorExtensionFactoryRegistry.put(namespace, name, descriptor); - } - } - catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java deleted file mode 100644 index ce72c476e..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingFaultImpl.java +++ /dev/null @@ -1,419 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Binding Fault</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.BindingFaultImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingFaultImpl#getEFault <em>EFault</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class BindingFaultImpl extends ExtensibleElementImpl implements BindingFault -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getEFault() <em>EFault</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEFault() - * @generated - * @ordered - */ - protected Fault eFault = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected BindingFaultImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getBindingFault(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_FAULT__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Fault getEFault() - { - if (eFault != null && eFault.eIsProxy()) - { - Fault oldEFault = eFault; - eFault = (Fault)eResolveProxy((InternalEObject)eFault); - if (eFault != oldEFault) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.BINDING_FAULT__EFAULT, oldEFault, eFault)); - } - } - return eFault; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Fault basicGetEFault() - { - return eFault; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEFault(Fault newEFault) - { - Fault oldEFault = eFault; - eFault = newEFault; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_FAULT__EFAULT, oldEFault, eFault)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Fault getFault() - { - return getEFault(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setFault(javax.wsdl.Fault fault) - { - setEFault((Fault) fault); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.BINDING_FAULT__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_FAULT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.BINDING_FAULT__ELEMENT: - return getElement(); - case WSDLPackage.BINDING_FAULT__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.BINDING_FAULT__NAME: - return getName(); - case WSDLPackage.BINDING_FAULT__EFAULT: - if (resolve) return getEFault(); - return basicGetEFault(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_FAULT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.BINDING_FAULT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.BINDING_FAULT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.BINDING_FAULT__NAME: - setName((String)newValue); - return; - case WSDLPackage.BINDING_FAULT__EFAULT: - setEFault((Fault)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_FAULT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_FAULT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_FAULT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.BINDING_FAULT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.BINDING_FAULT__EFAULT: - setEFault((Fault)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_FAULT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.BINDING_FAULT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.BINDING_FAULT__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.BINDING_FAULT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.BINDING_FAULT__EFAULT: - return eFault != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - String name = changedElement.getAttribute("name"); - if (name != null) - { - setName(name); - } - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - super.handleUnreconciledElement(child,remainingModelObjects); - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - getEExtensibilityElements().remove(i.next()); - } - } - - public Collection getModelObjects(Object component) - { - BindingFault bindingFault = (BindingFault) component; - List list = new ArrayList(); - list.addAll(bindingFault.getEExtensibilityElements()); - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getBindingFault_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.FAULT); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - - // Resolve the reference to Fault - public void reconcileReferences(boolean deep) - { - if (element != null) - { - BindingOperation bop = (BindingOperation)getContainer(); - Operation op = bop.getEOperation(); - if (op != null) - { - // TBD - Revisit API. Get the first Fault. - setFault((Fault)op.getEFaults().get(0)); - } - } - super.reconcileReferences(deep); - } -} //BindingFaultImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingImpl.java deleted file mode 100644 index 1b46347b4..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingImpl.java +++ /dev/null @@ -1,786 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Binding</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.BindingImpl#getQName <em>QName</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingImpl#isUndefined <em>Undefined</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingImpl#isProxy <em>Proxy</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingImpl#getResourceURI <em>Resource URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingImpl#getEPortType <em>EPort Type</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingImpl#getEBindingOperations <em>EBinding Operations</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class BindingImpl extends ExtensibleElementImpl implements Binding -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected static final QName QNAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected QName qName = QNAME_EDEFAULT; - - /** - * The default value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected static final boolean UNDEFINED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected boolean undefined = UNDEFINED_EDEFAULT; - - /** - * The default value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected static final boolean PROXY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected boolean proxy = PROXY_EDEFAULT; - - /** - * The default value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected static final String RESOURCE_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected String resourceURI = RESOURCE_URI_EDEFAULT; - - /** - * The cached value of the '{@link #getEPortType() <em>EPort Type</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEPortType() - * @generated - * @ordered - */ - protected PortType ePortType = null; - - /** - * The cached value of the '{@link #getEBindingOperations() <em>EBinding Operations</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEBindingOperations() - * @generated - * @ordered - */ - protected EList eBindingOperations = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected BindingImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getBinding(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getQName() - { - return qName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setQName(QName newQName) - { - QName oldQName = qName; - qName = newQName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING__QNAME, oldQName, qName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isUndefined() - { - return undefined; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUndefined(boolean newUndefined) - { - boolean oldUndefined = undefined; - undefined = newUndefined; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING__UNDEFINED, oldUndefined, undefined)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isProxy() - { - return proxy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setProxy(boolean newProxy) - { - boolean oldProxy = proxy; - proxy = newProxy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING__PROXY, oldProxy, proxy)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getResourceURI() - { - return resourceURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setResourceURI(String newResourceURI) - { - String oldResourceURI = resourceURI; - resourceURI = newResourceURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING__RESOURCE_URI, oldResourceURI, resourceURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public PortType getEPortType() - { - if (ePortType != null && ePortType.eIsProxy()) - { - PortType oldEPortType = ePortType; - ePortType = (PortType)eResolveProxy((InternalEObject)ePortType); - if (ePortType != oldEPortType) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.BINDING__EPORT_TYPE, oldEPortType, ePortType)); - } - } - return ePortType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public PortType basicGetEPortType() - { - return ePortType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEPortType(PortType newEPortType) - { - PortType oldEPortType = ePortType; - ePortType = newEPortType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING__EPORT_TYPE, oldEPortType, ePortType)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEBindingOperations() - { - if (eBindingOperations == null) - { - eBindingOperations = new EObjectContainmentEList(BindingOperation.class, this, WSDLPackage.BINDING__EBINDING_OPERATIONS); - } - return eBindingOperations; - } - - /** - * <!-- begin-user-doc --> - * Add an operation binding to binding. - * <!-- end-user-doc --> - * @generated NOT - */ - public void addBindingOperation(javax.wsdl.BindingOperation bindingOperation) - { - getBindingOperations().add(bindingOperation); - } - - /** - * <!-- begin-user-doc --> - * Get the specified operation binding. Note that operation names can - * be overloaded within a PortType. In case of overloading, the - * names of the input and output messages can be used to further - * refine the search. - * @param name the name of the desired operation binding. - * @param inputName the name of the input message; if this is null - * it will be ignored. - * @param outputName the name of the output message; if this is null - * it will be ignored. - * @return the corresponding operation binding, or null if there wasn't - * any matching operation binding - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.BindingOperation getBindingOperation(String name, String inputName, String outputName) - { - Iterator opBindingIterator = getBindingOperations().iterator(); - while (opBindingIterator.hasNext()) - { - javax.wsdl.BindingOperation op = (javax.wsdl.BindingOperation) opBindingIterator.next(); - if (op == null) - continue; - - String opName = op.getName(); - if (name != null && opName != null) - { - if (!name.equals(opName)) - op = null; - } - else if (name != null || opName != null) - { - op = null; - } - - if (op != null && inputName != null) - { - javax.wsdl.BindingInput input = op.getBindingInput(); - if (input != null) - { - String opInputName = input.getName(); - if (opInputName == null || !opInputName.equals(inputName)) - op = null; - } - else - op = null; - } - - if (op != null && outputName != null) - { - javax.wsdl.BindingOutput output = op.getBindingOutput(); - if (output != null) - { - String opOutputName = output.getName(); - if (opOutputName == null || !opOutputName.equals(outputName)) - op = null; - } - else - op = null; - } - - if (op != null) - return op; - } // end while - return null; // binding operation not found - } - - /** - * <!-- begin-user-doc --> - * Get all the operation bindings defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public List getBindingOperations() - { - return getEBindingOperations(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.PortType getPortType() - { - return getEPortType(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setPortType(javax.wsdl.PortType portType) - { - setEPortType((PortType) portType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.BINDING__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - case WSDLPackage.BINDING__EBINDING_OPERATIONS: - return ((InternalEList)getEBindingOperations()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.BINDING__ELEMENT: - return getElement(); - case WSDLPackage.BINDING__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.BINDING__QNAME: - return getQName(); - case WSDLPackage.BINDING__UNDEFINED: - return isUndefined() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.BINDING__PROXY: - return isProxy() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.BINDING__RESOURCE_URI: - return getResourceURI(); - case WSDLPackage.BINDING__EPORT_TYPE: - if (resolve) return getEPortType(); - return basicGetEPortType(); - case WSDLPackage.BINDING__EBINDING_OPERATIONS: - return getEBindingOperations(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.BINDING__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.BINDING__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.BINDING__QNAME: - setQName((QName)newValue); - return; - case WSDLPackage.BINDING__UNDEFINED: - setUndefined(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.BINDING__PROXY: - setProxy(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.BINDING__RESOURCE_URI: - setResourceURI((String)newValue); - return; - case WSDLPackage.BINDING__EPORT_TYPE: - setEPortType((PortType)newValue); - return; - case WSDLPackage.BINDING__EBINDING_OPERATIONS: - getEBindingOperations().clear(); - getEBindingOperations().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.BINDING__QNAME: - setQName(QNAME_EDEFAULT); - return; - case WSDLPackage.BINDING__UNDEFINED: - setUndefined(UNDEFINED_EDEFAULT); - return; - case WSDLPackage.BINDING__PROXY: - setProxy(PROXY_EDEFAULT); - return; - case WSDLPackage.BINDING__RESOURCE_URI: - setResourceURI(RESOURCE_URI_EDEFAULT); - return; - case WSDLPackage.BINDING__EPORT_TYPE: - setEPortType((PortType)null); - return; - case WSDLPackage.BINDING__EBINDING_OPERATIONS: - getEBindingOperations().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.BINDING__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.BINDING__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.BINDING__QNAME: - return QNAME_EDEFAULT == null ? qName != null : !QNAME_EDEFAULT.equals(qName); - case WSDLPackage.BINDING__UNDEFINED: - return undefined != UNDEFINED_EDEFAULT; - case WSDLPackage.BINDING__PROXY: - return proxy != PROXY_EDEFAULT; - case WSDLPackage.BINDING__RESOURCE_URI: - return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI); - case WSDLPackage.BINDING__EPORT_TYPE: - return ePortType != null; - case WSDLPackage.BINDING__EBINDING_OPERATIONS: - return eBindingOperations != null && !eBindingOperations.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (qName: "); - result.append(qName); - result.append(", undefined: "); - result.append(undefined); - result.append(", proxy: "); - result.append(proxy); - result.append(", resourceURI: "); - result.append(resourceURI); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - Definition definition = getEnclosingDefinition(); - - QName qname = new QName(definition.getTargetNamespace(), changedElement.getAttribute("name")); - setQName(qname); - reconcileReferences(false); - } - - public Collection getModelObjects(Object component) - { - Binding binding = (Binding) component; - - List list = new ArrayList(); - list.addAll(binding.getEBindingOperations()); - list.addAll(binding.getEExtensibilityElements()); - return list; - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.OPERATION : - BindingOperation operation = WSDLFactory.eINSTANCE.createBindingOperation(); - operation.setEnclosingDefinition(getEnclosingDefinition()); - operation.setElement(child); - addBindingOperation(operation); - break; - default : - super.handleUnreconciledElement(child,remainingModelObjects); - break; - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - } - - protected void remove(Object component, Object modelObject) - { - List list = getList(component, modelObject); - if (list != null) - { - list.remove(modelObject); - } - } - - private List getList(Object component, Object modelObject) - { - List result = null; - Binding binding = (Binding) component; - if (modelObject instanceof BindingOperation) - { - result = binding.getEBindingOperations(); - } - else if (modelObject instanceof ExtensibilityElement) - { - result = binding.getEExtensibilityElements(); - } - return result; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getBinding_QName()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getQName().getLocalPart()); - } - } - - protected void changeReference(EReference eReference) - { - if (isReconciling) - return; - - super.changeReference(eReference); - Element theElement = getElement(); - if (theElement != null) - { - if (eReference == null || eReference == WSDLPackage.eINSTANCE.getBinding_EPortType()) - { - PortType portType = getEPortType(); - if (portType != null) - { - QName qName = portType.getQName(); - niceSetAttributeURIValue(theElement, WSDLConstants.TYPE_ATTRIBUTE, qName.getNamespaceURI() + "#" + qName.getLocalPart()); - } - } - } - } - - protected Element createElement() - { - Element newElement = createElement(WSDLConstants.BINDING); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - - iterator = getEBindingOperations().iterator(); - while (iterator.hasNext()) - { - BindingOperation operation = (BindingOperation) iterator.next(); - Element child = ((BindingOperationImpl) operation).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - - public void reconcileReferences(boolean deep) - { - if (element != null) - { - Definition definition = (Definition) getEnclosingDefinition(); - QName portTypeQName = createQName(definition, element.getAttribute("type")); - PortType newPortType = portTypeQName != null ? (PortType) definition.getPortType(portTypeQName) : null; - if (newPortType != getEPortType()) - { - setEPortType(newPortType); - } - } - super.reconcileReferences(deep); - } -} //BindingImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java deleted file mode 100644 index 31ea5225a..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingInputImpl.java +++ /dev/null @@ -1,420 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Binding Input</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.BindingInputImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingInputImpl#getEInput <em>EInput</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class BindingInputImpl extends ExtensibleElementImpl implements BindingInput -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getEInput() <em>EInput</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEInput() - * @generated - * @ordered - */ - protected Input eInput = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected BindingInputImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getBindingInput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_INPUT__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Input getEInput() - { - if (eInput != null && eInput.eIsProxy()) - { - Input oldEInput = eInput; - eInput = (Input)eResolveProxy((InternalEObject)eInput); - if (eInput != oldEInput) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.BINDING_INPUT__EINPUT, oldEInput, eInput)); - } - } - return eInput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Input basicGetEInput() - { - return eInput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEInput(Input newEInput) - { - Input oldEInput = eInput; - eInput = newEInput; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_INPUT__EINPUT, oldEInput, eInput)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Input getInput() - { - return getEInput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setInput(javax.wsdl.Input input) - { - setEInput((Input) input); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.BINDING_INPUT__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_INPUT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.BINDING_INPUT__ELEMENT: - return getElement(); - case WSDLPackage.BINDING_INPUT__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.BINDING_INPUT__NAME: - return getName(); - case WSDLPackage.BINDING_INPUT__EINPUT: - if (resolve) return getEInput(); - return basicGetEInput(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_INPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.BINDING_INPUT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.BINDING_INPUT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.BINDING_INPUT__NAME: - setName((String)newValue); - return; - case WSDLPackage.BINDING_INPUT__EINPUT: - setEInput((Input)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_INPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_INPUT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_INPUT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.BINDING_INPUT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.BINDING_INPUT__EINPUT: - setEInput((Input)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_INPUT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.BINDING_INPUT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.BINDING_INPUT__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.BINDING_INPUT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.BINDING_INPUT__EINPUT: - return eInput != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - - // - // Reconciliation methods - // - - public void reconcileAttributes(Element changedElement) - { - if (changedElement.hasAttribute("name")) - { - String name = changedElement.getAttribute("name"); - if (name != null) - { - setName(name); - } - } - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - super.handleUnreconciledElement(child,remainingModelObjects); - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - getEExtensibilityElements().remove(i.next()); - } - } - - public Collection getModelObjects(Object component) - { - BindingInput bindingInput = (BindingInput) component; - List list = new ArrayList(); - list.addAll(bindingInput.getEExtensibilityElements()); - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getBindingInput_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.INPUT); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - - // Resolve the reference to Input - public void reconcileReferences(boolean deep) - { - if (element != null) - { - BindingOperation bop = (BindingOperation)getContainer(); - Operation op = bop.getEOperation(); - if (op != null) - { - setInput(op.getEInput()); - } - } - super.reconcileReferences(deep); - } -} //BindingInputImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOperationImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOperationImpl.java deleted file mode 100644 index b63c8c6c2..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOperationImpl.java +++ /dev/null @@ -1,797 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Binding Operation</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.BindingOperationImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingOperationImpl#getEOperation <em>EOperation</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingOperationImpl#getEBindingInput <em>EBinding Input</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingOperationImpl#getEBindingOutput <em>EBinding Output</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingOperationImpl#getEBindingFaults <em>EBinding Faults</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class BindingOperationImpl extends ExtensibleElementImpl implements BindingOperation -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getEOperation() <em>EOperation</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEOperation() - * @generated - * @ordered - */ - protected Operation eOperation = null; - - /** - * The cached value of the '{@link #getEBindingInput() <em>EBinding Input</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEBindingInput() - * @generated - * @ordered - */ - protected BindingInput eBindingInput = null; - - /** - * The cached value of the '{@link #getEBindingOutput() <em>EBinding Output</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEBindingOutput() - * @generated - * @ordered - */ - protected BindingOutput eBindingOutput = null; - - /** - * The cached value of the '{@link #getEBindingFaults() <em>EBinding Faults</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEBindingFaults() - * @generated - * @ordered - */ - protected EList eBindingFaults = null; - - private Map bindingFaults; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected BindingOperationImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getBindingOperation(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OPERATION__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Operation getEOperation() - { - if (eOperation != null && eOperation.eIsProxy()) - { - Operation oldEOperation = eOperation; - eOperation = (Operation)eResolveProxy((InternalEObject)eOperation); - if (eOperation != oldEOperation) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.BINDING_OPERATION__EOPERATION, oldEOperation, eOperation)); - } - } - return eOperation; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Operation basicGetEOperation() - { - return eOperation; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEOperation(Operation newEOperation) - { - Operation oldEOperation = eOperation; - eOperation = newEOperation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OPERATION__EOPERATION, oldEOperation, eOperation)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public BindingInput getEBindingInput() - { - return eBindingInput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetEBindingInput(BindingInput newEBindingInput, NotificationChain msgs) - { - BindingInput oldEBindingInput = eBindingInput; - eBindingInput = newEBindingInput; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OPERATION__EBINDING_INPUT, oldEBindingInput, newEBindingInput); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEBindingInput(BindingInput newEBindingInput) - { - if (newEBindingInput != eBindingInput) - { - NotificationChain msgs = null; - if (eBindingInput != null) - msgs = ((InternalEObject)eBindingInput).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.BINDING_OPERATION__EBINDING_INPUT, null, msgs); - if (newEBindingInput != null) - msgs = ((InternalEObject)newEBindingInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.BINDING_OPERATION__EBINDING_INPUT, null, msgs); - msgs = basicSetEBindingInput(newEBindingInput, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OPERATION__EBINDING_INPUT, newEBindingInput, newEBindingInput)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public BindingOutput getEBindingOutput() - { - return eBindingOutput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetEBindingOutput(BindingOutput newEBindingOutput, NotificationChain msgs) - { - BindingOutput oldEBindingOutput = eBindingOutput; - eBindingOutput = newEBindingOutput; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT, oldEBindingOutput, newEBindingOutput); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEBindingOutput(BindingOutput newEBindingOutput) - { - if (newEBindingOutput != eBindingOutput) - { - NotificationChain msgs = null; - if (eBindingOutput != null) - msgs = ((InternalEObject)eBindingOutput).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT, null, msgs); - if (newEBindingOutput != null) - msgs = ((InternalEObject)newEBindingOutput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT, null, msgs); - msgs = basicSetEBindingOutput(newEBindingOutput, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT, newEBindingOutput, newEBindingOutput)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEBindingFaults() - { - if (eBindingFaults == null) - { - eBindingFaults = new EObjectContainmentEList(BindingFault.class, this, WSDLPackage.BINDING_OPERATION__EBINDING_FAULTS); - } - return eBindingFaults; - } - - /** - * <!-- begin-user-doc --> - * Add a fault binding. - * @param fault the new fault binding - * <!-- end-user-doc --> - * @generated NOT - */ - public void addBindingFault(javax.wsdl.BindingFault bindingFault) - { - getEBindingFaults().add((BindingFault)bindingFault); - } - - /** - * <!-- begin-user-doc --> - * Get the specified fault binding. - * @param name the name of the desired fault binding. - * @return the corresponding fault binding, or null if there wasn't - * any matching fault binding - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.BindingFault getBindingFault(String name) - { - BindingFault result = null; - for (Iterator i = getEBindingFaults().iterator(); i.hasNext();) - { - BindingFault fault = (BindingFault) i.next(); - if (name.equals(fault.getName())) - { - result = fault; - break; - } - } - return result; - } - - /** - * <!-- begin-user-doc --> - * Get all the fault bindings associated with this operation binding. - * @return names of fault bindings - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getBindingFaults() - { - HashMap hashMap = new HashMap(); - for (Iterator i = getEBindingFaults().iterator(); i.hasNext();) - { - BindingFault bindingFault = (BindingFault) i.next(); - hashMap.put(bindingFault.getName(), bindingFault); - } - return hashMap; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Operation getOperation() - { - return getEOperation(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setOperation(javax.wsdl.Operation operation) - { - setEOperation((Operation) operation); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.BindingInput getBindingInput() - { - return getEBindingInput(); - } - - /** - * <!-- begin-user-doc --> - * Set the input of this operation binding. - * @param input the desired input - * <!-- end-user-doc --> - * @generated NOT - */ - public void setBindingInput(javax.wsdl.BindingInput bindingInput) - { - setEBindingInput((BindingInput) bindingInput); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.BindingOutput getBindingOutput() - { - return getEBindingOutput(); - } - - /** - * <!-- begin-user-doc --> - * Set the output of this operation binding. - * <!-- end-user-doc --> - * @generated NOT - */ - public void setBindingOutput(javax.wsdl.BindingOutput bindingOutput) - { - setEBindingOutput((BindingOutput) bindingOutput); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.BINDING_OPERATION__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - case WSDLPackage.BINDING_OPERATION__EBINDING_INPUT: - return basicSetEBindingInput(null, msgs); - case WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT: - return basicSetEBindingOutput(null, msgs); - case WSDLPackage.BINDING_OPERATION__EBINDING_FAULTS: - return ((InternalEList)getEBindingFaults()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OPERATION__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.BINDING_OPERATION__ELEMENT: - return getElement(); - case WSDLPackage.BINDING_OPERATION__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.BINDING_OPERATION__NAME: - return getName(); - case WSDLPackage.BINDING_OPERATION__EOPERATION: - if (resolve) return getEOperation(); - return basicGetEOperation(); - case WSDLPackage.BINDING_OPERATION__EBINDING_INPUT: - return getEBindingInput(); - case WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT: - return getEBindingOutput(); - case WSDLPackage.BINDING_OPERATION__EBINDING_FAULTS: - return getEBindingFaults(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OPERATION__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.BINDING_OPERATION__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.BINDING_OPERATION__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.BINDING_OPERATION__NAME: - setName((String)newValue); - return; - case WSDLPackage.BINDING_OPERATION__EOPERATION: - setEOperation((Operation)newValue); - return; - case WSDLPackage.BINDING_OPERATION__EBINDING_INPUT: - setEBindingInput((BindingInput)newValue); - return; - case WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT: - setEBindingOutput((BindingOutput)newValue); - return; - case WSDLPackage.BINDING_OPERATION__EBINDING_FAULTS: - getEBindingFaults().clear(); - getEBindingFaults().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OPERATION__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_OPERATION__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_OPERATION__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.BINDING_OPERATION__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.BINDING_OPERATION__EOPERATION: - setEOperation((Operation)null); - return; - case WSDLPackage.BINDING_OPERATION__EBINDING_INPUT: - setEBindingInput((BindingInput)null); - return; - case WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT: - setEBindingOutput((BindingOutput)null); - return; - case WSDLPackage.BINDING_OPERATION__EBINDING_FAULTS: - getEBindingFaults().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OPERATION__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.BINDING_OPERATION__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.BINDING_OPERATION__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.BINDING_OPERATION__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.BINDING_OPERATION__EOPERATION: - return eOperation != null; - case WSDLPackage.BINDING_OPERATION__EBINDING_INPUT: - return eBindingInput != null; - case WSDLPackage.BINDING_OPERATION__EBINDING_OUTPUT: - return eBindingOutput != null; - case WSDLPackage.BINDING_OPERATION__EBINDING_FAULTS: - return eBindingFaults != null && !eBindingFaults.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - String name = changedElement.getAttribute("name"); - if (name != null) - { - setName(name); - } - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - Definition definition = getEnclosingDefinition(); - - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.INPUT : - { - BindingInput input = WSDLFactory.eINSTANCE.createBindingInput(); - input.setEnclosingDefinition(definition); - input.setElement(child); - setBindingInput(input); - break; - } - case WSDLConstants.OUTPUT : - { - BindingOutput output = WSDLFactory.eINSTANCE.createBindingOutput(); - output.setEnclosingDefinition(definition); - output.setElement(child); - setBindingOutput(output); - break; - } - case WSDLConstants.FAULT : - { - BindingFault fault = WSDLFactory.eINSTANCE.createBindingFault(); - fault.setEnclosingDefinition(definition); - fault.setElement(child); - addBindingFault(fault); - break; - } - default : - { - super.handleUnreconciledElement(child,remainingModelObjects); - break; - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - } - - protected void remove(Object component, Object modelObject) - { - BindingOperation bindingOperation = (BindingOperation) component; - if (modelObject instanceof BindingInput) - { - bindingOperation.setEBindingInput(null); - } - else if (modelObject instanceof BindingOutput) - { - bindingOperation.setEBindingOutput(null); - } - else if (modelObject instanceof BindingFault) - { - bindingOperation.getEBindingFaults().remove(modelObject); - } - else - { - bindingOperation.getEExtensibilityElements().remove(modelObject); - } - } - - public Collection getModelObjects(Object component) - { - BindingOperation bindingOperation = (BindingOperation) component; - - List list = new ArrayList(); - - if (bindingOperation.getEBindingInput() != null) - { - list.add(bindingOperation.getEBindingInput()); - } - - if (bindingOperation.getEBindingOutput() != null) - { - list.add(bindingOperation.getEBindingOutput()); - } - - list.addAll(bindingOperation.getEBindingFaults()); - list.addAll(bindingOperation.getEExtensibilityElements()); - - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getBindingOperation_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.OPERATION); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - - BindingInput input = getEBindingInput(); - if (input != null) - { - Element child = ((BindingInputImpl) input).createElement(); - newElement.appendChild(child); - } - - BindingOutput output = getEBindingOutput(); - if (output != null) - { - Element child = ((BindingOutputImpl) output).createElement(); - newElement.appendChild(child); - } - - iterator = getEBindingFaults().iterator(); - while (iterator.hasNext()) - { - BindingFault fault = (BindingFault) iterator.next(); - Element child = ((BindingFaultImpl) fault).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - - // Resolve the reference to Operation - public void reconcileReferences(boolean deep) - { - if (element != null) - { - Binding binding = (Binding)getContainer(); - PortType portType = binding.getEPortType(); - if (portType != null) - { - setOperation(portType.getOperation(getName(),null,null)); - } - } - super.reconcileReferences(deep); - } -} //BindingOperationImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java deleted file mode 100644 index d350d911d..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/BindingOutputImpl.java +++ /dev/null @@ -1,420 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Binding Output</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.BindingOutputImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.BindingOutputImpl#getEOutput <em>EOutput</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class BindingOutputImpl extends ExtensibleElementImpl implements BindingOutput -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getEOutput() <em>EOutput</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEOutput() - * @generated - * @ordered - */ - protected Output eOutput = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected BindingOutputImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getBindingOutput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OUTPUT__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Output getEOutput() - { - if (eOutput != null && eOutput.eIsProxy()) - { - Output oldEOutput = eOutput; - eOutput = (Output)eResolveProxy((InternalEObject)eOutput); - if (eOutput != oldEOutput) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.BINDING_OUTPUT__EOUTPUT, oldEOutput, eOutput)); - } - } - return eOutput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Output basicGetEOutput() - { - return eOutput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEOutput(Output newEOutput) - { - Output oldEOutput = eOutput; - eOutput = newEOutput; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.BINDING_OUTPUT__EOUTPUT, oldEOutput, eOutput)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Output getOutput() - { - return getEOutput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setOutput(javax.wsdl.Output output) - { - setEOutput((Output) output); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.BINDING_OUTPUT__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OUTPUT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.BINDING_OUTPUT__ELEMENT: - return getElement(); - case WSDLPackage.BINDING_OUTPUT__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.BINDING_OUTPUT__NAME: - return getName(); - case WSDLPackage.BINDING_OUTPUT__EOUTPUT: - if (resolve) return getEOutput(); - return basicGetEOutput(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OUTPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.BINDING_OUTPUT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.BINDING_OUTPUT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.BINDING_OUTPUT__NAME: - setName((String)newValue); - return; - case WSDLPackage.BINDING_OUTPUT__EOUTPUT: - setEOutput((Output)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OUTPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_OUTPUT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.BINDING_OUTPUT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.BINDING_OUTPUT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.BINDING_OUTPUT__EOUTPUT: - setEOutput((Output)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.BINDING_OUTPUT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.BINDING_OUTPUT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.BINDING_OUTPUT__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.BINDING_OUTPUT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.BINDING_OUTPUT__EOUTPUT: - return eOutput != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - if (changedElement.hasAttribute("name")) - { - String name = changedElement.getAttribute("name"); - if (name != null) - { - setName(name); - } - } - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - super.handleUnreconciledElement(child,remainingModelObjects); - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - getEExtensibilityElements().remove(i.next()); - } - } - - public Collection getModelObjects(Object component) - { - BindingOutput bindingOutput = (BindingOutput) component; - List list = new ArrayList(); - list.addAll(bindingOutput.getEExtensibilityElements()); - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getBindingOutput_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.OUTPUT); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - - // Resolve the reference to Output - public void reconcileReferences(boolean deep) - { - if (element != null) - { - BindingOperation bop = (BindingOperation)getContainer(); - Operation op = bop.getEOperation(); - if (op != null) - { - setOutput(op.getEOutput()); - } - } - super.reconcileReferences(deep); - } -} //BindingOutputImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/DefinitionImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/DefinitionImpl.java deleted file mode 100644 index 158658c0c..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/DefinitionImpl.java +++ /dev/null @@ -1,2299 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.wsdl.BindingFault; -import javax.wsdl.BindingInput; -import javax.wsdl.BindingOperation; -import javax.wsdl.BindingOutput; -import javax.wsdl.Fault; -import javax.wsdl.Input; -import javax.wsdl.Operation; -import javax.wsdl.Output; -import javax.wsdl.Part; -import javax.wsdl.Port; -import javax.wsdl.extensions.ExtensionRegistry; -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.Types; -import org.eclipse.wst.wsdl.WSDLElement; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.WSDLPlugin; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; -import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.eclipse.wst.wsdl.util.WSDLResourceImpl; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDImport; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDTypeDefinition; -import org.eclipse.xsd.impl.XSDImportImpl; -import org.eclipse.xsd.impl.XSDSchemaImpl; -import org.eclipse.xsd.util.XSDConstants; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventListener; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.MutationEvent; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Definition</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getTargetNamespace <em>Target Namespace</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getLocation <em>Location</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getQName <em>QName</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getEncoding <em>Encoding</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getEMessages <em>EMessages</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getEPortTypes <em>EPort Types</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getEBindings <em>EBindings</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getEServices <em>EServices</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getENamespaces <em>ENamespaces</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getETypes <em>ETypes</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.DefinitionImpl#getEImports <em>EImports</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class DefinitionImpl extends ExtensibleElementImpl implements Definition -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getTargetNamespace() <em>Target Namespace</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTargetNamespace() - * @generated - * @ordered - */ - protected static final String TARGET_NAMESPACE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTargetNamespace() <em>Target Namespace</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTargetNamespace() - * @generated - * @ordered - */ - protected String targetNamespace = TARGET_NAMESPACE_EDEFAULT; - - /** - * The default value of the '{@link #getLocation() <em>Location</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLocation() - * @generated - * @ordered - */ - protected static final String LOCATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLocation() - * @generated - * @ordered - */ - protected String location = LOCATION_EDEFAULT; - - /** - * The default value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected static final QName QNAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected QName qName = QNAME_EDEFAULT; - - /** - * The default value of the '{@link #getEncoding() <em>Encoding</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEncoding() - * @generated - * @ordered - */ - protected static final String ENCODING_EDEFAULT = null; - - /** - * The cached value of the '{@link #getEncoding() <em>Encoding</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEncoding() - * @generated - * @ordered - */ - protected String encoding = ENCODING_EDEFAULT; - - /** - * The cached value of the '{@link #getEMessages() <em>EMessages</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEMessages() - * @generated - * @ordered - */ - protected EList eMessages = null; - - /** - * The cached value of the '{@link #getEPortTypes() <em>EPort Types</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEPortTypes() - * @generated - * @ordered - */ - protected EList ePortTypes = null; - - /** - * The cached value of the '{@link #getEBindings() <em>EBindings</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEBindings() - * @generated - * @ordered - */ - protected EList eBindings = null; - - /** - * The cached value of the '{@link #getEServices() <em>EServices</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEServices() - * @generated - * @ordered - */ - protected EList eServices = null; - - /** - * The cached value of the '{@link #getENamespaces() <em>ENamespaces</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getENamespaces() - * @generated - * @ordered - */ - protected EList eNamespaces = null; - - /** - * The cached value of the '{@link #getETypes() <em>ETypes</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getETypes() - * @generated - * @ordered - */ - protected Types eTypes = null; - - /** - * The cached value of the '{@link #getEImports() <em>EImports</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEImports() - * @generated - * @ordered - */ - protected EList eImports = null; - - private ExtensionRegistry extensionRegistry; - private Document document; - private HashMap namespaces = new HashMap(); - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected DefinitionImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getDefinition(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getTargetNamespace() - { - return targetNamespace; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setTargetNamespace(String newTargetNamespace) - { - String oldTargetNamespace = targetNamespace; - targetNamespace = newTargetNamespace; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.DEFINITION__TARGET_NAMESPACE, oldTargetNamespace, targetNamespace)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getLocation() - { - return location; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setLocation(String newLocation) - { - String oldLocation = location; - location = newLocation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.DEFINITION__LOCATION, oldLocation, location)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getQName() - { - return qName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setQName(QName newQName) - { - QName oldQName = qName; - qName = newQName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.DEFINITION__QNAME, oldQName, qName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getEncoding() - { - return encoding; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEncoding(String newEncoding) - { - String oldEncoding = encoding; - encoding = newEncoding; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.DEFINITION__ENCODING, oldEncoding, encoding)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEMessages() - { - if (eMessages == null) - { - eMessages = new EObjectContainmentEList(Message.class, this, WSDLPackage.DEFINITION__EMESSAGES); - } - return eMessages; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEPortTypes() - { - if (ePortTypes == null) - { - ePortTypes = new EObjectContainmentEList(PortType.class, this, WSDLPackage.DEFINITION__EPORT_TYPES); - } - return ePortTypes; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEBindings() - { - if (eBindings == null) - { - eBindings = new EObjectContainmentEList(Binding.class, this, WSDLPackage.DEFINITION__EBINDINGS); - } - return eBindings; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEServices() - { - if (eServices == null) - { - eServices = new EObjectContainmentEList(Service.class, this, WSDLPackage.DEFINITION__ESERVICES); - } - return eServices; - } - - /** - * <!-- begin-user-doc --> - * @deprecated - * <!-- end-user-doc --> - * @generated - */ - public EList getENamespaces() - { - if (eNamespaces == null) - { - eNamespaces = new EObjectContainmentEList(Namespace.class, this, WSDLPackage.DEFINITION__ENAMESPACES); - } - return eNamespaces; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Types getETypes() - { - return eTypes; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetETypes(Types newETypes, NotificationChain msgs) - { - Types oldETypes = eTypes; - eTypes = newETypes; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WSDLPackage.DEFINITION__ETYPES, oldETypes, newETypes); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setETypes(Types newETypes) - { - if (newETypes != eTypes) - { - NotificationChain msgs = null; - if (eTypes != null) - msgs = ((InternalEObject)eTypes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.DEFINITION__ETYPES, null, msgs); - if (newETypes != null) - msgs = ((InternalEObject)newETypes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.DEFINITION__ETYPES, null, msgs); - msgs = basicSetETypes(newETypes, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.DEFINITION__ETYPES, newETypes, newETypes)); - } - - public void eNotify(Notification msg) - { - super.eNotify(msg); - - // cs.. if we've added a Types element, and this definition is already attached to a resource - // we need to set the schemaLocations for any inline schemaLocations. - // If not yet attached to a resource, the schemaLocation's will be set via WSDLResourceImpl.attached(EObject o) - // - if (msg.getFeature() == WSDLPackage.eINSTANCE.getDefinition_ETypes() && - msg.getEventType() == Notification.SET) - { - if (eResource() instanceof WSDLResourceImpl && getEnclosingDefinition() != null) - { - setInlineSchemaLocations(eResource()); - } - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEImports() - { - if (eImports == null) - { - eImports = new EObjectContainmentEList(Import.class, this, WSDLPackage.DEFINITION__EIMPORTS); - } - return eImports; - } - - /** - * <!-- begin-user-doc --> - * Add a binding to this WSDL description. - * @param binding the binding to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addBinding(javax.wsdl.Binding binding) - { - getEBindings().add((Binding) binding); - } - - /** - * <!-- begin-user-doc --> - * Add an import to this WSDL description. - * @param importDef the import to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addImport(javax.wsdl.Import importDef) - { - getEImports().add((Import) importDef); - } - - /** - * <!-- begin-user-doc --> - * Add a message to this WSDL description. - * @param message the message to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addMessage(javax.wsdl.Message message) - { - getEMessages().add((Message)message); - } - - /** - * <!-- begin-user-doc --> - * This is a way to add a namespace association to a definition. - * It is similar to adding a namespace prefix declaration to the - * top of a <wsdl:definition> element. This has nothing to do - * with the <wsdl:import> element; there are separate methods for - * dealing with information described by <wsdl:import> elements. - * There is a default namespace association (which can be - * overridden) between the null prefix and - * http://schemas.xmlsoap.org/wsdl/. - * @param prefix the prefix to use for this namespace (when - * rendering this information as XML). Use null or an empty string - * to describe the default namespace (i.e. xmlns="..."). - * @param namespaceURI the namespace URI to associate the prefix - * with. If you use null, the namespace association will be removed. - * <!-- end-user-doc --> - * @generated NOT - */ - public void addNamespace(String prefix, String namespaceURI) - { - if (prefix == null) - prefix = ""; - - if (namespaceURI != null) - { - // First, check if there is this namespace already. - String existingPrefix = getPrefix(namespaceURI); - if (existingPrefix != null) - return; - - // Make sure the prefix is not already used for a different namespace - Map namespaces = getNamespaces(); - String existingNamespace = (String) namespaces.get(prefix); - if (existingNamespace == null) - { - namespaces.put(prefix, namespaceURI); - - // Support for Namespace - Namespace ens = WSDLFactory.eINSTANCE.createNamespace(); - ens.setPrefix(prefix); - ens.setURI(namespaceURI); - getENamespaces().add(ens); - - return; - } - - // The prefix is taken already. Make a unique prefix - if (prefix.endsWith("1")) - prefix = prefix.substring(0, prefix.length() - 1); - - for (int i = 2;; i++) - { - String newPrefix = prefix + i; - if (!namespaces.containsKey(newPrefix)) - { - namespaces.put(newPrefix, namespaceURI); - - // Support for Namespace - Namespace ens = WSDLFactory.eINSTANCE.createNamespace(); - ens.setPrefix(prefix); - ens.setURI(namespaceURI); - getENamespaces().add(ens); - - return; - } - } - } // end if (namespaceURI != null) - else - { - getNamespaces().remove(prefix); - - // Support for Namespace - getENamespaces().remove(prefix); - } - } - - /** - * <!-- begin-user-doc --> - * Add a portType to this WSDL description. - * @param portType the portType to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addPortType(javax.wsdl.PortType portType) - { - getEPortTypes().add((PortType)portType); - } - - /** - * <!-- begin-user-doc --> - * Add a service to this WSDL description. - * @param service the service to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addService(javax.wsdl.Service service) - { - getEServices().add((Service)service); - } - - /** - * <!-- begin-user-doc --> - * Create a new binding fault. - * @return the newly created binding fault - * <!-- end-user-doc --> - * @generated NOT - */ - public BindingFault createBindingFault() - { - javax.wsdl.BindingFault bindingFault = WSDLFactoryImpl.eINSTANCE.createBindingFault(); - return bindingFault; - } - - /** - * <!-- begin-user-doc --> - * Create a new binding input. - * @return the newly created binding input - * <!-- end-user-doc --> - * @generated NOT - */ - public BindingInput createBindingInput() - { - javax.wsdl.BindingInput bindingInput = WSDLFactoryImpl.eINSTANCE.createBindingInput(); - return bindingInput; - } - - /** - * <!-- begin-user-doc --> - * Create a new binding output. - * @return the newly created binding output - * <!-- end-user-doc --> - * @generated NOT - */ - public BindingOutput createBindingOutput() - { - javax.wsdl.BindingOutput bindingOutput = WSDLFactoryImpl.eINSTANCE.createBindingOutput(); - return bindingOutput; - } - - /** - * <!-- begin-user-doc --> - * Create a new binding operation. - * @return the newly created binding operation - * <!-- end-user-doc --> - * @generated NOT - */ - public BindingOperation createBindingOperation() - { - javax.wsdl.BindingOperation bindingOperation = WSDLFactoryImpl.eINSTANCE.createBindingOperation(); - return bindingOperation; - } - - /** - * <!-- begin-user-doc --> - * Create a new binding. - * @return the newly created binding - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Binding createBinding() - { - javax.wsdl.Binding binding = WSDLFactoryImpl.eINSTANCE.createBinding(); - binding.setUndefined(true); - return binding; - } - - /** - * <!-- begin-user-doc --> - * Create a new fault. - * @return the newly created fault - * <!-- end-user-doc --> - * @generated NOT - */ - public Fault createFault() - { - javax.wsdl.Fault fault = WSDLFactoryImpl.eINSTANCE.createFault(); - return fault; - } - - /** - * <!-- begin-user-doc --> - * Create a new import. - * @return the newly created import - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Import createImport() - { - javax.wsdl.Import importDef = WSDLFactoryImpl.eINSTANCE.createImport(); - return importDef; - } - - /** - * <!-- begin-user-doc --> - * Create a new input. - * @return the newly created input - * <!-- end-user-doc --> - * @generated NOT - */ - public Input createInput() - { - javax.wsdl.Input input = WSDLFactoryImpl.eINSTANCE.createInput(); - return input; - } - - /** - * <!-- begin-user-doc --> - * Create a new message. - * @return the newly created message - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message createMessage() - { - javax.wsdl.Message message = WSDLFactoryImpl.eINSTANCE.createMessage(); - message.setUndefined(true); - return message; - } - - /** - * <!-- begin-user-doc --> - * Create a new operation. - * @return the newly created operation - * <!-- end-user-doc --> - * @generated NOT - */ - public Operation createOperation() - { - javax.wsdl.Operation operation = WSDLFactoryImpl.eINSTANCE.createOperation(); - operation.setUndefined(true); - return operation; - } - - /** - * <!-- begin-user-doc --> - * Create a new output. - * @return the newly created output - * <!-- end-user-doc --> - * @generated NOT - */ - public Output createOutput() - { - javax.wsdl.Output output = WSDLFactoryImpl.eINSTANCE.createOutput(); - return output; - } - - /** - * <!-- begin-user-doc --> - * Create a new part. - * @return the newly created part - * <!-- end-user-doc --> - * @generated NOT - */ - public Part createPart() - { - javax.wsdl.Part part = WSDLFactoryImpl.eINSTANCE.createPart(); - return part; - } - - /** - * <!-- begin-user-doc --> - * Create a new port. - * @return the newly created port - * <!-- end-user-doc --> - * @generated NOT - */ - public Port createPort() - { - javax.wsdl.Port port = WSDLFactoryImpl.eINSTANCE.createPort(); - return port; - } - - /** - * <!-- begin-user-doc --> - * Create a new port type. - * @return the newly created port type - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.PortType createPortType() - { - javax.wsdl.PortType portType = WSDLFactoryImpl.eINSTANCE.createPortType(); - portType.setUndefined(true); - return portType; - } - - /** - * <!-- begin-user-doc --> - * Create a new service. - * @return the newly created service - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Service createService() - { - javax.wsdl.Service service = WSDLFactoryImpl.eINSTANCE.createService(); - return service; - } - - /** - * <!-- begin-user-doc --> - * Get the specified binding. Also checks imported documents. - * @param name the name of the desired binding. - * @return the corresponding binding, or null if there wasn't - * any matching binding - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Binding getBinding(QName name) - { - return (javax.wsdl.Binding) resolveWSDLElement(WSDLConstants.BINDING, name); - } - - /** - * <!-- begin-user-doc --> - * Get all the bindings defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getBindings() - { - return createMap(WSDLConstants.BINDING, getEBindings()); - } - - /** - * <!-- begin-user-doc --> - * Get a map of lists containing all the imports defined here. - * The map's keys are the namespaceURIs, and the map's values - * are lists. There is one list for each namespaceURI for which - * imports have been defined. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getImports() - { - HashMap map = new HashMap(); - for (Iterator i = getEImports().iterator(); i.hasNext();) - { - Import theImport = (Import) i.next(); - String key = theImport.getNamespaceURI(); - if (key == null) - { - key = ""; - } - - List list = null; - if (map.containsKey(key)) - { - list = (List)map.get(key); - list.add(theImport); - } - else - { - list = new ArrayList(); - list.add(theImport); - } - map.put(key,list); - } - return map; - } - - /** - * <!-- begin-user-doc --> - * Get the list of imports for the specified namespaceURI. - * @param namespaceURI the namespaceURI associated with the - * desired imports. - * @return a list of the corresponding imports - * <!-- end-user-doc --> - * @generated NOT - */ - public List getImports(String namespaceURI) - { - List list = new ArrayList(); - for (Iterator i = getEImports().iterator(); i.hasNext();) - { - Import theImport = (Import) i.next(); - if (WSDLConstants.isMatchingNamespace(namespaceURI, theImport.getNamespaceURI())) - { - list.add(theImport); - } - } - return list; - } - - /** - * <!-- begin-user-doc --> - * Get the specified message. Also checks imported documents. - * @param name the name of the desired message. - * @return the corresponding message, or null if there wasn't - * any matching message - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message getMessage(QName name) - { - return (javax.wsdl.Message) resolveWSDLElement(WSDLConstants.MESSAGE, name); - } - - /** - * <!-- begin-user-doc --> - * Get all the messages defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getMessages() - { - return createMap(WSDLConstants.MESSAGE, getEMessages()); - } - - /** - * <!-- begin-user-doc --> - * Get the namespace URI associated with this prefix. Or null if - * there is no namespace URI associated with this prefix. This is - * unrelated to the <wsdl:import> element. - * @see #addNamespace(String, String) - * @see #getPrefix(String) - * <!-- end-user-doc --> - * @generated NOT - */ - public String getNamespace(String prefix) - { - return (String) getNamespaces().get(prefix); - } - - /** - * <!-- begin-user-doc --> - * Get all namespace associations in this definition. The keys are - * the prefixes, and the namespace URIs are the values. This is - * unrelated to the <wsdl:import> element. - * @see #addNamespace(String, String) - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getNamespaces() - { - return namespaces; - } - - /** - * <!-- begin-user-doc --> - * Get the specified portType. Also checks imported documents. - * @param name the name of the desired portType. - * @return the corresponding portType, or null if there wasn't - * any matching portType - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.PortType getPortType(QName name) - { - return (javax.wsdl.PortType) resolveWSDLElement(WSDLConstants.PORT_TYPE, name); - } - - /** - * <!-- begin-user-doc --> - * Get all the portTypes defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getPortTypes() - { - return createMap(WSDLConstants.PORT_TYPE, getEPortTypes()); - } - - /** - * <!-- begin-user-doc --> - * Get a prefix associated with this namespace URI. Or null if - * there are no prefixes associated with this namespace URI. This is - * unrelated to the <wsdl:import> element. - * @see #addNamespace(String, String) - * @see #getNamespace(String) - * <!-- end-user-doc --> - * @generated NOT - */ - public String getPrefix(String namespaceURI) - { - if (namespaceURI == null) - return null; - - Iterator entryIterator = getNamespaces().entrySet().iterator(); - while (entryIterator.hasNext()) - { - Map.Entry entry = (Map.Entry) entryIterator.next(); - String prefix = (String) entry.getKey(); - String assocNamespaceURI = (String) entry.getValue(); - - if (namespaceURI.equals(assocNamespaceURI) && prefix != "") // default namespace - return prefix; - } - return null; - } - - /** - * <!-- begin-user-doc --> - * Get the specified service. Also checks imported documents. - * @param name the name of the desired service. - * @return the corresponding service, or null if there wasn't - * any matching service - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Service getService(QName name) - { - return (javax.wsdl.Service) resolveWSDLElement(WSDLConstants.SERVICE, name); - } - - /** - * <!-- begin-user-doc --> - * Get all the services defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getServices() - { - return createMap(WSDLConstants.SERVICE, getEServices()); - } - - /** - * <!-- begin-user-doc --> - * Get a reference to the ExtensionRegistry for this Definition. - * <!-- end-user-doc --> - * @generated NOT - */ - public ExtensionRegistry getExtensionRegistry() - { - return extensionRegistry; - } - - /** - * <!-- begin-user-doc --> - * Set the ExtensionRegistry for this Definition. - * <!-- end-user-doc --> - * @generated NOT - */ - public void setExtensionRegistry(ExtensionRegistry extensionRegistry) - { - this.extensionRegistry = extensionRegistry; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public String getDocumentBaseURI() - { - return getLocation(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setDocumentBaseURI(String documentBase) - { - setLocation(documentBase); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Types createTypes() - { - javax.wsdl.Types types = WSDLFactoryImpl.eINSTANCE.createTypes(); - return types; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Service removeService(QName name) - { - return (javax.wsdl.Service) getServices().remove(name); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Binding removeBinding(QName name) - { - return (javax.wsdl.Binding) getBindings().remove(name); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.PortType removePortType(QName name) - { - return (javax.wsdl.PortType) getPortTypes().remove(name); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message removeMessage(QName name) - { - return (javax.wsdl.Message) getMessages().remove(name); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Types getTypes() - { - return getETypes(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setTypes(javax.wsdl.Types types) - { - setETypes((Types) types); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public Document getDocument() - { - return document; - } - - /** - * <!-- begin-user-doc --> - * Sets the owner document. - * <!-- end-user-doc --> - * @generated NOT - */ - public void setDocument(Document document) - { - this.document = document; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.DEFINITION__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - case WSDLPackage.DEFINITION__EMESSAGES: - return ((InternalEList)getEMessages()).basicRemove(otherEnd, msgs); - case WSDLPackage.DEFINITION__EPORT_TYPES: - return ((InternalEList)getEPortTypes()).basicRemove(otherEnd, msgs); - case WSDLPackage.DEFINITION__EBINDINGS: - return ((InternalEList)getEBindings()).basicRemove(otherEnd, msgs); - case WSDLPackage.DEFINITION__ESERVICES: - return ((InternalEList)getEServices()).basicRemove(otherEnd, msgs); - case WSDLPackage.DEFINITION__ENAMESPACES: - return ((InternalEList)getENamespaces()).basicRemove(otherEnd, msgs); - case WSDLPackage.DEFINITION__ETYPES: - return basicSetETypes(null, msgs); - case WSDLPackage.DEFINITION__EIMPORTS: - return ((InternalEList)getEImports()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.DEFINITION__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.DEFINITION__ELEMENT: - return getElement(); - case WSDLPackage.DEFINITION__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.DEFINITION__TARGET_NAMESPACE: - return getTargetNamespace(); - case WSDLPackage.DEFINITION__LOCATION: - return getLocation(); - case WSDLPackage.DEFINITION__QNAME: - return getQName(); - case WSDLPackage.DEFINITION__ENCODING: - return getEncoding(); - case WSDLPackage.DEFINITION__EMESSAGES: - return getEMessages(); - case WSDLPackage.DEFINITION__EPORT_TYPES: - return getEPortTypes(); - case WSDLPackage.DEFINITION__EBINDINGS: - return getEBindings(); - case WSDLPackage.DEFINITION__ESERVICES: - return getEServices(); - case WSDLPackage.DEFINITION__ENAMESPACES: - return getENamespaces(); - case WSDLPackage.DEFINITION__ETYPES: - return getETypes(); - case WSDLPackage.DEFINITION__EIMPORTS: - return getEImports(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.DEFINITION__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.DEFINITION__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.DEFINITION__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.DEFINITION__TARGET_NAMESPACE: - setTargetNamespace((String)newValue); - return; - case WSDLPackage.DEFINITION__LOCATION: - setLocation((String)newValue); - return; - case WSDLPackage.DEFINITION__QNAME: - setQName((QName)newValue); - return; - case WSDLPackage.DEFINITION__ENCODING: - setEncoding((String)newValue); - return; - case WSDLPackage.DEFINITION__EMESSAGES: - getEMessages().clear(); - getEMessages().addAll((Collection)newValue); - return; - case WSDLPackage.DEFINITION__EPORT_TYPES: - getEPortTypes().clear(); - getEPortTypes().addAll((Collection)newValue); - return; - case WSDLPackage.DEFINITION__EBINDINGS: - getEBindings().clear(); - getEBindings().addAll((Collection)newValue); - return; - case WSDLPackage.DEFINITION__ESERVICES: - getEServices().clear(); - getEServices().addAll((Collection)newValue); - return; - case WSDLPackage.DEFINITION__ENAMESPACES: - getENamespaces().clear(); - getENamespaces().addAll((Collection)newValue); - return; - case WSDLPackage.DEFINITION__ETYPES: - setETypes((Types)newValue); - return; - case WSDLPackage.DEFINITION__EIMPORTS: - getEImports().clear(); - getEImports().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.DEFINITION__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.DEFINITION__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.DEFINITION__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.DEFINITION__TARGET_NAMESPACE: - setTargetNamespace(TARGET_NAMESPACE_EDEFAULT); - return; - case WSDLPackage.DEFINITION__LOCATION: - setLocation(LOCATION_EDEFAULT); - return; - case WSDLPackage.DEFINITION__QNAME: - setQName(QNAME_EDEFAULT); - return; - case WSDLPackage.DEFINITION__ENCODING: - setEncoding(ENCODING_EDEFAULT); - return; - case WSDLPackage.DEFINITION__EMESSAGES: - getEMessages().clear(); - return; - case WSDLPackage.DEFINITION__EPORT_TYPES: - getEPortTypes().clear(); - return; - case WSDLPackage.DEFINITION__EBINDINGS: - getEBindings().clear(); - return; - case WSDLPackage.DEFINITION__ESERVICES: - getEServices().clear(); - return; - case WSDLPackage.DEFINITION__ENAMESPACES: - getENamespaces().clear(); - return; - case WSDLPackage.DEFINITION__ETYPES: - setETypes((Types)null); - return; - case WSDLPackage.DEFINITION__EIMPORTS: - getEImports().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.DEFINITION__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.DEFINITION__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.DEFINITION__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.DEFINITION__TARGET_NAMESPACE: - return TARGET_NAMESPACE_EDEFAULT == null ? targetNamespace != null : !TARGET_NAMESPACE_EDEFAULT.equals(targetNamespace); - case WSDLPackage.DEFINITION__LOCATION: - return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); - case WSDLPackage.DEFINITION__QNAME: - return QNAME_EDEFAULT == null ? qName != null : !QNAME_EDEFAULT.equals(qName); - case WSDLPackage.DEFINITION__ENCODING: - return ENCODING_EDEFAULT == null ? encoding != null : !ENCODING_EDEFAULT.equals(encoding); - case WSDLPackage.DEFINITION__EMESSAGES: - return eMessages != null && !eMessages.isEmpty(); - case WSDLPackage.DEFINITION__EPORT_TYPES: - return ePortTypes != null && !ePortTypes.isEmpty(); - case WSDLPackage.DEFINITION__EBINDINGS: - return eBindings != null && !eBindings.isEmpty(); - case WSDLPackage.DEFINITION__ESERVICES: - return eServices != null && !eServices.isEmpty(); - case WSDLPackage.DEFINITION__ENAMESPACES: - return eNamespaces != null && !eNamespaces.isEmpty(); - case WSDLPackage.DEFINITION__ETYPES: - return eTypes != null; - case WSDLPackage.DEFINITION__EIMPORTS: - return eImports != null && !eImports.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (targetNamespace: "); - result.append(targetNamespace); - result.append(", location: "); - result.append(location); - result.append(", qName: "); - result.append(qName); - result.append(", encoding: "); - result.append(encoding); - result.append(')'); - return result.toString(); - } - - // - // Hand-coded methods - // - - protected static ResourceSet globalResourceSet; - - public static synchronized ResourceSet getGlobalResourceSet() - { - if (globalResourceSet == null) - { - globalResourceSet = createResourceSet(); - //String baseURL = WSDLPlugin.INSTANCE.getBaseURL().toString(); - //System.out.println("Base URL is: " + baseURL); - } - - return globalResourceSet; - } - - public static ResourceSet createResourceSet() - { - ResourceSet result = new ResourceSetImpl(); - result.getResourceFactoryRegistry().getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl()); - return result; - } - - public static Definition createDefinition(Node node) - { - return createDefinition(node, null); - } - - public static Definition createDefinition(Node node, String location) - { - return createDefinition(node,location,true); - } - - public static Definition createDefinition(Node node, String location, boolean useExtensionFactories) - { - Definition definition = WSDLFactory.eINSTANCE.createDefinition(); - ((DefinitionImpl)definition).setUseExtensionFactories(useExtensionFactories); - definition.setElement((Element) node); - definition.setDocumentBaseURI(location); - return definition; - } - - private WSDLElement resolveWSDLElement(int type, List list, javax.xml.namespace.QName qname) - { - WSDLElement result = null; - if (qname != null) - { - for (Iterator i = list.iterator(); i.hasNext();) - { - WSDLElement wsdlElement = (WSDLElement) i.next(); - QName theQName = getQNameForWSDLElement(type, wsdlElement); - if (qname.equals(theQName)) - { - result = wsdlElement; - break; - } - } - } - return result; - } - - private HashMap createMap(int type, List list) - { - HashMap map = new HashMap(); - for (Iterator i = list.iterator(); i.hasNext();) - { - WSDLElement wsdlElement = (WSDLElement) i.next(); - QName theQName = getQNameForWSDLElement(type, wsdlElement); - if (theQName != null) - { - map.put(theQName, wsdlElement); - } - } - return map; - } - - private QName getQNameForWSDLElement(int type, WSDLElement wsdlElement) - { - QName result = null; - switch (type) - { - case WSDLConstants.MESSAGE : - result = ((Message) wsdlElement).getQName(); - break; - case WSDLConstants.PORT_TYPE : - result = ((PortType) wsdlElement).getQName(); - break; - case WSDLConstants.BINDING : - result = ((Binding) wsdlElement).getQName(); - break; - case WSDLConstants.SERVICE : - result = ((Service) wsdlElement).getQName(); - break; - } - return result; - } - - /* - * TBD - Revisit - * Look for an object in the imported definitions. - */ - private WSDLElement resolveWSDLElement(int type, javax.xml.namespace.QName qname) - { - WSDLElement result = null; - if (qname.getNamespaceURI() != null) - { - for (Iterator i = getDefinitions(qname.getNamespaceURI()).iterator(); i.hasNext();) - { - Definition definition = (Definition) i.next(); - switch (type) - { - case WSDLConstants.MESSAGE : - result = resolveWSDLElement(type, definition.getEMessages(), qname); - break; - case WSDLConstants.PORT_TYPE : - result = resolveWSDLElement(type, definition.getEPortTypes(), qname); - break; - case WSDLConstants.BINDING : - result = resolveWSDLElement(type, definition.getEBindings(), qname); - break; - case WSDLConstants.SERVICE : - result = resolveWSDLElement(type, definition.getEServices(), qname); - break; - } - if (result != null) - { - break; - } - } - } - return result; - } - - // - // Reconciliation methods - // - - public void setElement(Element element) - { - Element oldElement = getElement(); - if (oldElement instanceof EventTarget) - { - EventTarget oldEventTarget = ((EventTarget)oldElement); - oldEventTarget.removeEventListener("DOMNodeInserted", getEventListener(), true); - oldEventTarget.removeEventListener("DOMNodeRemoved", getEventListener(), true); - oldEventTarget.removeEventListener("DOMAttrModified", getEventListener(), true); - } - super.setElement(element); - if (element instanceof EventTarget) - { - EventTarget eventTarget = ((EventTarget)element); - eventTarget.addEventListener("DOMNodeInserted", getEventListener(), true); - eventTarget.addEventListener("DOMNodeRemoved", getEventListener(), true); - eventTarget.addEventListener("DOMAttrModified", getEventListener(), true); - } - if (element != null) - { - document = element.getOwnerDocument(); - } - } - - protected void reconcileAttributes(Element changedElement) - { - super.reconcileAttributes(changedElement); - - if (changedElement == getElement()) - { - if (changedElement.hasAttribute("targetNamespace")) - setTargetNamespace(changedElement.getAttribute("targetNamespace")); - if (changedElement.hasAttribute("name")) - setQName(new QName(WSDLConstants.WSDL_NAMESPACE_URI, changedElement.getAttribute("name"))); - getENamespaces().clear(); - getNamespaces().clear(); - //getNamespaces().put("", null); - - NamedNodeMap map = changedElement.getAttributes(); - int mapLength = map.getLength(); - for (int i = 0; i < mapLength; i++) - { - Attr attr = (Attr) map.item(i); - String nsPrefix = null; - if ("xmlns".equals(attr.getPrefix())) - { - nsPrefix = attr.getLocalName(); - } - else if ("xmlns".equals(attr.getNodeName())) - { - nsPrefix = ""; - } - - if (nsPrefix != null) - { - getNamespaces().put(nsPrefix, attr.getValue()); - } - } - } - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.BINDING : - { - Binding binding = WSDLFactory.eINSTANCE.createBinding(); - binding.setEnclosingDefinition(this); - binding.setElement(child); - addBinding(binding); - break; - } - case WSDLConstants.DOCUMENTATION : - { - // CS: we need to figure out how to unset this element when its removed - //definition.setDocumentationElement(child); - break; - } - case WSDLConstants.IMPORT : - { - Import i = WSDLFactory.eINSTANCE.createImport(); - i.setEnclosingDefinition(this); - i.setElement(child); - addImport(i); - break; - } - case WSDLConstants.MESSAGE : - { - Message message = WSDLFactory.eINSTANCE.createMessage(); - message.setEnclosingDefinition(this); - message.setElement(child); - addMessage(message); - break; - } - case WSDLConstants.PORT_TYPE : - { - PortType portType = WSDLFactory.eINSTANCE.createPortType(); - portType.setEnclosingDefinition(this); - portType.setElement(child); - addPortType(portType); - break; - } - case WSDLConstants.SERVICE : - { - Service service = WSDLFactoryImpl.eINSTANCE.createService(); - service.setEnclosingDefinition(this); - service.setElement(child); - addService(service); - break; - } - case WSDLConstants.TYPES : - { - if (getETypes() == null) - { - Types types = WSDLFactoryImpl.eINSTANCE.createTypes(); - types.setEnclosingDefinition(this); - types.setElement(child); - setETypes(types); - } - break; - } - default : - { - ExtensibilityElement extensibilityElement = getUseExtensionFactories() ? - ((WSDLFactoryImpl)WSDLFactory.eINSTANCE).createExtensibilityElement(getNamespace(child),getLocalName(child)) : - ((WSDLFactoryImpl)WSDLFactory.eINSTANCE).createUnknownExtensibilityElement(); - - extensibilityElement.setEnclosingDefinition(this); - extensibilityElement.setElement(child); - getEExtensibilityElements().add(extensibilityElement); - break; - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - reconcileReferences(true); - } - - protected void remove(Object component, Object modelObject) - { - if (modelObject instanceof Types) - { - Definition definition = (Definition) component; - if (definition.getETypes() == modelObject) - { - definition.setETypes(null); - } - } - else - { - List list = getList(component, modelObject); - if (list != null) - { - list.remove(modelObject); - } - } - } - - private List getList(Object component, Object modelObject) - { - List result = null; - Definition definition = (Definition) component; - - // todo... use WSDLSwitch - // - if (modelObject instanceof Binding) - { - result = definition.getEBindings(); - } - else if (modelObject instanceof Import) - { - result = definition.getEImports(); - } - else if (modelObject instanceof Message) - { - result = definition.getEMessages(); - } - else if (modelObject instanceof PortType) - { - result = definition.getEPortTypes(); - } - else if (modelObject instanceof Service) - { - result = definition.getEServices(); - } - else if (modelObject instanceof ExtensibilityElement) - { - result = definition.getEExtensibilityElements(); - } - return result; - } - - public Collection getModelObjects(Object component) - { - List list = new ArrayList(); - Definition definition = (Definition) component; - list.addAll(definition.getEImports()); - list.add(definition.getETypes()); - list.addAll(definition.getEMessages()); - list.addAll(definition.getEPortTypes()); - list.addAll(definition.getEBindings()); - list.addAll(definition.getEServices()); - list.addAll(definition.getEExtensibilityElements()); - return list; - } - - // - // For reconciliation: Model -> DOM - // - - public Document updateDocument() - { - document = createDocument(); - return document; - } - - private Document createDocument() - { - try - { - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - documentBuilderFactory.setNamespaceAware(true); - documentBuilderFactory.setValidating(false); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - return documentBuilder.newDocument(); - } - catch (ParserConfigurationException exception) - { - WSDLPlugin.INSTANCE.log(exception); - return null; - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.DEFINITION); - setElement(newElement); - addChildElements(newElement, getEExtensibilityElements()); - - Types types = getETypes(); - if (types != null) - { - Element child = ((TypesImpl) types).createElement(); - newElement.appendChild(child); - } - - addChildElements(newElement, getEImports()); - addChildElements(newElement, getEMessages()); - addChildElements(newElement, getEPortTypes()); - addChildElements(newElement, getEBindings()); - addChildElements(newElement, getEServices()); - - return newElement; - } - - protected void addChildElements(Element parent, List c) - { - for (Iterator iterator = c.iterator(); iterator.hasNext();) - { - WSDLElementImpl wsdlElement = (WSDLElementImpl) iterator.next(); - Element child = wsdlElement.createElement(); - parent.appendChild(child); - } - } - - protected void changeReference(EReference eReference) - { - // Add namespace prefix info - // TBD - Need to revisit. - Element theElement = getElement(); - if (eReference == null && theElement != null) - // We are updating the Definition element. - { - Iterator iterator = getNamespaces().entrySet().iterator(); - String prefix = null; - String uri = null; - while (iterator.hasNext()) - { - Map.Entry entry = (Map.Entry) iterator.next(); - prefix = (String) entry.getKey(); - uri = (String) entry.getValue(); - if (prefix != "") - theElement.setAttributeNS(XSDConstants.XMLNS_URI_2000, "xmlns:" + prefix, uri); - else if (uri != null) - // Handle default namespace, e.g. xmlns="http://schemas.xmlsoap.org/wsdl/" - theElement.setAttributeNS(XSDConstants.XMLNS_URI_2000, "xmlns", uri); - } - } - } - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - //if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getDefinition_Encoding()) - // niceSetAttribute(theElement, WSDLConstants.ENCODING_ATTRIBUTE, getEncoding()); - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getDefinition_QName()) - if (getQName() != null) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getQName().getLocalPart()); - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getDefinition_TargetNamespace()) - if (getTargetNamespace() != null) - niceSetAttribute(theElement, WSDLConstants.TARGETNAMESPACE_ATTRIBUTE, getTargetNamespace()); - } - } - - protected List getDefinitions(String namespace) - { - List list = new ArrayList(); - if (WSDLConstants.isMatchingNamespace(namespace, getTargetNamespace())) - { - list.add(this); - } - for (Iterator i = getImports(namespace).iterator(); i.hasNext();) - { - Import theImport = (Import) i.next(); - ((ImportImpl) theImport).importDefinitionOrSchema(); - Definition importedDefinition = theImport.getEDefinition(); - if (importedDefinition != null && WSDLConstants.isMatchingNamespace(namespace, importedDefinition.getTargetNamespace())) - { - list.add(importedDefinition); - } - } - return list; - } - - public XSDElementDeclaration resolveElementDeclarationURI(String uri) - { - XSDElementDeclaration result = null; - int index = uri.lastIndexOf("#"); - if (index != -1) - { - result = resolveElementDeclaration(uri.substring(0, index), uri.substring(index + 1)); - } - return result; - } - - private boolean isComponentDefined(XSDConcreteComponent component) - { - // note the getContainer() test to eliminate 'synthetic' types - // that are created by the XMLSchema model when resolution fails - return component != null && component.getContainer() != null; - } - - public XSDElementDeclaration resolveElementDeclaration(String namespace, String localName) - { - XSDElementDeclaration result = null; - for (Iterator i = resolveSchema(namespace).iterator(); i.hasNext();) - { - XSDSchema schema = (XSDSchema) i.next(); - result = schema.resolveElementDeclaration(namespace, localName); - if (isComponentDefined(result)) - return result; - } - - // Could not resolve. Try against all <import>ed and inlined schemas. - for (Iterator i = getImportedOrInlinedSchemas().iterator(); i.hasNext();) - { - XSDSchema schema = (XSDSchema)i.next(); - result = schema.resolveElementDeclaration(namespace, localName); - if (isComponentDefined(result)) - return result; - } - - return result; - } - - public XSDTypeDefinition resolveTypeDefinitionURI(String uri) - { - XSDTypeDefinition result = null; - int index = uri.lastIndexOf("#"); - if (index != -1) - { - result = resolveTypeDefinition(uri.substring(0, index), uri.substring(index + 1)); - } - return result; - } - - public XSDTypeDefinition resolveTypeDefinition(String namespace, String localName) - { - XSDTypeDefinition result = null; - for (Iterator i = resolveSchema(namespace).iterator(); i.hasNext();) - { - XSDSchema schema = (XSDSchema)i.next(); - result = schema.resolveTypeDefinition(namespace, localName); - if (isComponentDefined(result)) - return result; - } - - // Could not resolve. Try against all <import>ed and inlined schemas. - for (Iterator i = getImportedOrInlinedSchemas().iterator(); i.hasNext();) - { - XSDSchema schema = (XSDSchema)i.next(); - result = schema.resolveTypeDefinition(namespace, localName); - if (isComponentDefined(result)) - return result; - } - - return result; // Failed to resolve. - } - - /** - * This returns set of schemas with the given namespace as it's target namespace. - */ - public Collection resolveSchema(String namespace) - { - if ("".equals(namespace)) - { - namespace = null; - } - - if (XSDConstants.isSchemaForSchemaNamespace(namespace)) - { - return Collections.singleton(XSDSchemaImpl.getSchemaForSchema(namespace)); - } - else if (XSDConstants.isSchemaInstanceNamespace(namespace)) - { - return Collections.singleton(XSDSchemaImpl.getSchemaInstance(namespace)); - } - else - { - return getImportedOrInlinedSchemas(namespace); - } - } - - protected List getImportedOrInlinedSchemas(String namespace) - { - if (namespace == null) - { - namespace = ""; - } - - List list = new ArrayList(); - for (Iterator i = getEImports().iterator(); i.hasNext();) - { - Import theImport = (Import) i.next(); - if (WSDLConstants.isMatchingNamespace(theImport.getNamespaceURI(), namespace)) - { - ((ImportImpl) theImport).importDefinitionOrSchema(); - XSDSchema schema = theImport.getESchema(); - if (schema != null && WSDLConstants.isMatchingNamespace(schema.getTargetNamespace(), namespace)) - { - list.add(schema); - } - } - } - if (getETypes() != null) - { - for (Iterator i = getETypes().getSchemas().iterator(); i.hasNext();) - { - XSDSchema schema = (XSDSchema) i.next(); - String targetNamespace = schema.getTargetNamespace(); - if (namespace.equals(targetNamespace)) - { - list.add(schema); - } - - for (Iterator j = schema.getContents().iterator(); j.hasNext(); ) - { - Object component = j.next(); - if (component instanceof XSDImport) - { - XSDImport theImport = (XSDImport)component; - if (namespace.equals(theImport.getNamespace())) - { - ((XSDImportImpl)theImport).importSchema(); - XSDSchema importedSchema = theImport.getResolvedSchema(); - if (importedSchema != null) - { - list.add(importedSchema); - } - } - } - } - - } - } - return list; - } - - private List getImportedOrInlinedSchemas() - { - List list = new ArrayList(); - for (Iterator i = getEImports().iterator(); i.hasNext();) - { - Import theImport = (Import) i.next(); - ((ImportImpl) theImport).importDefinitionOrSchema(); - XSDSchema schema = theImport.getESchema(); - if (schema != null) - list.add(schema); - } - - if (getETypes() != null) - { - list.addAll(getETypes().getSchemas()); - } - return list; - } - - protected EventListener eventListener; - protected Node deletionNode; - - public Node getDeletionNode() - { - return deletionNode; - } - - protected EventListener getEventListener() - { - if (eventListener == null) - { - eventListener = - new EventListener() - { - public void handleEvent(Event event) - { - if (event instanceof MutationEvent) - { - MutationEvent mutationEvent = (MutationEvent)event; - if (mutationEvent.getTarget() instanceof Node) - { - Node node = (Node)mutationEvent.getTarget(); - while (node.getNodeType() != Node.ELEMENT_NODE) - { - node = node.getParentNode(); - } - if (mutationEvent.getAttrChange() == 0) - { - WSDLElementImpl listener = (WSDLElementImpl)getCorrespondingComponent(node.getParentNode()); - if (listener != null) - { - if (event.getType().equals("DOMNodeRemoved")) - { - deletionNode = (Node)event.getTarget(); - } - listener.elementContentsChanged((Element)node.getParentNode()); - deletionNode = null; - } - } - else - { - WSDLElementImpl listener = (WSDLElementImpl)getCorrespondingComponent(node); - if (listener != null) - { - listener.elementAttributesChanged((Element)node); - } - } - } - } - } - }; - } - return eventListener; - } - - public WSDLElement getCorrespondingComponent(Node node) - { - // We consider all parents so that they can handle other contained nodes that otherwise don't correspond to a component. - // - List parents = new ArrayList(); - - if (node.getNodeType() == Node.ATTRIBUTE_NODE) - { - node = ((Attr)node).getOwnerElement(); - } - else - { - // Skip ahead to an element. - // - for (Node scanNode = node; scanNode != null; scanNode = scanNode.getNextSibling()) - { - if (scanNode.getNodeType() == Node.ELEMENT_NODE) - { - node = scanNode; - break; - } - } - - // Skip back to an element. - // - for (Node scanNode = node; scanNode != null; scanNode = scanNode.getPreviousSibling()) - { - if (scanNode.getNodeType() == Node.ELEMENT_NODE) - { - node = scanNode; - break; - } - } - } - - // Navigate out through the elements. - // - for (Node parent = node; parent != null; parent = parent.getParentNode()) - { - if (parent.getNodeType() == Node.ELEMENT_NODE) - { - parents.add(parent); - } - } - - WSDLElement bestWSDLElement = getBestWSDLElement(parents); - return bestWSDLElement; - } - - // - // - // - private boolean useExtensionFactories = true; - - public void setUseExtensionFactories(boolean value) - { - useExtensionFactories = value; - } - - public boolean getUseExtensionFactories() - { - return useExtensionFactories; - } - - // See Bug 5366 - public void removeAll() - { - try - { - isReconciling = true; - document = null; - element = null; - getEServices().clear(); - getEBindings().clear(); - getEPortTypes().clear(); - getEMessages().clear(); - setETypes(null); - getEImports().clear(); - getEExtensibilityElements().clear(); - } - catch (Exception e) - { - - } - finally - { - isReconciling = false; - } - } - - public void setInlineSchemaLocations(Resource resource) - { - // Initialize the inline schemas location - Types types = this.getETypes(); - if (types != null) - { - for (Iterator j = types.getEExtensibilityElements().iterator(); j.hasNext();) - { - XSDSchemaExtensibilityElement el = (XSDSchemaExtensibilityElement) j.next(); - XSDSchema schema = el.getSchema(); - if (schema != null) - { - // We need this try-catch block in case we encounter an exception while attempting - // to resolve the schema. In the case of the WSDL Editor, we get a - // 'cannot create part exception'......See eclipse bugzilla bug 89855 - try - { - schema.setSchemaLocation(resource.getURI().toString()); - } - catch (Exception e) { - - } - } - } - } - } - -} //DefinitionImpl
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibilityElementImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibilityElementImpl.java deleted file mode 100644 index bb842472b..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibilityElementImpl.java +++ /dev/null @@ -1,409 +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; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Extensibility Element</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.ExtensibilityElementImpl#isRequired <em>Required</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ExtensibilityElementImpl#getElementType <em>Element Type</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ExtensibilityElementImpl extends WSDLElementImpl implements ExtensibilityElement -{ - /** - * The default value of the '{@link #isRequired() <em>Required</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isRequired() - * @generated - * @ordered - */ - protected static final boolean REQUIRED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isRequired() <em>Required</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isRequired() - * @generated - * @ordered - */ - protected boolean required = REQUIRED_EDEFAULT; - - /** - * The default value of the '{@link #getElementType() <em>Element Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElementType() - * @generated - * @ordered - */ - protected static final QName ELEMENT_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getElementType() <em>Element Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElementType() - * @generated - * @ordered - */ - protected QName elementType = ELEMENT_TYPE_EDEFAULT; - - private HashMap beanPropertyDescriptors; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ExtensibilityElementImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getExtensibilityElement(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isRequired() - { - return required; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setRequired(boolean newRequired) - { - boolean oldRequired = required; - required = newRequired; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.EXTENSIBILITY_ELEMENT__REQUIRED, oldRequired, required)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public QName getElementType() - { - if (elementType == null) - elementType = new QName(eClass().getEPackage().getNsURI(), eClass().getName()); - - return elementType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setElementType(QName newElementType) - { - QName oldElementType = elementType; - elementType = newElementType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT_TYPE, oldElementType, elementType)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT: - return getElement(); - case WSDLPackage.EXTENSIBILITY_ELEMENT__REQUIRED: - return isRequired() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - return getElementType(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.EXTENSIBILITY_ELEMENT__REQUIRED: - setRequired(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - setElementType((QName)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.EXTENSIBILITY_ELEMENT__REQUIRED: - setRequired(REQUIRED_EDEFAULT); - return; - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - setElementType(ELEMENT_TYPE_EDEFAULT); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.EXTENSIBILITY_ELEMENT__REQUIRED: - return required != REQUIRED_EDEFAULT; - case WSDLPackage.EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - return ELEMENT_TYPE_EDEFAULT == null ? elementType != null : !ELEMENT_TYPE_EDEFAULT.equals(elementType); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (required: "); - result.append(required); - result.append(", elementType: "); - result.append(elementType); - result.append(')'); - return result.toString(); - } - - /** - * @see javax.wsdl.extensions.ExtensibilityElement#getRequired() - */ - public Boolean getRequired() - { - return new Boolean(isRequired()); - } - - /** - * @see javax.wsdl.extensions.ExtensibilityElement#setRequired(Boolean) - */ - public void setRequired(Boolean required) - { - setRequired(required.booleanValue()); - } - - /** - * Returns the property descriptors for a given class. - */ - public java.util.Map getPropertyDescriptors(java.lang.Class clazz) - { - // Lookup properties cache - Map properties = null; - if (beanPropertyDescriptors == null) - beanPropertyDescriptors = new HashMap(); - else - properties = (Map) beanPropertyDescriptors.get(clazz); - - if (properties == null) - { - // Introspect the bean - ArrayList binfos = new ArrayList(); - try - { - BeanInfo binfo = Introspector.getBeanInfo(clazz); - if (binfo != null) - { - binfos.add(binfo); - BeanInfo[] abinfo = binfo.getAdditionalBeanInfo(); - if (abinfo != null) - { - for (int b = 0; b < abinfo.length; b++) - binfos.add(abinfo[b]); - } - } - } - catch (IntrospectionException e) - { - // TBD - handle exception - } - - properties = new HashMap(); - for (Iterator b = binfos.iterator(); b.hasNext();) - { - BeanInfo binfo = (BeanInfo) b.next(); - PropertyDescriptor[] pdesc = binfo.getPropertyDescriptors(); - if (pdesc == null) - continue; - for (int p = 0; p < pdesc.length; p++) - properties.put(pdesc[p].getName(), pdesc[p]); - } - beanPropertyDescriptors.put(clazz, properties); - } - return properties; - } - - // - // Reconcile methods - // - - public void setElement(Element element) - { - if (element == null && !isReconciling) - { - //System.out.println("ExtensibilityElement.setElement(): Preserving old element"); - } - else - { - setElementGen(element); - } - } - - public void reconcileAttributes(Element changedElement) - { - super.reconcileAttributes(changedElement); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - super.handleUnreconciledElement(child,remainingModelObjects); - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - super.handleReconciliation(remainingModelObjects); - } - - // - // For reconciliation: EMF -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - } - - public Element createElement() - { - Definition definition = getEnclosingDefinition(); - if (definition == null) - return null; - - Document document = definition.getDocument(); - if (document == null) - document = ((DefinitionImpl) definition).updateDocument(); - - Element newElement = null; - if (element != null) // This is an old element. - { - newElement = (Element) document.importNode(element, true); - element = newElement; - } - else - { - String namespace = getElementType().getNamespaceURI(); - String qualifier = definition.getPrefix(namespace); - newElement = document.createElementNS(namespace, (qualifier == null ? "" : qualifier + ":") + getElementType().getLocalPart()); - element = newElement; - } - - return newElement; - } -} //ExtensibilityElementImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java deleted file mode 100644 index d3ce61db3..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ExtensibleElementImpl.java +++ /dev/null @@ -1,238 +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; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.ExtensibleElement; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Extensible Element</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.ExtensibleElementImpl#getEExtensibilityElements <em>EExtensibility Elements</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public abstract class ExtensibleElementImpl extends WSDLElementImpl implements ExtensibleElement -{ - /** - * The cached value of the '{@link #getEExtensibilityElements() <em>EExtensibility Elements</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEExtensibilityElements() - * @generated - * @ordered - */ - protected EList eExtensibilityElements = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ExtensibleElementImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getExtensibleElement(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEExtensibilityElements() - { - if (eExtensibilityElements == null) - { - eExtensibilityElements = new EObjectContainmentEList(ExtensibilityElement.class, this, WSDLPackage.EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS); - } - return eExtensibilityElements; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public List getExtensibilityElements() - { - return getEExtensibilityElements(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void addExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement extElement) - { - getExtensibilityElements().add(extElement); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBLE_ELEMENT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.EXTENSIBLE_ELEMENT__ELEMENT: - return getElement(); - case WSDLPackage.EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBLE_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.EXTENSIBLE_ELEMENT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBLE_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.EXTENSIBLE_ELEMENT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.EXTENSIBLE_ELEMENT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.EXTENSIBLE_ELEMENT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - // - // - // - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - if (!WSDLConstants.isMatchingNamespace(child.getNamespaceURI(), WSDLConstants.WSDL_NAMESPACE_URI)) - { - ExtensibilityElement extensibilityElement = useExtensionFactories() ? - ((WSDLFactoryImpl)WSDLFactory.eINSTANCE).createExtensibilityElement(getNamespace(child),getLocalName(child)) : - ((WSDLFactoryImpl)WSDLFactory.eINSTANCE).createUnknownExtensibilityElement(); - - extensibilityElement.setEnclosingDefinition(getEnclosingDefinition()); - extensibilityElement.setElement(child); - getEExtensibilityElements().add(extensibilityElement); - } - } - - private boolean useExtensionFactories() - { - // Use extension factories by default. - return getEnclosingDefinition() == null ? - true : - ((DefinitionImpl)getEnclosingDefinition()).getUseExtensionFactories(); - } - -} //ExtensibleElementImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/FaultImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/FaultImpl.java deleted file mode 100644 index 3fb46044c..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/FaultImpl.java +++ /dev/null @@ -1,179 +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; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Fault</b></em>'. - * <!-- end-user-doc --> - * <p> - * </p> - * - * @generated - */ -public class FaultImpl extends MessageReferenceImpl implements Fault -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected FaultImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getFault(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message getMessage() - { - return getEMessage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setMessage(javax.wsdl.Message message) - { - setEMessage((Message) message); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.FAULT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.FAULT__ELEMENT: - return getElement(); - case WSDLPackage.FAULT__NAME: - return getName(); - case WSDLPackage.FAULT__EMESSAGE: - if (resolve) return getEMessage(); - return basicGetEMessage(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.FAULT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.FAULT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.FAULT__NAME: - setName((String)newValue); - return; - case WSDLPackage.FAULT__EMESSAGE: - setEMessage((org.eclipse.wst.wsdl.Message)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.FAULT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.FAULT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.FAULT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.FAULT__EMESSAGE: - setEMessage((org.eclipse.wst.wsdl.Message)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.FAULT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.FAULT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.FAULT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.FAULT__EMESSAGE: - return eMessage != null; - } - return eDynamicIsSet(eFeature); - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.FAULT); - setElement(newElement); - return newElement; - } -} //FaultImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java deleted file mode 100644 index 76c576ee9..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ImportImpl.java +++ /dev/null @@ -1,600 +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; - -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLModelLocator; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.eclipse.wst.wsdl.util.WSDLResourceImpl; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDResourceImpl; -import org.w3c.dom.Element; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Import</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.ImportImpl#getNamespaceURI <em>Namespace URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ImportImpl#getLocationURI <em>Location URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ImportImpl#getEDefinition <em>EDefinition</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ImportImpl#getESchema <em>ESchema</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ImportImpl extends WSDLElementImpl implements Import -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - protected boolean resolved; - - /** - * The default value of the '{@link #getNamespaceURI() <em>Namespace URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getNamespaceURI() - * @generated - * @ordered - */ - protected static final String NAMESPACE_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getNamespaceURI() <em>Namespace URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getNamespaceURI() - * @generated - * @ordered - */ - protected String namespaceURI = NAMESPACE_URI_EDEFAULT; - - /** - * The default value of the '{@link #getLocationURI() <em>Location URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLocationURI() - * @generated - * @ordered - */ - protected static final String LOCATION_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLocationURI() <em>Location URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLocationURI() - * @generated - * @ordered - */ - protected String locationURI = LOCATION_URI_EDEFAULT; - - /** - * The cached value of the '{@link #getEDefinition() <em>EDefinition</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEDefinition() - * @generated - * @ordered - */ - protected Definition eDefinition = null; - - /** - * The cached value of the '{@link #getESchema() <em>ESchema</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getESchema() - * @generated - * @ordered - */ - protected XSDSchema eSchema = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ImportImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getImport(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getNamespaceURI() - { - return namespaceURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setNamespaceURI(String newNamespaceURI) - { - String oldNamespaceURI = namespaceURI; - namespaceURI = newNamespaceURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.IMPORT__NAMESPACE_URI, oldNamespaceURI, namespaceURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getLocationURI() - { - return locationURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setLocationURI(String newLocationURI) - { - String oldLocationURI = locationURI; - locationURI = newLocationURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.IMPORT__LOCATION_URI, oldLocationURI, locationURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Definition getEDefinition() - { - if (eDefinition != null && eDefinition.eIsProxy()) - { - Definition oldEDefinition = eDefinition; - eDefinition = (Definition)eResolveProxy((InternalEObject)eDefinition); - if (eDefinition != oldEDefinition) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.IMPORT__EDEFINITION, oldEDefinition, eDefinition)); - } - } - return eDefinition; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Definition basicGetEDefinition() - { - return eDefinition; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEDefinition(Definition newEDefinition) - { - Definition oldEDefinition = eDefinition; - eDefinition = newEDefinition; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.IMPORT__EDEFINITION, oldEDefinition, eDefinition)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDSchema getESchema() - { - if (eSchema != null && eSchema.eIsProxy()) - { - XSDSchema oldESchema = eSchema; - eSchema = (XSDSchema)eResolveProxy((InternalEObject)eSchema); - if (eSchema != oldESchema) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.IMPORT__ESCHEMA, oldESchema, eSchema)); - } - } - return eSchema; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDSchema basicGetESchema() - { - return eSchema; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setESchema(XSDSchema newESchema) - { - XSDSchema oldESchema = eSchema; - eSchema = newESchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.IMPORT__ESCHEMA, oldESchema, eSchema)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public XSDSchema getSchema() - { - return getESchema(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setSchema(XSDSchema schema) - { - setESchema(schema); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.IMPORT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.IMPORT__ELEMENT: - return getElement(); - case WSDLPackage.IMPORT__NAMESPACE_URI: - return getNamespaceURI(); - case WSDLPackage.IMPORT__LOCATION_URI: - return getLocationURI(); - case WSDLPackage.IMPORT__EDEFINITION: - if (resolve) return getEDefinition(); - return basicGetEDefinition(); - case WSDLPackage.IMPORT__ESCHEMA: - if (resolve) return getESchema(); - return basicGetESchema(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.IMPORT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.IMPORT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.IMPORT__NAMESPACE_URI: - setNamespaceURI((String)newValue); - return; - case WSDLPackage.IMPORT__LOCATION_URI: - setLocationURI((String)newValue); - return; - case WSDLPackage.IMPORT__EDEFINITION: - setEDefinition((Definition)newValue); - return; - case WSDLPackage.IMPORT__ESCHEMA: - setESchema((XSDSchema)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.IMPORT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.IMPORT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.IMPORT__NAMESPACE_URI: - setNamespaceURI(NAMESPACE_URI_EDEFAULT); - return; - case WSDLPackage.IMPORT__LOCATION_URI: - setLocationURI(LOCATION_URI_EDEFAULT); - return; - case WSDLPackage.IMPORT__EDEFINITION: - setEDefinition((Definition)null); - return; - case WSDLPackage.IMPORT__ESCHEMA: - setESchema((XSDSchema)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.IMPORT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.IMPORT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.IMPORT__NAMESPACE_URI: - return NAMESPACE_URI_EDEFAULT == null ? namespaceURI != null : !NAMESPACE_URI_EDEFAULT.equals(namespaceURI); - case WSDLPackage.IMPORT__LOCATION_URI: - return LOCATION_URI_EDEFAULT == null ? locationURI != null : !LOCATION_URI_EDEFAULT.equals(locationURI); - case WSDLPackage.IMPORT__EDEFINITION: - return eDefinition != null; - case WSDLPackage.IMPORT__ESCHEMA: - return eSchema != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (namespaceURI: "); - result.append(namespaceURI); - result.append(", locationURI: "); - result.append(locationURI); - result.append(')'); - return result.toString(); - } - - /** - * @see Import#getDefinition() - */ - public javax.wsdl.Definition getDefinition() - { - return getEDefinition(); - } - - /** - * @see Import#setDefinition(Definition) - */ - public void setDefinition(javax.wsdl.Definition definition) - { - setEDefinition((org.eclipse.wst.wsdl.Definition) definition); - } - - // - // Reconcile methods - // - public void reconcileAttributes(Element changedElement) - { - setNamespaceURI(WSDLConstants.getAttribute(changedElement, WSDLConstants.NAMESPACE_ATTRIBUTE)); - setLocationURI(WSDLConstants.getAttribute(changedElement, WSDLConstants.LOCATION_ATTRIBUTE)); - } - - // - // For reconciliation: Model -> DOM - // - protected void changeAttribute(EAttribute eAttribute) - { - // We need to set this boolean to false because the Import may point to a different location. - // So we need we should view this import as unresolved. - resolved = false; - - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getImport_NamespaceURI()) - niceSetAttribute(theElement, WSDLConstants.NAMESPACE_ATTRIBUTE, getNamespaceURI()); - - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getImport_LocationURI()) - niceSetAttribute(theElement, WSDLConstants.LOCATION_ATTRIBUTE, getLocationURI()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.IMPORT); - setElement(newElement); - return newElement; - } - - public void importDefinitionOrSchema() - { - resolve(getNamespaceURI(), getLocationURI()); - } - - protected void resolve(String namespace, String location) - { - if (!resolved) - { - // KB: bugzilla 118293 - // If a user changes <wsdl:import> from a WSDL file to an XML Schema file - // or the other way around, we should set the variable for the first - // <wsdl:import> source to null. Here I am simply setting both variables to null, - // which will have the same effect. - eDefinition = null; - eSchema = null; - - Definition definition = getEnclosingDefinition(); - if (definition != null && definition.getDocumentBaseURI() != null) - { - Resource resource = definition.eResource(); - if (resource != null) - { - ResourceSet resourceSet = resource.getResourceSet(); - if (resourceSet != null) - { - if (namespace == null) - { - namespace = definition.getTargetNamespace(); - } - - String resolvedLocation = resolveLocation(definition, namespace, location); - - URI uri = URI.createURI(resolvedLocation); - Resource resolvedResource = resourceSet.getResource(uri, false); - if (resolvedResource == null) - { - try - { - InputStream inputStream = resourceSet.getURIConverter().createInputStream(uri); - resolvedResource = resourceSet.createResource(uri); - resolvedResource.load(inputStream, resourceSet.getLoadOptions()); - } - catch (IOException exception) - { - // It is generally not an error to fail to resolve. - // If a resource is actually created, - // which happens only when we can create an input stream, - // then it's an error if it's not a good wsdl or schema - } - } - - if (resolvedResource != null) - { - if (resolvedResource instanceof WSDLResourceImpl) - { - eDefinition = ((WSDLResourceImpl) resolvedResource).getDefinition(); - } - else if (resolvedResource instanceof XSDResourceImpl) - { - eSchema = ((XSDResourceImpl) resolvedResource).getSchema(); - } - else - { - eDefinition = WSDLFactory.eINSTANCE.createDefinition(); - } - } - resolved = true; - } - } - } - } - } - - protected String resolveLocation(Definition definition, String namespace, String schemaLocation) - { - String result = null; - WSDLModelLocator locator = (WSDLModelLocator)EcoreUtil.getRegisteredAdapter(definition.eResource(), WSDLModelLocator.class); - if (locator != null) - { - result = locator.resolveURI(definition.getDocumentBaseURI(), namespace, schemaLocation); - } - else - { - // TODO... there's some default resolving we'll need to do here - // see XSDSchemaDirective - URI baseLocationURI = createURI(definition.getDocumentBaseURI()); - URI locationURI = URI.createURI(schemaLocation); - return locationURI.resolve(baseLocationURI).toString(); - } - return result; - } - - //TODO... push down to EMF - private static URI createURI(String uriString) - { - if (hasProtocol(uriString)) - return URI.createURI(uriString); - else - return URI.createFileURI(uriString); - } - - //TODO... push down to EMF - private static 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; - } -} //ImportImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/InputImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/InputImpl.java deleted file mode 100644 index d5aaa7cc6..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/InputImpl.java +++ /dev/null @@ -1,179 +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; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Input</b></em>'. - * <!-- end-user-doc --> - * <p> - * </p> - * - * @generated - */ -public class InputImpl extends MessageReferenceImpl implements Input -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected InputImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getInput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message getMessage() - { - return getEMessage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setMessage(javax.wsdl.Message message) - { - setEMessage((Message) message); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.INPUT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.INPUT__ELEMENT: - return getElement(); - case WSDLPackage.INPUT__NAME: - return getName(); - case WSDLPackage.INPUT__EMESSAGE: - if (resolve) return getEMessage(); - return basicGetEMessage(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.INPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.INPUT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.INPUT__NAME: - setName((String)newValue); - return; - case WSDLPackage.INPUT__EMESSAGE: - setEMessage((org.eclipse.wst.wsdl.Message)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.INPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.INPUT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.INPUT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.INPUT__EMESSAGE: - setEMessage((org.eclipse.wst.wsdl.Message)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.INPUT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.INPUT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.INPUT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.INPUT__EMESSAGE: - return eMessage != null; - } - return eDynamicIsSet(eFeature); - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.INPUT); - setElement(newElement); - return newElement; - } -} //InputImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java deleted file mode 100644 index ed6a0cf4d..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageImpl.java +++ /dev/null @@ -1,617 +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; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Message</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.MessageImpl#getQName <em>QName</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.MessageImpl#isUndefined <em>Undefined</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.MessageImpl#isProxy <em>Proxy</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.MessageImpl#getResourceURI <em>Resource URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.MessageImpl#getEParts <em>EParts</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class MessageImpl extends WSDLElementImpl implements Message -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected static final QName QNAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected QName qName = QNAME_EDEFAULT; - - /** - * The default value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected static final boolean UNDEFINED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected boolean undefined = UNDEFINED_EDEFAULT; - - /** - * The default value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected static final boolean PROXY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected boolean proxy = PROXY_EDEFAULT; - - /** - * The default value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected static final String RESOURCE_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected String resourceURI = RESOURCE_URI_EDEFAULT; - - /** - * The cached value of the '{@link #getEParts() <em>EParts</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEParts() - * @generated - * @ordered - */ - protected EList eParts = null; - - private Map parts; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected MessageImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getMessage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getQName() - { - return qName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setQName(QName newQName) - { - QName oldQName = qName; - qName = newQName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.MESSAGE__QNAME, oldQName, qName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isUndefined() - { - return undefined; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUndefined(boolean newUndefined) - { - boolean oldUndefined = undefined; - undefined = newUndefined; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.MESSAGE__UNDEFINED, oldUndefined, undefined)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isProxy() - { - return proxy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setProxy(boolean newProxy) - { - boolean oldProxy = proxy; - proxy = newProxy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.MESSAGE__PROXY, oldProxy, proxy)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getResourceURI() - { - return resourceURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setResourceURI(String newResourceURI) - { - String oldResourceURI = resourceURI; - resourceURI = newResourceURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.MESSAGE__RESOURCE_URI, oldResourceURI, resourceURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEParts() - { - if (eParts == null) - { - eParts = new EObjectContainmentEList(Part.class, this, WSDLPackage.MESSAGE__EPARTS); - } - return eParts; - } - - /** - * <!-- begin-user-doc --> - * Add a part to this message. - * @param part the part to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addPart(javax.wsdl.Part part) - { - getEParts().add((Part)part); - } - - /** - * <!-- begin-user-doc --> - * Get the specified part. - * @param name the name of the desired part. - * @return the corresponding part, or null if there wasn't - * any matching part - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Part getPart(String name) - { - Part result = null; - for (Iterator i = getEParts().iterator(); i.hasNext();) - { - Part part = (Part) i.next(); - if (name.equals(part.getName())) - { - result = part; - break; - } - } - return result; - } - - /** - * <!-- begin-user-doc --> - * Get all the parts defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getParts() - { - HashMap hashMap = new HashMap(); - for (Iterator i = getEParts().iterator(); i.hasNext();) - { - Part part = (Part) i.next(); - hashMap.put(part.getName(), part); - } - return hashMap; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public List getOrderedParts(List partOrder) - { - List orderedParts = new Vector(); - if (partOrder == null) - { - orderedParts.addAll(getEParts()); - return orderedParts; - } - - Iterator partNameIterator = partOrder.iterator(); - while (partNameIterator.hasNext()) - { - String partName = (String) partNameIterator.next(); - javax.wsdl.Part part = getPart(partName); - if (part != null) - orderedParts.add(part); - } - - return orderedParts; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.MESSAGE__EPARTS: - return ((InternalEList)getEParts()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.MESSAGE__ELEMENT: - return getElement(); - case WSDLPackage.MESSAGE__QNAME: - return getQName(); - case WSDLPackage.MESSAGE__UNDEFINED: - return isUndefined() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.MESSAGE__PROXY: - return isProxy() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.MESSAGE__RESOURCE_URI: - return getResourceURI(); - case WSDLPackage.MESSAGE__EPARTS: - return getEParts(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.MESSAGE__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.MESSAGE__QNAME: - setQName((QName)newValue); - return; - case WSDLPackage.MESSAGE__UNDEFINED: - setUndefined(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.MESSAGE__PROXY: - setProxy(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.MESSAGE__RESOURCE_URI: - setResourceURI((String)newValue); - return; - case WSDLPackage.MESSAGE__EPARTS: - getEParts().clear(); - getEParts().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.MESSAGE__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.MESSAGE__QNAME: - setQName(QNAME_EDEFAULT); - return; - case WSDLPackage.MESSAGE__UNDEFINED: - setUndefined(UNDEFINED_EDEFAULT); - return; - case WSDLPackage.MESSAGE__PROXY: - setProxy(PROXY_EDEFAULT); - return; - case WSDLPackage.MESSAGE__RESOURCE_URI: - setResourceURI(RESOURCE_URI_EDEFAULT); - return; - case WSDLPackage.MESSAGE__EPARTS: - getEParts().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.MESSAGE__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.MESSAGE__QNAME: - return QNAME_EDEFAULT == null ? qName != null : !QNAME_EDEFAULT.equals(qName); - case WSDLPackage.MESSAGE__UNDEFINED: - return undefined != UNDEFINED_EDEFAULT; - case WSDLPackage.MESSAGE__PROXY: - return proxy != PROXY_EDEFAULT; - case WSDLPackage.MESSAGE__RESOURCE_URI: - return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI); - case WSDLPackage.MESSAGE__EPARTS: - return eParts != null && !eParts.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (qName: "); - result.append(qName); - result.append(", undefined: "); - result.append(undefined); - result.append(", proxy: "); - result.append(proxy); - result.append(", resourceURI: "); - result.append(resourceURI); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - Definition definition = getEnclosingDefinition(); - String newName = null; - if (changedElement.hasAttribute("name")) - { - newName = changedElement.getAttribute("name"); - } - if (newName != null) - { - QName qname = new QName(definition.getTargetNamespace(), newName); - setQName(qname); - } - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.PART : - { - Part part = ((WSDLPackage) EPackage.Registry.INSTANCE.getEPackage(WSDLPackage.eNS_URI)).getWSDLFactory().createPart(); - part.setEnclosingDefinition(getEnclosingDefinition()); - part.setElement(child); - getEParts().add(part); - break; - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - } - - protected void remove(Object component, Object modelObject) - { - Message message = (Message) component; - if (modelObject instanceof Part) - { - message.getEParts().clear(); - } - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getMessage_QName()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getQName().getLocalPart()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.MESSAGE); - setElement(newElement); - - Iterator iterator = getEParts().iterator(); - while (iterator.hasNext()) - { - Object obj = iterator.next(); - if (obj instanceof Part) - { - Part part = (Part) obj; - Element child = ((PartImpl) part).createElement(); - newElement.appendChild(child); - } - } - return newElement; - } -} //MessageImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java deleted file mode 100644 index 96a7b9004..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/MessageReferenceImpl.java +++ /dev/null @@ -1,344 +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; - -import java.util.Collection; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.MessageReference; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Message Reference</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.MessageReferenceImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.MessageReferenceImpl#getEMessage <em>EMessage</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public abstract class MessageReferenceImpl extends WSDLElementImpl implements MessageReference -{ - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getEMessage() <em>EMessage</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEMessage() - * @generated - * @ordered - */ - protected Message eMessage = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected MessageReferenceImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getMessageReference(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.MESSAGE_REFERENCE__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Message getEMessage() - { - if (eMessage != null && eMessage.eIsProxy()) - { - Message oldEMessage = eMessage; - eMessage = (Message)eResolveProxy((InternalEObject)eMessage); - if (eMessage != oldEMessage) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.MESSAGE_REFERENCE__EMESSAGE, oldEMessage, eMessage)); - } - } - return eMessage; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Message basicGetEMessage() - { - return eMessage; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEMessage(Message newEMessage) - { - Message oldEMessage = eMessage; - eMessage = newEMessage; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.MESSAGE_REFERENCE__EMESSAGE, oldEMessage, eMessage)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE_REFERENCE__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.MESSAGE_REFERENCE__ELEMENT: - return getElement(); - case WSDLPackage.MESSAGE_REFERENCE__NAME: - return getName(); - case WSDLPackage.MESSAGE_REFERENCE__EMESSAGE: - if (resolve) return getEMessage(); - return basicGetEMessage(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE_REFERENCE__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.MESSAGE_REFERENCE__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.MESSAGE_REFERENCE__NAME: - setName((String)newValue); - return; - case WSDLPackage.MESSAGE_REFERENCE__EMESSAGE: - setEMessage((Message)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE_REFERENCE__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.MESSAGE_REFERENCE__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.MESSAGE_REFERENCE__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.MESSAGE_REFERENCE__EMESSAGE: - setEMessage((Message)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.MESSAGE_REFERENCE__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.MESSAGE_REFERENCE__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.MESSAGE_REFERENCE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.MESSAGE_REFERENCE__EMESSAGE: - return eMessage != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - - // - // Reconciliation methods - // - - public void reconcileAttributes(Element changedElement) - { - setName(WSDLConstants.getAttribute(changedElement, "name")); - reconcileReferences(false); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getMessageReference_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - } - } - - protected void changeReference(EReference eReference) - { - if (isReconciling) - return; - - super.changeReference(eReference); - Element theElement = getElement(); - if (theElement != null) - { - if (eReference == null || eReference == WSDLPackage.eINSTANCE.getMessageReference_EMessage()) - { - Message message = getEMessage(); - if (message != null) - { - QName qName = message.getQName(); - niceSetAttributeURIValue(theElement, WSDLConstants.MESSAGE_ATTRIBUTE, qName.getNamespaceURI() + "#" + qName.getLocalPart()); - } - } - } - } - - public void reconcileReferences(boolean deep) - { - if (element != null) - { - Definition definition = getEnclosingDefinition(); - QName messageQName = createQName(definition, element.getAttribute("message")); - Message newMessage = messageQName != null ? (Message) definition.getMessage(messageQName) : null; - if (newMessage != getEMessage()) - { - setEMessage(newMessage); - } - } - super.reconcileReferences(deep); - } -} //MessageReferenceImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/NamespaceImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/NamespaceImpl.java deleted file mode 100644 index e0c28a954..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/NamespaceImpl.java +++ /dev/null @@ -1,234 +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; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.WSDLPackage; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Namespace</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.NamespaceImpl#getURI <em>URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.NamespaceImpl#getPrefix <em>Prefix</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class NamespaceImpl extends EObjectImpl implements Namespace -{ - /** - * The default value of the '{@link #getURI() <em>URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getURI() - * @generated - * @ordered - */ - protected static final String URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getURI() <em>URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getURI() - * @generated - * @ordered - */ - protected String uri = URI_EDEFAULT; - - /** - * The default value of the '{@link #getPrefix() <em>Prefix</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPrefix() - * @generated - * @ordered - */ - protected static final String PREFIX_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPrefix() <em>Prefix</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getPrefix() - * @generated - * @ordered - */ - protected String prefix = PREFIX_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected NamespaceImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getNamespace(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getURI() - { - return uri; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setURI(String newURI) - { - String oldURI = uri; - uri = newURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.NAMESPACE__URI, oldURI, uri)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getPrefix() - { - return prefix; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setPrefix(String newPrefix) - { - String oldPrefix = prefix; - prefix = newPrefix; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.NAMESPACE__PREFIX, oldPrefix, prefix)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.NAMESPACE__URI: - return getURI(); - case WSDLPackage.NAMESPACE__PREFIX: - return getPrefix(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.NAMESPACE__URI: - setURI((String)newValue); - return; - case WSDLPackage.NAMESPACE__PREFIX: - setPrefix((String)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.NAMESPACE__URI: - setURI(URI_EDEFAULT); - return; - case WSDLPackage.NAMESPACE__PREFIX: - setPrefix(PREFIX_EDEFAULT); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.NAMESPACE__URI: - return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri); - case WSDLPackage.NAMESPACE__PREFIX: - return PREFIX_EDEFAULT == null ? prefix != null : !PREFIX_EDEFAULT.equals(prefix); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (URI: "); - result.append(uri); - result.append(", prefix: "); - result.append(prefix); - result.append(')'); - return result.toString(); - } - -} //NamespaceImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java deleted file mode 100644 index b0235fce2..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OperationImpl.java +++ /dev/null @@ -1,1199 +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; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.wsdl.OperationType; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Operation</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getStyle <em>Style</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#isUndefined <em>Undefined</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#isProxy <em>Proxy</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getResourceURI <em>Resource URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getEInput <em>EInput</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getEOutput <em>EOutput</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getEFaults <em>EFaults</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.OperationImpl#getEParameterOrdering <em>EParameter Ordering</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class OperationImpl extends WSDLElementImpl implements Operation -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getStyle() <em>Style</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getStyle() - * @generated - * @ordered - */ - protected static final OperationType STYLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getStyle() <em>Style</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getStyle() - * @generated - * @ordered - */ - protected OperationType style = STYLE_EDEFAULT; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected static final boolean UNDEFINED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected boolean undefined = UNDEFINED_EDEFAULT; - - /** - * The default value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected static final boolean PROXY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected boolean proxy = PROXY_EDEFAULT; - - /** - * The default value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected static final String RESOURCE_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected String resourceURI = RESOURCE_URI_EDEFAULT; - - /** - * The cached value of the '{@link #getEInput() <em>EInput</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEInput() - * @generated - * @ordered - */ - protected Input eInput = null; - - /** - * The cached value of the '{@link #getEOutput() <em>EOutput</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEOutput() - * @generated - * @ordered - */ - protected Output eOutput = null; - - /** - * The cached value of the '{@link #getEFaults() <em>EFaults</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEFaults() - * @generated - * @ordered - */ - protected EList eFaults = null; - - /** - * The cached value of the '{@link #getEParameterOrdering() <em>EParameter Ordering</em>}' reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEParameterOrdering() - * @generated - * @ordered - */ - protected EList eParameterOrdering = null; // a list of parts (EMF) - - private List parameterOrdering = null; // a list of part names (WSDL4J) - - private Map faults; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected OperationImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getOperation(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public OperationType getStyle() - { - if (style == null) - style = deduceOperationType(getElement()); - - // The value of style is updated when - // 1) the WSDL is loaded for the first time, - // 2) the setStyle() method is called, and - // 3) the children of the Operation (DOM) element are manipulated. - return style; - } - - private OperationType deduceOperationType(Element operation) - { - if (operation == null) - return null; - - int state = 0; - int messageRefType = -1; - Node child = null; - NodeList children = operation.getChildNodes(); - - for (int i=0; i<children.getLength(); i++) - { - child = children.item(i); - if (child.getNodeType() != Node.ELEMENT_NODE) - continue; - - messageRefType = WSDLUtil.getInstance().getWSDLType((Element)child); - switch (state) - { - case 0: // initial state - if (WSDLConstants.INPUT == messageRefType) - state = 1; - else if (WSDLConstants.OUTPUT == messageRefType) - state = 2; - else if (WSDLConstants.DOCUMENTATION == messageRefType) - state = 0; - else - state = -1; // cannot happen - break; - case 1: // one-way or request-response - if (WSDLConstants.FAULT == messageRefType) - state = 11; // one-way - else if (WSDLConstants.OUTPUT == messageRefType) - state = 3; // request-response - else - state = -1; // cannot happen - break; - case 11: // one-way - if (WSDLConstants.FAULT == messageRefType) - state = 11; // one-way - else - state = -1; // cannot happen - break; - case 2: // solicit-response or notification - if (WSDLConstants.INPUT == messageRefType) - state = 4; // solicit-response - else if (WSDLConstants.FAULT == messageRefType) - state = 21; // notification - else - state = -1; // cannot happen - break; - case 21: // notification - if (WSDLConstants.FAULT == messageRefType) - state = 21; // notification - else - state = -1; // cannot happen - break; - case 3: // request-response - if (WSDLConstants.FAULT == messageRefType) - state = 3; - else - state = -1; // cannot happen - break; - case 4: // solicit-response - if (WSDLConstants.FAULT == messageRefType) - state = 4; - else - state = -1; // cannot happen - break; - default: // cannot happen (-1) - break; - } - } - - OperationType opType = null; - switch (state) - { - case 1: - case 11: - opType = OperationType.ONE_WAY; - break; - case 2: - case 21: - opType = OperationType.NOTIFICATION; - break; - case 3: - opType = OperationType.REQUEST_RESPONSE; - break; - case 4: - opType = OperationType.SOLICIT_RESPONSE; - break; - default: // invalid - break; - } - return opType; - } - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setStyle(OperationType newStyle) - { - OperationType oldStyle = style; - style = newStyle; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__STYLE, oldStyle, style)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isUndefined() - { - return undefined; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUndefined(boolean newUndefined) - { - boolean oldUndefined = undefined; - undefined = newUndefined; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__UNDEFINED, oldUndefined, undefined)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isProxy() - { - return proxy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setProxy(boolean newProxy) - { - boolean oldProxy = proxy; - proxy = newProxy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__PROXY, oldProxy, proxy)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getResourceURI() - { - return resourceURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setResourceURI(String newResourceURI) - { - String oldResourceURI = resourceURI; - resourceURI = newResourceURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__RESOURCE_URI, oldResourceURI, resourceURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Input getEInput() - { - return eInput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetEInput(Input newEInput, NotificationChain msgs) - { - Input oldEInput = eInput; - eInput = newEInput; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__EINPUT, oldEInput, newEInput); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEInput(Input newEInput) - { - if (newEInput != eInput) - { - NotificationChain msgs = null; - if (eInput != null) - msgs = ((InternalEObject)eInput).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.OPERATION__EINPUT, null, msgs); - if (newEInput != null) - msgs = ((InternalEObject)newEInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.OPERATION__EINPUT, null, msgs); - msgs = basicSetEInput(newEInput, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__EINPUT, newEInput, newEInput)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Output getEOutput() - { - return eOutput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetEOutput(Output newEOutput, NotificationChain msgs) - { - Output oldEOutput = eOutput; - eOutput = newEOutput; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__EOUTPUT, oldEOutput, newEOutput); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEOutput(Output newEOutput) - { - if (newEOutput != eOutput) - { - NotificationChain msgs = null; - if (eOutput != null) - msgs = ((InternalEObject)eOutput).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.OPERATION__EOUTPUT, null, msgs); - if (newEOutput != null) - msgs = ((InternalEObject)newEOutput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.OPERATION__EOUTPUT, null, msgs); - msgs = basicSetEOutput(newEOutput, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.OPERATION__EOUTPUT, newEOutput, newEOutput)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEFaults() - { - if (eFaults == null) - { - eFaults = new EObjectContainmentEList(Fault.class, this, WSDLPackage.OPERATION__EFAULTS); - } - return eFaults; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEParameterOrdering() - { - if (eParameterOrdering == null) - { - eParameterOrdering = new EObjectResolvingEList(Part.class, this, WSDLPackage.OPERATION__EPARAMETER_ORDERING); - } - return eParameterOrdering; - } - - /** - * <!-- begin-user-doc --> - * Add a fault message that must be associated with this - * operation. - * @param fault the new fault message - * <!-- end-user-doc --> - * @generated NOT - */ - public void addFault(javax.wsdl.Fault fault) - { - getEFaults().add((Fault)fault); - } - - /** - * <!-- begin-user-doc --> - * Get the specified fault message. - * @param name the name of the desired fault message. - * @return the corresponding fault message, or null if there wasn't - * any matching message - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Fault getFault(String name) - { - Fault result = null; - for (Iterator i = getEFaults().iterator(); i.hasNext();) - { - Fault fault = (Fault) i.next(); - if (name.equals(fault.getName())) - { - result = fault; - break; - } - } - return result; - } - - /** - * <!-- begin-user-doc --> - * Get all the fault messages associated with this operation. - * @return names of fault messages - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getFaults() - { - HashMap hashMap = new HashMap(); - for (Iterator i = getEFaults().iterator(); i.hasNext();) - { - Fault fault = (Fault) i.next(); - hashMap.put(fault.getName(), fault); - } - return hashMap; - } - - /** - * <!-- begin-user-doc --> - * Returns a collection of Part names. Note that - * getParameterEOrdering() returns a collection of Parts. - * <!-- end-user-doc --> - * @generated NOT - */ - public List getParameterOrdering() - { - parameterOrdering = new ArrayList(); - for (Iterator i = getEParameterOrdering().iterator(); i.hasNext();) - { - try - { - Part part = (Part) i.next(); - parameterOrdering.add(part.getName()); - } - catch (Exception e) - { - // TBD - handle exception - } - } - return parameterOrdering.isEmpty() ? null : parameterOrdering; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setParameterOrdering(List parameterOrder) - { - parameterOrdering = parameterOrder; - getEParameterOrdering().clear(); - if (parameterOrder != null) - { - for (Iterator i = parameterOrder.iterator(); i.hasNext();) - { - // KB: We should be resolving parts based on the part names in parameterOrder. - Part part = WSDLFactory.eINSTANCE.createPart(); - part.setName((String) i.next()); - getEParameterOrdering().add(part); - } - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Input getInput() - { - return getEInput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setInput(javax.wsdl.Input input) - { - setEInput((Input) input); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Output getOutput() - { - return getEOutput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setOutput(javax.wsdl.Output output) - { - setEOutput((Output) output); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.OPERATION__EINPUT: - return basicSetEInput(null, msgs); - case WSDLPackage.OPERATION__EOUTPUT: - return basicSetEOutput(null, msgs); - case WSDLPackage.OPERATION__EFAULTS: - return ((InternalEList)getEFaults()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OPERATION__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.OPERATION__ELEMENT: - return getElement(); - case WSDLPackage.OPERATION__STYLE: - return getStyle(); - case WSDLPackage.OPERATION__NAME: - return getName(); - case WSDLPackage.OPERATION__UNDEFINED: - return isUndefined() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.OPERATION__PROXY: - return isProxy() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.OPERATION__RESOURCE_URI: - return getResourceURI(); - case WSDLPackage.OPERATION__EINPUT: - return getEInput(); - case WSDLPackage.OPERATION__EOUTPUT: - return getEOutput(); - case WSDLPackage.OPERATION__EFAULTS: - return getEFaults(); - case WSDLPackage.OPERATION__EPARAMETER_ORDERING: - return getEParameterOrdering(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OPERATION__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.OPERATION__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.OPERATION__STYLE: - setStyle((OperationType)newValue); - return; - case WSDLPackage.OPERATION__NAME: - setName((String)newValue); - return; - case WSDLPackage.OPERATION__UNDEFINED: - setUndefined(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.OPERATION__PROXY: - setProxy(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.OPERATION__RESOURCE_URI: - setResourceURI((String)newValue); - return; - case WSDLPackage.OPERATION__EINPUT: - setEInput((Input)newValue); - return; - case WSDLPackage.OPERATION__EOUTPUT: - setEOutput((Output)newValue); - return; - case WSDLPackage.OPERATION__EFAULTS: - getEFaults().clear(); - getEFaults().addAll((Collection)newValue); - return; - case WSDLPackage.OPERATION__EPARAMETER_ORDERING: - getEParameterOrdering().clear(); - getEParameterOrdering().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OPERATION__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.OPERATION__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.OPERATION__STYLE: - setStyle(STYLE_EDEFAULT); - return; - case WSDLPackage.OPERATION__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.OPERATION__UNDEFINED: - setUndefined(UNDEFINED_EDEFAULT); - return; - case WSDLPackage.OPERATION__PROXY: - setProxy(PROXY_EDEFAULT); - return; - case WSDLPackage.OPERATION__RESOURCE_URI: - setResourceURI(RESOURCE_URI_EDEFAULT); - return; - case WSDLPackage.OPERATION__EINPUT: - setEInput((Input)null); - return; - case WSDLPackage.OPERATION__EOUTPUT: - setEOutput((Output)null); - return; - case WSDLPackage.OPERATION__EFAULTS: - getEFaults().clear(); - return; - case WSDLPackage.OPERATION__EPARAMETER_ORDERING: - getEParameterOrdering().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OPERATION__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.OPERATION__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.OPERATION__STYLE: - return STYLE_EDEFAULT == null ? style != null : !STYLE_EDEFAULT.equals(style); - case WSDLPackage.OPERATION__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.OPERATION__UNDEFINED: - return undefined != UNDEFINED_EDEFAULT; - case WSDLPackage.OPERATION__PROXY: - return proxy != PROXY_EDEFAULT; - case WSDLPackage.OPERATION__RESOURCE_URI: - return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI); - case WSDLPackage.OPERATION__EINPUT: - return eInput != null; - case WSDLPackage.OPERATION__EOUTPUT: - return eOutput != null; - case WSDLPackage.OPERATION__EFAULTS: - return eFaults != null && !eFaults.isEmpty(); - case WSDLPackage.OPERATION__EPARAMETER_ORDERING: - return eParameterOrdering != null && !eParameterOrdering.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (style: "); - result.append(style); - result.append(", name: "); - result.append(name); - result.append(", undefined: "); - result.append(undefined); - result.append(", proxy: "); - result.append(proxy); - result.append(", resourceURI: "); - result.append(resourceURI); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - if (changedElement.hasAttribute("name")) - { - String name = changedElement.getAttribute("name"); - if (name != null) - { - setName(name); - } - } - - if (changedElement.hasAttribute("parameterOrder")) - { - String parameterOrder = changedElement.getAttribute("parameterOrder"); - if (parameterOrder != null) - { - String[] array = parameterOrder.split(" "); - List l = Arrays.asList(array); - setParameterOrdering(l); - } - } - - } - - public void elementChanged(Element changedElement) - { - style = deduceOperationType(changedElement); - super.elementChanged(changedElement); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - Definition definition = getEnclosingDefinition(); - - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.INPUT : - { - Input input = WSDLFactory.eINSTANCE.createInput(); - input.setEnclosingDefinition(definition); - input.setElement(child); - setInput(input); - break; - } - case WSDLConstants.OUTPUT : - { - Output output = WSDLFactory.eINSTANCE.createOutput(); - output.setEnclosingDefinition(definition); - output.setElement(child); - setOutput(output); - break; - } - case WSDLConstants.FAULT : - { - Fault fault = WSDLFactory.eINSTANCE.createFault(); - fault.setEnclosingDefinition(definition); - fault.setElement(child); - addFault(fault); - break; - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - } - - protected void remove(Object component, Object modelObject) - { - Operation operation = (Operation) component; - if (modelObject instanceof Input) - { - operation.setEInput(null); - } - else if (modelObject instanceof Output) - { - operation.setEOutput(null); - } - else if (modelObject instanceof Fault) - { - operation.getEFaults().remove(modelObject); - } - } - - public Collection getModelObjects(Object component) - { - Operation operation = (Operation) component; - - List list = new ArrayList(); - - if (operation.getEInput() != null) - { - list.add(operation.getEInput()); - } - - if (operation.getEOutput() != null) - { - list.add(operation.getEOutput()); - } - - list.addAll(operation.getEFaults()); - - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getOperation_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - if (eAttribute == WSDLPackage.eINSTANCE.getOperation_Style()) - { - OperationType targetType = getStyle(); - OperationType currentType = deduceOperationType(theElement); - if (targetType.equals(currentType)) - return; - else if ((targetType.equals(OperationType.REQUEST_RESPONSE) || targetType.equals(OperationType.SOLICIT_RESPONSE)) - && (currentType.equals(OperationType.REQUEST_RESPONSE) || currentType.equals(OperationType.SOLICIT_RESPONSE))) - reorderChildren(); - else - style = deduceOperationType(theElement); // switch back. no support for the other types - } - } - } - - protected void changeReference(EReference eReference) - { - if (isReconciling) - return; - - super.changeReference(eReference); - Element theElement = getElement(); - if (theElement != null) - { - if (eReference == null || eReference == WSDLPackage.eINSTANCE.getOperation_EParameterOrdering()) - { - // Build up a string of concatenated part names (parameterOrder) from eParameterOrdering. - - Iterator parts = getEParameterOrdering().iterator(); - Part part = null; - String partNames = ""; - while (parts.hasNext()) - { - part = (Part)parts.next(); - partNames = partNames + part.getName() + " "; - } - - if ((partNames = partNames.trim()).length() != 0) - // Update the element's attrubute - niceSetAttribute(theElement, "parameterOrder", partNames); - } - } - // - } - - // Switch <input> and <output> - private void reorderChildren() - { - // Find out the positions of <input> and <output> - Node input = null; - Node output = null; - Node reference = null; - for (Node current=getElement().getFirstChild(); current!= null;current=current.getNextSibling()) - { - if (current.getNodeType() == Node.ELEMENT_NODE) - { - if (WSDLConstants.INPUT == WSDLUtil.getInstance().getWSDLType((Element)current)) - { - input = current; - if (output != null) - { - // cs.. for safety use current.getNextSibling() instead of nodeList.item(i+1) - reference = current.getNextSibling(); - } - } - else if (WSDLConstants.OUTPUT == WSDLUtil.getInstance().getWSDLType((Element)current)) - { - output = current; - if (input != null) - { - // cs.. for safety use current.getNextSibling() instead of nodeList.item(i+1) - reference = current.getNextSibling(); - } - } - } - } // end for - - if (input != null && output != null) - { - Element parent = getElement(); - if (getStyle().equals(OperationType.REQUEST_RESPONSE)) - { - // current order: <output> <input> - switchChildren(parent,output,input,reference); - } - else if (getStyle().equals(OperationType.SOLICIT_RESPONSE)) - { - // current order: <input> <output> - switchChildren(parent,input,output,reference); - } - } - } - - private void switchChildren(Node parent, Node child1, Node child2, Node nextOfChild2) - { - // current node sequence: <child1> <child2> <nextOfChild2> - niceRemoveChild(parent,child2); - niceInsertBefore(parent,child2,child1); - niceRemoveChild(parent,child1); - niceInsertBefore(parent,child1,nextOfChild2); - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.OPERATION); - setElement(newElement); - - Input input = getEInput(); - if (input != null) - { - Element child = ((InputImpl) input).createElement(); - newElement.appendChild(child); - } - - Output output = getEOutput(); - if (output != null) - { - Element child = ((OutputImpl) output).createElement(); - newElement.appendChild(child); - } - - Iterator iterator = getEFaults().iterator(); - while (iterator.hasNext()) - { - Fault fault = (Fault) iterator.next(); - Element child = ((FaultImpl) fault).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - -} //OperationImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OutputImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OutputImpl.java deleted file mode 100644 index ea7e7a51c..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/OutputImpl.java +++ /dev/null @@ -1,179 +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; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Output</b></em>'. - * <!-- end-user-doc --> - * <p> - * </p> - * - * @generated - */ -public class OutputImpl extends MessageReferenceImpl implements Output -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected OutputImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getOutput(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message getMessage() - { - return getEMessage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setMessage(javax.wsdl.Message message) - { - setEMessage((Message) message); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OUTPUT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.OUTPUT__ELEMENT: - return getElement(); - case WSDLPackage.OUTPUT__NAME: - return getName(); - case WSDLPackage.OUTPUT__EMESSAGE: - if (resolve) return getEMessage(); - return basicGetEMessage(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OUTPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.OUTPUT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.OUTPUT__NAME: - setName((String)newValue); - return; - case WSDLPackage.OUTPUT__EMESSAGE: - setEMessage((org.eclipse.wst.wsdl.Message)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OUTPUT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.OUTPUT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.OUTPUT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.OUTPUT__EMESSAGE: - setEMessage((org.eclipse.wst.wsdl.Message)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.OUTPUT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.OUTPUT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.OUTPUT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.OUTPUT__EMESSAGE: - return eMessage != null; - } - return eDynamicIsSet(eFeature); - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.OUTPUT); - setElement(newElement); - return newElement; - } -} //OutputImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PartImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PartImpl.java deleted file mode 100644 index 670da206f..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PartImpl.java +++ /dev/null @@ -1,765 +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; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDTypeDefinition; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Part</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.PartImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PartImpl#getElementName <em>Element Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PartImpl#getTypeName <em>Type Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PartImpl#getTypeDefinition <em>Type Definition</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PartImpl#getElementDeclaration <em>Element Declaration</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PartImpl#getEMessage <em>EMessage</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class PartImpl extends WSDLElementImpl implements Part -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getElementName() <em>Element Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElementName() - * @generated - * @ordered - */ - protected static final QName ELEMENT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getElementName() <em>Element Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElementName() - * @generated - * @ordered - */ - protected QName elementName = ELEMENT_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getTypeName() <em>Type Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTypeName() - * @generated - * @ordered - */ - protected static final QName TYPE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTypeName() <em>Type Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTypeName() - * @generated - * @ordered - */ - protected QName typeName = TYPE_NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getTypeDefinition() <em>Type Definition</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getTypeDefinition() - * @generated - * @ordered - */ - protected XSDTypeDefinition typeDefinition = null; - - /** - * The cached value of the '{@link #getElementDeclaration() <em>Element Declaration</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElementDeclaration() - * @generated - * @ordered - */ - protected XSDElementDeclaration elementDeclaration = null; - - /** - * The cached value of the '{@link #getEMessage() <em>EMessage</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEMessage() - * @generated - * @ordered - */ - protected Message eMessage = null; - - public static final String NS_URI_PART_EXTENSIONS = "http://schemas.xmlsoap.org/wsdl/part-extensions/"; - public static final String ATTR_MESSAGE = "message"; - private Map extensionAttributes = new ExtensionAttributeMap(); - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected PartImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getPart(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PART__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getElementName() - { - return elementName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setElementName(QName newElementName) - { - QName oldElementName = elementName; - elementName = newElementName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PART__ELEMENT_NAME, oldElementName, elementName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getTypeName() - { - return typeName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setTypeName(QName newTypeName) - { - QName oldTypeName = typeName; - typeName = newTypeName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PART__TYPE_NAME, oldTypeName, typeName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDTypeDefinition getTypeDefinition() - { - if (typeDefinition != null && typeDefinition.eIsProxy()) - { - XSDTypeDefinition oldTypeDefinition = typeDefinition; - typeDefinition = (XSDTypeDefinition)eResolveProxy((InternalEObject)typeDefinition); - if (typeDefinition != oldTypeDefinition) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.PART__TYPE_DEFINITION, oldTypeDefinition, typeDefinition)); - } - } - return typeDefinition; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDTypeDefinition basicGetTypeDefinition() - { - return typeDefinition; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setTypeDefinition(XSDTypeDefinition newTypeDefinition) - { - XSDTypeDefinition oldTypeDefinition = typeDefinition; - typeDefinition = newTypeDefinition; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PART__TYPE_DEFINITION, oldTypeDefinition, typeDefinition)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDElementDeclaration getElementDeclaration() - { - if (elementDeclaration != null && elementDeclaration.eIsProxy()) - { - XSDElementDeclaration oldElementDeclaration = elementDeclaration; - elementDeclaration = (XSDElementDeclaration)eResolveProxy((InternalEObject)elementDeclaration); - if (elementDeclaration != oldElementDeclaration) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.PART__ELEMENT_DECLARATION, oldElementDeclaration, elementDeclaration)); - } - } - return elementDeclaration; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDElementDeclaration basicGetElementDeclaration() - { - return elementDeclaration; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setElementDeclaration(XSDElementDeclaration newElementDeclaration) - { - XSDElementDeclaration oldElementDeclaration = elementDeclaration; - elementDeclaration = newElementDeclaration; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PART__ELEMENT_DECLARATION, oldElementDeclaration, elementDeclaration)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Message getEMessage() - { - if (eMessage != null && eMessage.eIsProxy()) - { - Message oldEMessage = eMessage; - eMessage = (Message)eResolveProxy((InternalEObject)eMessage); - if (eMessage != oldEMessage) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.PART__EMESSAGE, oldEMessage, eMessage)); - } - } - return eMessage; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Message basicGetEMessage() - { - return eMessage; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEMessage(Message newEMessage) - { - Message oldEMessage = eMessage; - eMessage = newEMessage; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PART__EMESSAGE, oldEMessage, eMessage)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setExtensionAttribute(QName name, QName value) - { - String localName = name.getLocalPart(); - String nsURI = name.getNamespaceURI(); - if (localName == null) - return; - - if (value == null) - extensionAttributes.remove(name); - else - extensionAttributes.put(name, value); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public Iterator getExtensionAttributeNames() - { - Map map = new HashMap(extensionAttributes); - - // Adjust messageName attribute - QName messageName = getMessage() != null ? getMessage().getQName() : null; - if (messageName != null) - map.put(new QName(NS_URI_PART_EXTENSIONS, ATTR_MESSAGE), messageName); - else - map.remove(new QName(NS_URI_PART_EXTENSIONS, ATTR_MESSAGE)); - - return map.keySet().iterator(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public QName getExtensionAttribute(QName name) - { - if (name.equals(new QName(NS_URI_PART_EXTENSIONS, ATTR_MESSAGE))) - return getMessage() != null ? getMessage().getQName() : null; - else - return (QName) extensionAttributes.get(name); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setMessage(javax.wsdl.Message message) - { - setEMessage((Message) message); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Message getMessage() - { - return getEMessage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PART__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.PART__ELEMENT: - return getElement(); - case WSDLPackage.PART__NAME: - return getName(); - case WSDLPackage.PART__ELEMENT_NAME: - return getElementName(); - case WSDLPackage.PART__TYPE_NAME: - return getTypeName(); - case WSDLPackage.PART__TYPE_DEFINITION: - if (resolve) return getTypeDefinition(); - return basicGetTypeDefinition(); - case WSDLPackage.PART__ELEMENT_DECLARATION: - if (resolve) return getElementDeclaration(); - return basicGetElementDeclaration(); - case WSDLPackage.PART__EMESSAGE: - if (resolve) return getEMessage(); - return basicGetEMessage(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PART__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.PART__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.PART__NAME: - setName((String)newValue); - return; - case WSDLPackage.PART__ELEMENT_NAME: - setElementName((QName)newValue); - return; - case WSDLPackage.PART__TYPE_NAME: - setTypeName((QName)newValue); - return; - case WSDLPackage.PART__TYPE_DEFINITION: - setTypeDefinition((XSDTypeDefinition)newValue); - return; - case WSDLPackage.PART__ELEMENT_DECLARATION: - setElementDeclaration((XSDElementDeclaration)newValue); - return; - case WSDLPackage.PART__EMESSAGE: - setEMessage((Message)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PART__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.PART__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.PART__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.PART__ELEMENT_NAME: - setElementName(ELEMENT_NAME_EDEFAULT); - return; - case WSDLPackage.PART__TYPE_NAME: - setTypeName(TYPE_NAME_EDEFAULT); - return; - case WSDLPackage.PART__TYPE_DEFINITION: - setTypeDefinition((XSDTypeDefinition)null); - return; - case WSDLPackage.PART__ELEMENT_DECLARATION: - setElementDeclaration((XSDElementDeclaration)null); - return; - case WSDLPackage.PART__EMESSAGE: - setEMessage((Message)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PART__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.PART__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.PART__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.PART__ELEMENT_NAME: - return ELEMENT_NAME_EDEFAULT == null ? elementName != null : !ELEMENT_NAME_EDEFAULT.equals(elementName); - case WSDLPackage.PART__TYPE_NAME: - return TYPE_NAME_EDEFAULT == null ? typeName != null : !TYPE_NAME_EDEFAULT.equals(typeName); - case WSDLPackage.PART__TYPE_DEFINITION: - return typeDefinition != null; - case WSDLPackage.PART__ELEMENT_DECLARATION: - return elementDeclaration != null; - case WSDLPackage.PART__EMESSAGE: - return eMessage != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", elementName: "); - result.append(elementName); - result.append(", typeName: "); - result.append(typeName); - result.append(')'); - return result.toString(); - } - - public Map getExtensionAttributes() - { - return extensionAttributes; - } - - class ExtensionAttributeMap extends HashMap - { - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - ExtensionAttributeMap() - { - super(); - } - - public Object put(Object key, Object val) - { - QName name = (QName) key; - QName value = (QName) val; - String lName = name.getLocalPart(); - String nSpace = name.getNamespaceURI(); - - if (NS_URI_PART_EXTENSIONS.equals(nSpace) && ATTR_MESSAGE.equals(lName)) - { - javax.wsdl.Message messageProxy = new MessageImpl(); - messageProxy.setQName(value); - setEMessage((Message) messageProxy); - } - return super.put(key, value); - } - } - - // - // Reconcile methods - // - public void reconcileAttributes(Element changedElement) - { - Definition definition = getEnclosingDefinition(); - - String name = changedElement.getAttributeNS(null, "name"); - if (name != null) - { - setName(name); - } - - String elementAttr = WSDLConstants.getAttribute(changedElement, WSDLConstants.ELEMENT_ATTRIBUTE); - setElementName(elementAttr != null ? createQName(definition, elementAttr) : null); - - String typeAttr = WSDLConstants.getAttribute(changedElement, WSDLConstants.TYPE_ATTRIBUTE); - setTypeName(typeAttr != null ? createQName(definition, typeAttr) : null); - - reconcileReferences(false); - } - - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - //super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getPart_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getPart_TypeName()) - if (getTypeName() != null) - niceSetAttributeURIValue(theElement, WSDLConstants.TYPE_ATTRIBUTE, getTypeName().getNamespaceURI() + "#" + getTypeName().getLocalPart()); - - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getPart_ElementName()) - if (getElementName() != null) - niceSetAttributeURIValue(theElement, WSDLConstants.ELEMENT_ATTRIBUTE, getElementName().getNamespaceURI() + "#" + getElementName().getLocalPart()); - - } - } - - protected void changeReference(EReference eReference) - { - if (isReconciling) - return; - - super.changeReference(eReference); - Element theElement = getElement(); - if (theElement != null) - { - if (eReference == null || eReference == WSDLPackage.eINSTANCE.getPart_TypeDefinition()) - { - XSDTypeDefinition typeDefinition = getTypeDefinition(); - if (typeDefinition != null) - { - niceSetAttributeURIValue(theElement, WSDLConstants.TYPE_ATTRIBUTE, typeDefinition.getURI()); - } - } - if (eReference == null || eReference == WSDLPackage.eINSTANCE.getPart_ElementDeclaration()) - { - XSDElementDeclaration elementDecl = getElementDeclaration(); - if (elementDecl != null) - { - niceSetAttributeURIValue(theElement, WSDLConstants.ELEMENT_ATTRIBUTE, elementDecl.getURI()); - } - } - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.PART); - setElement(newElement); - return newElement; - } - - public void reconcileReferences(boolean deep) - { - XSDElementDeclaration newElementDeclaration = resolveElementDeclaration(elementName); - if (newElementDeclaration != elementDeclaration) - { - setElementDeclaration(newElementDeclaration); - } - - XSDTypeDefinition newTypeDefinition = resolveTypeDefinition(typeName); - if (newTypeDefinition != typeDefinition) - { - setTypeDefinition(newTypeDefinition); - } - - super.reconcileReferences(deep); - } - - private XSDElementDeclaration resolveElementDeclaration(QName qname) - { - XSDElementDeclaration result = null; - if (qname != null) - { - DefinitionImpl definition = (DefinitionImpl) getEnclosingDefinition(); - if (definition != null) - { - result = definition.resolveElementDeclaration(qname.getNamespaceURI(), qname.getLocalPart()); - } - } - return result; - } - - private XSDTypeDefinition resolveTypeDefinition(QName qname) - { - XSDTypeDefinition result = null; - if (qname != null) - { - DefinitionImpl definition = (DefinitionImpl) getEnclosingDefinition(); - if (definition != null) - { - result = definition.resolveTypeDefinition(qname.getNamespaceURI(), qname.getLocalPart()); - } - } - return result; - } -} //PartImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java deleted file mode 100644 index d1f9403fe..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortImpl.java +++ /dev/null @@ -1,438 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Port</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.PortImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PortImpl#getEBinding <em>EBinding</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class PortImpl extends ExtensibleElementImpl implements Port -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getEBinding() <em>EBinding</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEBinding() - * @generated - * @ordered - */ - protected Binding eBinding = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected PortImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getPort(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getName() - { - return name; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PORT__NAME, oldName, name)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Binding getEBinding() - { - if (eBinding != null && eBinding.eIsProxy()) - { - Binding oldEBinding = eBinding; - eBinding = (Binding)eResolveProxy((InternalEObject)eBinding); - if (eBinding != oldEBinding) - { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, WSDLPackage.PORT__EBINDING, oldEBinding, eBinding)); - } - } - return eBinding; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Binding basicGetEBinding() - { - return eBinding; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setEBinding(Binding newEBinding) - { - Binding oldEBinding = eBinding; - eBinding = newEBinding; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PORT__EBINDING, oldEBinding, eBinding)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Binding getBinding() - { - return getEBinding(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setBinding(javax.wsdl.Binding binding) - { - setEBinding((Binding) binding); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.PORT__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.PORT__ELEMENT: - return getElement(); - case WSDLPackage.PORT__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.PORT__NAME: - return getName(); - case WSDLPackage.PORT__EBINDING: - if (resolve) return getEBinding(); - return basicGetEBinding(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.PORT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.PORT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.PORT__NAME: - setName((String)newValue); - return; - case WSDLPackage.PORT__EBINDING: - setEBinding((Binding)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.PORT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.PORT__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.PORT__NAME: - setName(NAME_EDEFAULT); - return; - case WSDLPackage.PORT__EBINDING: - setEBinding((Binding)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.PORT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.PORT__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.PORT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case WSDLPackage.PORT__EBINDING: - return eBinding != null; - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - Definition definition = getEnclosingDefinition(); - setName(changedElement.getAttribute("name")); - reconcileReferences(false); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - super.handleUnreconciledElement(child,remainingModelObjects); - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - getEExtensibilityElements().remove(i.next()); - } - } - - public Collection getModelObjects(Object component) - { - Port port = (Port) component; - List list = new ArrayList(); - list.addAll(port.getEExtensibilityElements()); - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getPort_Name()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getName()); - } - } - - protected void changeReference(EReference eReference) - { - if (isReconciling) - return; - - super.changeReference(eReference); - Element theElement = getElement(); - if (theElement != null) - { - if (eReference == null || eReference == WSDLPackage.eINSTANCE.getPort_EBinding()) - { - Binding binding = getEBinding(); - if (binding != null) - { - QName qName = binding.getQName(); - niceSetAttributeURIValue(theElement, WSDLConstants.BINDING_ATTRIBUTE, qName.getNamespaceURI() + "#" + qName.getLocalPart()); - } - } - } - } - - protected Element createElement() - { - Element newElement = createElement(WSDLConstants.PORT); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - return newElement; - } - - public void reconcileReferences(boolean deep) - { - if (element != null) - { - Definition definition = getEnclosingDefinition(); - QName bindingQName = createQName(definition, element.getAttribute("binding")); - Binding newBinding = (bindingQName != null) ? (Binding) definition.getBinding(bindingQName) : null; - if (newBinding != getEBinding()) - { - setEBinding(newBinding); - } - } - super.reconcileReferences(deep); - } - -} //PortImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java deleted file mode 100644 index e37cfd817..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/PortTypeImpl.java +++ /dev/null @@ -1,635 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Port Type</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.PortTypeImpl#getQName <em>QName</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PortTypeImpl#isUndefined <em>Undefined</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PortTypeImpl#isProxy <em>Proxy</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PortTypeImpl#getResourceURI <em>Resource URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.PortTypeImpl#getEOperations <em>EOperations</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class PortTypeImpl extends WSDLElementImpl implements PortType -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected static final QName QNAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected QName qName = QNAME_EDEFAULT; - - /** - * The default value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected static final boolean UNDEFINED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected boolean undefined = UNDEFINED_EDEFAULT; - - /** - * The default value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected static final boolean PROXY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected boolean proxy = PROXY_EDEFAULT; - - /** - * The default value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected static final String RESOURCE_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected String resourceURI = RESOURCE_URI_EDEFAULT; - - /** - * The cached value of the '{@link #getEOperations() <em>EOperations</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEOperations() - * @generated - * @ordered - */ - protected EList eOperations = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected PortTypeImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getPortType(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getQName() - { - return qName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setQName(QName newQName) - { - QName oldQName = qName; - qName = newQName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PORT_TYPE__QNAME, oldQName, qName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isUndefined() - { - return undefined; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUndefined(boolean newUndefined) - { - boolean oldUndefined = undefined; - undefined = newUndefined; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PORT_TYPE__UNDEFINED, oldUndefined, undefined)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isProxy() - { - return proxy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setProxy(boolean newProxy) - { - boolean oldProxy = proxy; - proxy = newProxy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PORT_TYPE__PROXY, oldProxy, proxy)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getResourceURI() - { - return resourceURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setResourceURI(String newResourceURI) - { - String oldResourceURI = resourceURI; - resourceURI = newResourceURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.PORT_TYPE__RESOURCE_URI, oldResourceURI, resourceURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEOperations() - { - if (eOperations == null) - { - eOperations = new EObjectContainmentEList(Operation.class, this, WSDLPackage.PORT_TYPE__EOPERATIONS); - } - return eOperations; - } - - /** - * <!-- begin-user-doc --> - * Add an operation to this port type. - * @param operation the operation to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addOperation(javax.wsdl.Operation operation) - { - if (!operation.isUndefined()) - getEOperations().add(operation); - } - - /** - * <!-- begin-user-doc --> - * Get the specified operation. Note that operation names can - * be overloaded within a PortType. In case of overloading, the - * names of the input and output messages can be used to further - * refine the search. - * @param name the name of the desired operation. - * @param inputName the name of the input message; if this is null - * it will be ignored. - * @param outputName the name of the output message; if this is null - * it will be ignored. - * @return the corresponding operation, or null if there wasn't - * any matching operation - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Operation getOperation(String name, String inputName, String outputName) - { - Iterator opIterator = getOperations().iterator(); - while (opIterator.hasNext()) - { - javax.wsdl.Operation op = (javax.wsdl.Operation) opIterator.next(); - if (op == null) - continue; - - String opName = op.getName(); - if (name != null && opName != null) - { - if (!name.equals(opName)) - op = null; - } - else if (name != null || opName != null) - op = null; - - if (op != null && inputName != null) - { - javax.wsdl.Input input = op.getInput(); - if (input != null) - { - String opInputName = input.getName(); - if (opInputName == null || !opInputName.equals(inputName)) - op = null; - } - else - op = null; - } - - if (op != null && outputName != null) - { - javax.wsdl.Output output = op.getOutput(); - if (output != null) - { - String opOutputName = output.getName(); - if (opOutputName == null || !opOutputName.equals(outputName)) - op = null; - } - else - op = null; - } - - if (op != null) - return op; - } // end while - return null; - } - - /** - * <!-- begin-user-doc --> - * Get all the operations defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public List getOperations() - { - if (!isUndefined()) - return getEOperations(); - else - return new ArrayList(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.PORT_TYPE__EOPERATIONS: - return ((InternalEList)getEOperations()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT_TYPE__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.PORT_TYPE__ELEMENT: - return getElement(); - case WSDLPackage.PORT_TYPE__QNAME: - return getQName(); - case WSDLPackage.PORT_TYPE__UNDEFINED: - return isUndefined() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.PORT_TYPE__PROXY: - return isProxy() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.PORT_TYPE__RESOURCE_URI: - return getResourceURI(); - case WSDLPackage.PORT_TYPE__EOPERATIONS: - return getEOperations(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT_TYPE__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.PORT_TYPE__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.PORT_TYPE__QNAME: - setQName((QName)newValue); - return; - case WSDLPackage.PORT_TYPE__UNDEFINED: - setUndefined(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.PORT_TYPE__PROXY: - setProxy(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.PORT_TYPE__RESOURCE_URI: - setResourceURI((String)newValue); - return; - case WSDLPackage.PORT_TYPE__EOPERATIONS: - getEOperations().clear(); - getEOperations().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT_TYPE__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.PORT_TYPE__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.PORT_TYPE__QNAME: - setQName(QNAME_EDEFAULT); - return; - case WSDLPackage.PORT_TYPE__UNDEFINED: - setUndefined(UNDEFINED_EDEFAULT); - return; - case WSDLPackage.PORT_TYPE__PROXY: - setProxy(PROXY_EDEFAULT); - return; - case WSDLPackage.PORT_TYPE__RESOURCE_URI: - setResourceURI(RESOURCE_URI_EDEFAULT); - return; - case WSDLPackage.PORT_TYPE__EOPERATIONS: - getEOperations().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.PORT_TYPE__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.PORT_TYPE__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.PORT_TYPE__QNAME: - return QNAME_EDEFAULT == null ? qName != null : !QNAME_EDEFAULT.equals(qName); - case WSDLPackage.PORT_TYPE__UNDEFINED: - return undefined != UNDEFINED_EDEFAULT; - case WSDLPackage.PORT_TYPE__PROXY: - return proxy != PROXY_EDEFAULT; - case WSDLPackage.PORT_TYPE__RESOURCE_URI: - return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI); - case WSDLPackage.PORT_TYPE__EOPERATIONS: - return eOperations != null && !eOperations.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (qName: "); - result.append(qName); - result.append(", undefined: "); - result.append(undefined); - result.append(", proxy: "); - result.append(proxy); - result.append(", resourceURI: "); - result.append(resourceURI); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - Definition definition = getEnclosingDefinition(); - QName qname = new QName(definition.getTargetNamespace(), changedElement.getAttribute("name")); - setQName(qname); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.OPERATION : - { - Operation operation = WSDLFactory.eINSTANCE.createOperation(); - operation.setEnclosingDefinition(getEnclosingDefinition()); - operation.setElement(child); - getEOperations().add(operation); - break; - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - } - - protected void remove(Object component, Object modelObject) - { - List list = getList(component, modelObject); - if (list != null) - { - list.remove(modelObject); - } - } - - private List getList(Object component, Object modelObject) - { - List result = null; - PortType portType = (PortType) component; - if (modelObject instanceof Operation) - { - result = portType.getEOperations(); - } - return result; - } - - public Collection getModelObjects(Object component) - { - PortType portType = (PortType) component; - - List list = portType.getEOperations(); - return list; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getPortType_QName()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getQName().getLocalPart()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.PORT_TYPE); - setElement(newElement); - - Iterator iterator = getEOperations().iterator(); - while (iterator.hasNext()) - { - Operation operation = (Operation) iterator.next(); - Element child = ((OperationImpl) operation).createElement(); - newElement.appendChild(child); - } - - return newElement; - } -} //PortTypeImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ServiceImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ServiceImpl.java deleted file mode 100644 index bf38f3c66..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/ServiceImpl.java +++ /dev/null @@ -1,628 +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; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.internal.util.WSDLUtil; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Service</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.ServiceImpl#getQName <em>QName</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ServiceImpl#isUndefined <em>Undefined</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ServiceImpl#isProxy <em>Proxy</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ServiceImpl#getResourceURI <em>Resource URI</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.ServiceImpl#getEPorts <em>EPorts</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class ServiceImpl extends ExtensibleElementImpl implements Service -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * The default value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected static final QName QNAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getQName() <em>QName</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getQName() - * @generated - * @ordered - */ - protected QName qName = QNAME_EDEFAULT; - - /** - * The default value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected static final boolean UNDEFINED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isUndefined() <em>Undefined</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isUndefined() - * @generated - * @ordered - */ - protected boolean undefined = UNDEFINED_EDEFAULT; - - /** - * The default value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected static final boolean PROXY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isProxy() <em>Proxy</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #isProxy() - * @generated - * @ordered - */ - protected boolean proxy = PROXY_EDEFAULT; - - /** - * The default value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected static final String RESOURCE_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getResourceURI() <em>Resource URI</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getResourceURI() - * @generated - * @ordered - */ - protected String resourceURI = RESOURCE_URI_EDEFAULT; - - private Map ports; - - /** - * The cached value of the '{@link #getEPorts() <em>EPorts</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getEPorts() - * @generated - * @ordered - */ - protected EList ePorts = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected ServiceImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getService(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName getQName() - { - return qName; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setQName(QName newQName) - { - QName oldQName = qName; - qName = newQName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.SERVICE__QNAME, oldQName, qName)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isUndefined() - { - return undefined; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setUndefined(boolean newUndefined) - { - boolean oldUndefined = undefined; - undefined = newUndefined; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.SERVICE__UNDEFINED, oldUndefined, undefined)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean isProxy() - { - return proxy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setProxy(boolean newProxy) - { - boolean oldProxy = proxy; - proxy = newProxy; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.SERVICE__PROXY, oldProxy, proxy)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getResourceURI() - { - return resourceURI; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setResourceURI(String newResourceURI) - { - String oldResourceURI = resourceURI; - resourceURI = newResourceURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.SERVICE__RESOURCE_URI, oldResourceURI, resourceURI)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getEPorts() - { - if (ePorts == null) - { - ePorts = new EObjectContainmentEList(Port.class, this, WSDLPackage.SERVICE__EPORTS); - } - return ePorts; - } - - /** - * <!-- begin-user-doc --> - * Add a port to this service. - * @param port the port to be added - * <!-- end-user-doc --> - * @generated NOT - */ - public void addPort(javax.wsdl.Port port) - { - getEPorts().add((Port)port); - } - - /** - * <!-- begin-user-doc --> - * Get all the ports defined here. - * <!-- end-user-doc --> - * @generated NOT - */ - public Map getPorts() - { - HashMap hashMap = new HashMap(); - for (Iterator i = getEPorts().iterator(); i.hasNext();) - { - Port port = (Port) i.next(); - hashMap.put(port.getName(), port); - } - return hashMap; - } - - /** - * <!-- begin-user-doc --> - * Get the specified port. - * - * @param name the name of the desired port. - * @return the corresponding port, or null if there wasn't - * any matching port - * <!-- end-user-doc --> - * @generated NOT - */ - public javax.wsdl.Port getPort(String name) - { - Port result = null; - for (Iterator i = getEPorts().iterator(); i.hasNext();) - { - Port port = (Port) i.next(); - if (name.equals(port.getName())) - { - result = port; - break; - } - } - return result; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.SERVICE__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - case WSDLPackage.SERVICE__EPORTS: - return ((InternalEList)getEPorts()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.SERVICE__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.SERVICE__ELEMENT: - return getElement(); - case WSDLPackage.SERVICE__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - case WSDLPackage.SERVICE__QNAME: - return getQName(); - case WSDLPackage.SERVICE__UNDEFINED: - return isUndefined() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.SERVICE__PROXY: - return isProxy() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.SERVICE__RESOURCE_URI: - return getResourceURI(); - case WSDLPackage.SERVICE__EPORTS: - return getEPorts(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.SERVICE__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.SERVICE__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.SERVICE__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - case WSDLPackage.SERVICE__QNAME: - setQName((QName)newValue); - return; - case WSDLPackage.SERVICE__UNDEFINED: - setUndefined(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.SERVICE__PROXY: - setProxy(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.SERVICE__RESOURCE_URI: - setResourceURI((String)newValue); - return; - case WSDLPackage.SERVICE__EPORTS: - getEPorts().clear(); - getEPorts().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.SERVICE__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.SERVICE__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.SERVICE__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - case WSDLPackage.SERVICE__QNAME: - setQName(QNAME_EDEFAULT); - return; - case WSDLPackage.SERVICE__UNDEFINED: - setUndefined(UNDEFINED_EDEFAULT); - return; - case WSDLPackage.SERVICE__PROXY: - setProxy(PROXY_EDEFAULT); - return; - case WSDLPackage.SERVICE__RESOURCE_URI: - setResourceURI(RESOURCE_URI_EDEFAULT); - return; - case WSDLPackage.SERVICE__EPORTS: - getEPorts().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.SERVICE__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.SERVICE__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.SERVICE__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - case WSDLPackage.SERVICE__QNAME: - return QNAME_EDEFAULT == null ? qName != null : !QNAME_EDEFAULT.equals(qName); - case WSDLPackage.SERVICE__UNDEFINED: - return undefined != UNDEFINED_EDEFAULT; - case WSDLPackage.SERVICE__PROXY: - return proxy != PROXY_EDEFAULT; - case WSDLPackage.SERVICE__RESOURCE_URI: - return RESOURCE_URI_EDEFAULT == null ? resourceURI != null : !RESOURCE_URI_EDEFAULT.equals(resourceURI); - case WSDLPackage.SERVICE__EPORTS: - return ePorts != null && !ePorts.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (qName: "); - result.append(qName); - result.append(", undefined: "); - result.append(undefined); - result.append(", proxy: "); - result.append(proxy); - result.append(", resourceURI: "); - result.append(resourceURI); - result.append(')'); - return result.toString(); - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - Definition definition = getEnclosingDefinition(); - - QName qname = new QName(definition.getTargetNamespace(), changedElement.getAttribute("name")); - setQName(qname); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - switch (WSDLUtil.getInstance().getWSDLType(child)) - { - case WSDLConstants.PORT : - { - Port port = (Port) ((WSDLPackage) EPackage.Registry.INSTANCE.getEPackage(WSDLPackage.eNS_URI)).getWSDLFactory().createPort(); - port.setEnclosingDefinition(getEnclosingDefinition()); - getEPorts().add(port); - port.setElement(child); - break; - } - case WSDLConstants.DOCUMENTATION : - { - setDocumentationElement(child); - break; - } - default : - { - super.handleUnreconciledElement(child,remainingModelObjects); - break; - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(i.next()); - } - } - - private void remove(Object modelObject) - { - List list = getList(modelObject); - if (list != null) - { - list.remove(modelObject); - } - } - - private List getList(Object modelObject) - { - List result = null; - if (modelObject instanceof Port) - { - result = getEPorts(); - } - else if (modelObject instanceof ExtensibilityElement) - { - result = getExtensibilityElements(); - } - return result; - } - - // - // For reconciliation: Model -> DOM - // - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getService_QName()) - niceSetAttribute(theElement, WSDLConstants.NAME_ATTRIBUTE, getQName().getLocalPart()); - } - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.SERVICE); - setElement(newElement); - - Iterator iterator = getExtensibilityElements().iterator(); - while (iterator.hasNext()) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - Element child = ((ExtensibilityElementImpl) extensibilityElement).createElement(); - newElement.appendChild(child); - } - - iterator = getEPorts().iterator(); - while (iterator.hasNext()) - { - Port port = (Port) iterator.next(); - Element child = ((PortImpl) port).createElement(); - newElement.appendChild(child); - } - - return newElement; - } - -} //ServiceImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java deleted file mode 100644 index 363ddf717..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/TypesImpl.java +++ /dev/null @@ -1,334 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Types; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.eclipse.xsd.XSDSchema; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -//import com.ibm.wsdl.factory.WSDLFactoryImpl; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Types</b></em>'. - * <!-- end-user-doc --> - * <p> - * </p> - * - * @generated - */ -public class TypesImpl extends ExtensibleElementImpl implements Types -{ - /** - * This class is not intended to be serialized. - * serialVersionUID is assigned with 1L to avoid - * compiler warning messages. - */ - private static final long serialVersionUID = 1L; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected TypesImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getTypes(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public List getSchemas() - { - List arrayList = new ArrayList(); - for (Iterator i = getEExtensibilityElements().iterator(); i.hasNext();) - { - XSDSchemaExtensibilityElement xsdee = (XSDSchemaExtensibilityElement) i.next(); - if (xsdee.getSchema() != null) - { - arrayList.add(xsdee.getSchema()); - } - } - return arrayList; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public List getSchemas(String namespaceURI) - { - List schemas = new ArrayList(); - for (Iterator i = getSchemas().iterator(); i.hasNext();) - { - XSDSchema schema = (XSDSchema) i.next(); - if (namespaceURI == null && schema.getTargetNamespace() == null) { - schemas.add(schema); - } - else if (namespaceURI != null && namespaceURI.equals(schema.getTargetNamespace())) { - schemas.add(schema); - } - } - return schemas; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.TYPES__EEXTENSIBILITY_ELEMENTS: - return ((InternalEList)getEExtensibilityElements()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.TYPES__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.TYPES__ELEMENT: - return getElement(); - case WSDLPackage.TYPES__EEXTENSIBILITY_ELEMENTS: - return getEExtensibilityElements(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.TYPES__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.TYPES__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.TYPES__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - getEExtensibilityElements().addAll((Collection)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.TYPES__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.TYPES__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.TYPES__EEXTENSIBILITY_ELEMENTS: - getEExtensibilityElements().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.TYPES__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.TYPES__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.TYPES__EEXTENSIBILITY_ELEMENTS: - return eExtensibilityElements != null && !eExtensibilityElements.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - public void eNotify(Notification msg) - { - super.eNotify(msg); - - // cs.. if we've added an XSDSchemaExtensibilityElementImpl and the Types object is already attached - // to a resource we need to set the schemaLocation for the inline schema. - // If not yet attached to a resource, the schemaLocation's will be set via WSDLResourceImpl.attached(EObject o) - // - if (msg.getFeature() == WSDLPackage.eINSTANCE.getExtensibleElement_EExtensibilityElements() && - msg.getEventType() == Notification.ADD) - { - if (msg.getNewValue() instanceof XSDSchemaExtensibilityElementImpl) - { - XSDSchemaExtensibilityElementImpl ee = (XSDSchemaExtensibilityElementImpl)msg.getNewValue(); - if (ee.getSchema() != null && ee.getSchema().eResource() != null) - { - ee.getSchema().setSchemaLocation(ee.getSchema().eResource().getURI().toString()); - } - } - } - } - - // - // Reconcile methods - // - - public void reconcileAttributes(Element changedElement) - { - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - if ("schema".equals(child.getLocalName())) - { - try - { - XSDSchemaExtensibilityElement xsdee = WSDLFactory.eINSTANCE.createXSDSchemaExtensibilityElement(); - xsdee.setEnclosingDefinition(getEnclosingDefinition()); - xsdee.setElement(child); // cs : this has the side effect of creating the inline schema - addExtensibilityElement(xsdee); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - ((DefinitionImpl)getEnclosingDefinition()).reconcileReferences(true); - } - - protected void remove(Object component, Object modelObject) - { - Types types = (Types) component; - List list = types.getEExtensibilityElements(); - list.remove(modelObject); - } - - public Collection getModelObjects(Object component) - { - Types types = (Types) component; - List list = new ArrayList(); - list.addAll(types.getEExtensibilityElements()); - return list; - } - - public Element createElement() - { - Element newElement = createElement(WSDLConstants.TYPES); - setElement(newElement); - - // Add children - Definition definition = getEnclosingDefinition(); - if (definition == null) - return newElement; - - Document document = definition.getDocument(); - if (document == null) - document = ((DefinitionImpl) definition).updateDocument(); - - Iterator iter = getEExtensibilityElements().iterator(); - Element el = null; - while (iter.hasNext()) - { - ExtensibilityElement extensibility = (ExtensibilityElement) iter.next(); - el = extensibility.getElement(); - if (el != null) - { - try - { - Element reParented = (Element) document.importNode(el, true); - extensibility.setElement(reParented); // replace with the new one - newElement.appendChild(reParented); - } - catch (DOMException e) - { - e.printStackTrace(); - return newElement; - } - } - else - { - Element child = ((ExtensibilityElementImpl)extensibility).createElement(); - newElement.appendChild(child); - } - } - - return newElement; - } -} //TypesImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/UnknownExtensibilityElementImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/UnknownExtensibilityElementImpl.java deleted file mode 100644 index b2ddd0cb7..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/UnknownExtensibilityElementImpl.java +++ /dev/null @@ -1,320 +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; - -import java.util.Collection; -import java.util.Iterator; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.UnknownExtensibilityElement; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Unknown Extensibility Element</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wst.wsdl.impl.UnknownExtensibilityElementImpl#getChildren <em>Children</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class UnknownExtensibilityElementImpl extends ExtensibilityElementImpl implements UnknownExtensibilityElement -{ - /** - * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getChildren() - * @generated - * @ordered - */ - protected EList children = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected UnknownExtensibilityElementImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getUnknownExtensibilityElement(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getChildren() - { - if (children == null) - { - children = new EObjectContainmentEList(UnknownExtensibilityElement.class, this, WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN); - } - return children; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN: - return ((InternalEList) getChildren()).basicRemove(otherEnd, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT: - return getElement(); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__REQUIRED: - return isRequired() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - return getElementType(); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN: - return getChildren(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element) newValue); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT: - setElement((Element) newValue); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__REQUIRED: - setRequired(((Boolean) newValue).booleanValue()); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - setElementType((QName) newValue); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN: - getChildren().clear(); - getChildren().addAll((Collection) newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__REQUIRED: - setRequired(REQUIRED_EDEFAULT); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - setElementType(ELEMENT_TYPE_EDEFAULT); - return; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN: - getChildren().clear(); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__REQUIRED: - return required != REQUIRED_EDEFAULT; - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - return ELEMENT_TYPE_EDEFAULT == null ? elementType != null : !ELEMENT_TYPE_EDEFAULT.equals(elementType); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN: - return children != null && !children.isEmpty(); - } - return eDynamicIsSet(eFeature); - } - - // - // Reconcile methods - // - - public void setElement(Element element) - { - if (element == null && !isReconciling) - { - //System.out.println("ExtensibilityElement.setElement(): Preserving old element"); - } - else - { - setElementGen(element); - } - } - - public void reconcileAttributes(Element changedElement) - { - //System.out.println("UnknownExtensibilityElementImpl.reconcileAttributes()"); - } - - public void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - //System.out.println("UnknownExtensibilityElementImpl.handleUnreconciledElement()"); - UnknownExtensibilityElement extensibilityElement = WSDLFactory.eINSTANCE.createUnknownExtensibilityElement(); - extensibilityElement.setEnclosingDefinition(getEnclosingDefinition()); - extensibilityElement.setElement(child); - - // TODO.. we need to figure out where the child should go in the in current list - // so that it doesn't always end up going to the end of the list - // (since a new element might be added at the start) - getChildren().add(extensibilityElement); - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - for (Iterator i = remainingModelObjects.iterator(); i.hasNext();) - { - remove(this, i.next()); - } - } - - protected void remove(Object component, Object modelObject) - { - UnknownExtensibilityElement uee = (UnknownExtensibilityElement) component; - if (modelObject instanceof UnknownExtensibilityElement) - { - uee.getChildren().remove(modelObject); - } - } - - public Element createElement() - { - Definition definition = getEnclosingDefinition(); - if (definition == null) - return null; - - Document document = definition.getDocument(); - if (document == null) - document = ((DefinitionImpl) definition).updateDocument(); - - Element newElement = null; - if (element != null) // This is an old element. - { - newElement = (Element) document.importNode(element, true); - element = newElement; - } - else - { - String namespace = getElementType().getNamespaceURI(); - String qualifier = definition.getPrefix(namespace); - newElement = document.createElementNS(namespace, (qualifier == null ? "" : qualifier + ":") + getElementType().getLocalPart()); - element = newElement; - } - - return newElement; - } - - private java.util.Map properties = new java.util.HashMap(); - - public void setAttribute(String key, String value) - { - properties.put(key, value); - } - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - super.changeAttribute(eAttribute); - Element theElement = getElement(); - if (theElement != null) - { - Iterator iterator = properties.entrySet().iterator(); - java.util.Map.Entry entry = null; - while (iterator.hasNext()) - { - entry = (java.util.Map.Entry) iterator.next(); - String attribute = (String) entry.getKey(); - String value = (String) entry.getValue(); - niceSetAttribute(theElement, attribute, value); - } - } - } -} //UnknownExtensibilityElementImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLElementImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLElementImpl.java deleted file mode 100644 index fc9092956..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLElementImpl.java +++ /dev/null @@ -1,1487 +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; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EContentsEList; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.WSDLElement; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.eclipse.xsd.util.XSDConstants; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.Text; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Element</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.WSDLElementImpl#getDocumentationElement <em>Documentation Element</em>}</li> - * <li>{@link org.eclipse.wsdl.impl.WSDLElementImpl#getElement <em>Element</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public abstract class WSDLElementImpl extends EObjectImpl implements WSDLElement -{ - /** - * The default value of the '{@link #getDocumentationElement() <em>Documentation Element</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDocumentationElement() - * @generated - * @ordered - */ - protected static final Element DOCUMENTATION_ELEMENT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDocumentationElement() <em>Documentation Element</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDocumentationElement() - * @generated - * @ordered - */ - protected Element documentationElement = DOCUMENTATION_ELEMENT_EDEFAULT; - - /** - * The default value of the '{@link #getElement() <em>Element</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElement() - * @generated - * @ordered - */ - protected static final Element ELEMENT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getElement() <em>Element</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getElement() - * @generated - * @ordered - */ - protected Element element = ELEMENT_EDEFAULT; - - protected boolean isReconciling = false; - protected boolean updatingDOM = false; - protected EList wsdlContents; - - private Definition enclosingDefinition; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected WSDLElementImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getWSDLElement(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Element getDocumentationElement() - { - return documentationElement; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setDocumentationElement(Element newDocumentationElement) - { - Element oldDocumentationElement = documentationElement; - documentationElement = newDocumentationElement; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.WSDL_ELEMENT__DOCUMENTATION_ELEMENT, oldDocumentationElement, documentationElement)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Element getElement() - { - return element; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setElementGen(Element newElement) - { - Element oldElement = element; - element = newElement; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.WSDL_ELEMENT__ELEMENT, oldElement, element)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setEnclosingDefinition(Definition definition) - { - enclosingDefinition = definition; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.WSDL_ELEMENT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.WSDL_ELEMENT__ELEMENT: - return getElement(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.WSDL_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.WSDL_ELEMENT__ELEMENT: - setElement((Element)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.WSDL_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.WSDL_ELEMENT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.WSDL_ELEMENT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.WSDL_ELEMENT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - } - return eDynamicIsSet(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (documentationElement: "); - result.append(documentationElement); - result.append(", element: "); - result.append(element); - result.append(')'); - return result.toString(); - } - - // - // Reconcilation methods: DOM -> Model - // - - public static class WSDLContentsEList extends EContentsEList - { - WSDLContentsEList(EObject eObject, EStructuralFeature[] eStructuralFeatures) - { - super(eObject, eStructuralFeatures); - } - - protected ListIterator newListIterator() - { - return new FeatureIteratorImpl(eObject, eStructuralFeatures); - } - - protected boolean isIncluded(EStructuralFeature eStructuralFeature) - { - EReference eReference = (EReference) eStructuralFeature; - return !eReference.isTransient(); - } - - public List basicList() - { - return new WSDLContentsEList(eObject, eStructuralFeatures); - } - - public Iterator basicIterator() - { - return new FeatureIteratorImpl(eObject, eStructuralFeatures); - } - - public static class FeatureIteratorImpl extends EContentsEList.FeatureIteratorImpl - { - public FeatureIteratorImpl(EObject eObject) - { - super(eObject, (EStructuralFeature[]) ((BasicEList) eObject.eClass().getEAllReferences()).data()); - } - - public FeatureIteratorImpl(EObject eObject, EStructuralFeature[] eStructuralFeatures) - { - super(eObject, eStructuralFeatures); - } - - protected boolean isIncluded(EStructuralFeature eStructuralFeature) - { - EReference eReference = (EReference) eStructuralFeature; - return !eReference.isTransient(); - } - } - } - - public EList getWSDLContents() - { - if (wsdlContents == null) - { - wsdlContents = new WSDLContentsEList(this, (EStructuralFeature[]) ((BasicEList) eClass().getEAllContainments()).data()); - } - - return wsdlContents; - } - - public void setElement(Element element) - { - if (element == null) - { - isReconciling = true; - setElementGen(null); - for (Iterator contents = getWSDLContents().iterator(); contents.hasNext();) - { - Object obj = contents.next(); - if (obj instanceof WSDLElementImpl) - { - WSDLElementImpl content = (WSDLElementImpl) obj; - content.setElement(null); - } - } - isReconciling = false; - } - else - { - setElementGen(element); - } - } - - public boolean eNotificationRequired() - { - return true; - } - - public void eNotify(Notification msg) - { - int eventType = msg.getEventType(); - Object feature = msg.getFeature(); - Object oldValue = msg.getOldValue(); - Object newValue = msg.getNewValue(); - - if (eClass().getEAllReferences().contains(feature)) - { - EReference eReference = (EReference) feature; - if (eReference.isContainment() && !eReference.isTransient()) - { - switch (eventType) - { - case Notification.ADD : - { - adoptContent(eReference,newValue); - break; - } - case Notification.ADD_MANY : - { - for (Iterator newValues = ((Collection) newValue).iterator(); newValues.hasNext();) - { - WSDLElement wsdlElement = (WSDLElement) newValues.next(); - adoptContent(eReference, wsdlElement); - } - break; - } - case Notification.REMOVE : - { - if (oldValue != null) - { - orphanContent(eReference, (WSDLElement) oldValue); - } - break; - } - case Notification.REMOVE_MANY : - { - for (Iterator oldValues = ((Collection) oldValue).iterator(); oldValues.hasNext();) - { - EObject object = (EObject) oldValues.next(); - orphanContent(eReference, object); - } - break; - } - case Notification.MOVE : - { - moveContent(eReference, (WSDLElement) newValue); - break; - } - case Notification.SET : - case Notification.UNSET : - { - if (oldValue != null) - { - orphanContent(eReference, oldValue); - } - if (newValue != null) - { - adoptContent(eReference, newValue); - } - break; - } - } - } - else - { - switch (eventType) - { - case Notification.ADD : - case Notification.ADD_MANY : - case Notification.REMOVE : - case Notification.REMOVE_MANY : - case Notification.MOVE : - case Notification.SET : - case Notification.UNSET : - { - changeReference(eReference); - break; - } - } - } - } - else if (eClass().getEAllAttributes().contains(feature)) - { - EAttribute eAttribute = (EAttribute) feature; - switch (eventType) - { - case Notification.ADD : - case Notification.ADD_MANY : - case Notification.REMOVE : - case Notification.REMOVE_MANY : - case Notification.MOVE : - case Notification.SET : - case Notification.UNSET : - { - changeAttribute(eAttribute); - break; - } - } - } - super.eNotify(msg); - } - - protected void orphanContent(EReference eReference, Object obj) - { - if (!isReconciling) - { - Element parent = getElement(); - if (parent != null && obj != null && obj instanceof WSDLElement) - { - WSDLElement wsdlElement = (WSDLElement)obj; - Element contentElement = wsdlElement.getElement(); - if (contentElement != null) - niceRemoveChild(contentElement.getParentNode(), contentElement); - } - else - ;//System.out.println("WSDLElement.orphanContent(), Object is: " + obj); - } - } - - protected void niceRemoveChild(Node parent, Node child) - { - if (isReconciling) - { - // System.out.println("**** cyclic dom writeback avoided " + eClass().getName()); - return; - } - forceNiceRemoveChild(parent, child); - } - - public void forceNiceRemoveChild(Node parent, Node child) - { - updatingDOM = true; - - boolean done = false; - -// System.out.println("?*"); - Node previous = child.getPreviousSibling(); - if (previous != null && previous.getNodeType() == Node.TEXT_NODE) - { - Text text = (Text)previous; - String data = text.getData(); - int index = data.lastIndexOf('\n'); - if (index != -1) - { - if (index - 1 > 0 && data.charAt(index - 1) == '\r') - { -//System.out.println("1*"); - text.deleteData(index - 1, data.length() - index + 1); - } - else - { -//System.out.println("2*"); - text.deleteData(index, data.length() - index); - } - done = true; - } - else - { - //System.out.println("No return before!"); - } - } - else - { - // System.out.println("No text node before!"); - } - - - if (!done) - { - for (Node next = child.getNextSibling(); next != null; next = next.getNextSibling()) - { - if (next.getNodeType() == Node.TEXT_NODE) - { - Text text = (Text)next; - String data = text.getData(); -/* - System.out.print("xx " + data.length() + ":: "); - for (int i = 0; i < data.length(); ++i) - { - System.out.print(" " + Integer.toHexString((int)data.charAt(i))); - } - System.out.println(); -*/ - - int index = data.indexOf('\n'); - if (index != -1) - { - if (index + 1 < data.length() && data.charAt(index + 1) == '\r') - { - // System.out.println("3*"); - text.deleteData(0, index + 2); - } - else - { - //System.out.println("4*"); - text.deleteData(0, index + 1); - } - break; - } - else - { - // System.out.println("No return after!"); - } - } - else if (next.getNodeType() == Node.ELEMENT_NODE) - { - break; - } - } - } - -// System.out.println("Removing from--------\n " + parent); -// System.out.println("Removing--------\n " + child); - if (parent != null) - parent.removeChild(child); - - updatingDOM=false; - } - - protected void moveContent(EReference eReference, WSDLElement wsdlElement) - { - if (isReconciling) - { - // System.out.println("**** cyclic dom writeback avoided " + eClass().getName()); - return; - } - //System.out.println("moving " + xsdConcreteComponent); - Node parent = getAdoptionParentNode(eReference); - if (parent != null) - { - Element child = wsdlElement.getElement(); - if (child != null) - { - List contents = getWSDLContents(); - int index = contents.indexOf(wsdlElement); - niceRemoveChild(parent, child); - niceInsertBefore - (parent, - child, - ++index == contents.size() ? - null : - ((WSDLElement)contents.get(index)).getElement()); - } - } - //System.out.println("moved " + xsdConcreteComponent); - - } - - protected void adoptContent(EReference eReference, Object object) - { - if (object instanceof WSDLElement) - { - WSDLElement wsdlElement = (WSDLElement) object; - if (isReconciling) - { - if (wsdlElement.getElement() != null) - { - ((WSDLElementImpl) wsdlElement).elementChanged(wsdlElement.getElement()); - } - } - else - { - Element childElement = wsdlElement.getElement(); - if (getElement() != null && (childElement == null || childElement.getParentNode() == null)) - { - if (childElement != null && childElement.getOwnerDocument() != getElement().getOwnerDocument()) - { - wsdlElement.setElement(null); - childElement = null; - } - - handleElementForAdopt(eReference, wsdlElement); - ((WSDLElementImpl) wsdlElement).updateElement(); - } - } - - Definition definition = getEnclosingDefinition(); - if (definition != null) - { - ((WSDLElementImpl) wsdlElement).adoptBy(definition); - } - } - else if (object instanceof Namespace) - { - // Add a namespace attribute to the Definitions element. - Namespace ns = (Namespace)object; - Node adoptionParent = getAdoptionParentNode(eReference); // Definitions node - // KB: Assumption - The prefix is unique if we are here (by the Definitions model). - if (adoptionParent != null) { - ((Element)adoptionParent).setAttribute("xmlns:"+ns.getPrefix(),ns.getURI()); - } - } - } - - protected Node getAdoptionParentNode(EReference eReference) - { - return getElement(); - } - - protected void handleElementForAdopt(EReference eReference, WSDLElement wsdlElement) - { - // Establish DOM parent-child relationship - - Node adoptionParent = getAdoptionParentNode(eReference); - Element childElement = wsdlElement.getElement(); - Element referencedElement = null; - - for (Iterator contents = getWSDLContents().iterator(); contents.hasNext(); ) - { - if (contents.next() == wsdlElement) - { - if (contents.hasNext()) - { - Object next = contents.next(); - if (next instanceof WSDLElement) - { - referencedElement = ((WSDLElement)next).getElement(); - while (referencedElement != null) - { - Node parent = referencedElement.getParentNode(); - if (parent == null ) - { - referencedElement = null; - break; - } - else if (parent == adoptionParent) - { - break; - } - else if (parent.getNodeType() == Node.ELEMENT_NODE) - { - referencedElement = (Element)parent; - } - else - { - break; - } - } - } - } - break; - } - } - - boolean isNew = false; - if (childElement == null) - { - ((WSDLElementImpl)wsdlElement).isReconciling = true; - childElement = ((WSDLElementImpl)wsdlElement).createElement(); - ((WSDLElementImpl)wsdlElement).isReconciling = false; - isNew = true; - if (childElement == null) - { - //System.out.println("not created! " + wsdlElement); - return; - } - } - - boolean isAttached = false; - for (Node rootDocument = childElement; rootDocument != null; rootDocument = rootDocument.getParentNode()) - { - if (WSDLConstants.nodeType(rootDocument) == WSDLConstants.DEFINITION) - { - isAttached = true; - break; - } - } - - if (!isAttached) - { - if (referencedElement == null && - !eReference.isMany()) - { - for (Node child = adoptionParent.getFirstChild(); child != null; child = child.getNextSibling()) - { - if (child.getNodeType() == Node.ELEMENT_NODE) - { - referencedElement = (Element)child; - break; - } - } - } - //referencedElement = computeTopLevelRefChild(adoptionParent,childElement); - niceInsertBefore(adoptionParent, childElement, referencedElement); - } - } - - public void niceInsertBefore(Node parent, Node newChild, Node referenceChild) - { - if (isReconciling) - { - // System.out.println("**** cyclic dom writeback avoided " + eClass().getName()); - return; - } - - forceNiceInsertBefore(parent, newChild, referenceChild); - } - - public void forceNiceInsertBefore(Node parent, Node newChild, Node referenceChild) - { - updatingDOM = true; - - LOOP: - for (Node child = referenceChild == null ? parent.getLastChild() : referenceChild.getPreviousSibling(); - child != null; - child = child.getPreviousSibling()) - { - switch (child.getNodeType()) - { - case Node.TEXT_NODE: - { - Text text = (Text)child; - String data = text.getData(); - -/* - System.out.print("xx " + data.length() + ":: "); - for (int i = 0; i < data.length(); ++i) - { - System.out.print(" " + Integer.toHexString((int)data.charAt(i))); - } - System.out.println(); -*/ - - int index = data.lastIndexOf('\n'); - if (index != -1) - { -// System.out.println("In here"); - - StringBuffer indent = new StringBuffer(); - for (Node ancestor = parent.getParentNode(); - ancestor != null && ancestor.getNodeType() != Node.DOCUMENT_NODE; - ancestor = ancestor.getParentNode()) - { - indent.append(" "); - } - - if (index + 1 < data.length() && data.charAt(index + 1) == '\r') - { - ++index; - } - text.replaceData(index + 1, data.length() - index - 1, indent + " "); - - // setCorrectIndentation(indent, newText); - if (referenceChild != null) - { - indent.append(" "); - } - Text newText = parent.getOwnerDocument().createTextNode("\n" + indent); -// System.out.println("Inserted..." + newText); - parent.insertBefore(newText, referenceChild); - referenceChild = newText; - break LOOP; - } - - break; - } - case Node.ELEMENT_NODE: - { - break LOOP; - } - } - } - -// System.out.println("Inserted..." + newChild); - parent.insertBefore(newChild, referenceChild); - - updatingDOM = false; - } - - protected Element computeTopLevelRefChild(Node parentNode, Node nodeToAdd) - { - Element result = null; - int a = getPrecedence(nodeToAdd); - - for (Node node = parentNode.getFirstChild(); node != null; node = node.getNextSibling()) - { - if (node.getNodeType() == Node.ELEMENT_NODE) - { - int b = getPrecedence(node); - if (b >= a) - { - result = (Element)node; - break; - } - } - } - return result; - } - - private HashMap precedenceMap = createPrecedenceMap(); - - private int getPrecedence(Node node) - { - int result = 2; - String localName = node.getLocalName(); - if (localName != null) - { - Integer integer = (Integer)precedenceMap.get(localName); - if (integer != null) - { - result = integer.intValue(); - } - } - return result; - } - - private HashMap createPrecedenceMap() - { - HashMap hashMap = new HashMap(); - hashMap.put(WSDLConstants.DOCUMENTATION_ELEMENT_TAG, new Integer(1)); - hashMap.put(WSDLConstants.IMPORT_ELEMENT_TAG, new Integer(3)); - hashMap.put(WSDLConstants.TYPES_ELEMENT_TAG, new Integer(4)); - hashMap.put(WSDLConstants.MESSAGE_ELEMENT_TAG, new Integer(5)); - hashMap.put(WSDLConstants.PORT_TYPE_ELEMENT_TAG, new Integer(6)); - hashMap.put(WSDLConstants.BINDING_ELEMENT_TAG, new Integer(7)); - hashMap.put(WSDLConstants.SERVICE_ELEMENT_TAG, new Integer(8)); - return hashMap; - } - - protected void adoptBy(Definition definition) - { - for (Iterator components = getWSDLContents().iterator(); components.hasNext();) - { - Object child = components.next(); - if (child instanceof WSDLElementImpl) - { - ((WSDLElementImpl) child).adoptBy(definition); - } - } - } - - protected boolean isUpdatingDOM() - { - return updatingDOM; - } - - public void elementChanged(Element changedElement) - { - if (!isUpdatingDOM()) - { - if (!isReconciling) - { - //System.out.println("**** changeFor " + eClass().getName()); - isReconciling = true; - reconcile(changedElement); - - WSDLElement theContainer = getContainer(); - if (theContainer != null && theContainer.getElement() == changedElement) - { - ((WSDLElementImpl) theContainer).elementChanged(changedElement); - } - - isReconciling = false; - traverseToRootForPatching(); - } - else - { - ; //System.out.println("**** cyclic internal reconcile avoided " + eClass().getName()); - } - } - else - { - ; //System.out.println("**** cyclic DOM reconcile avoided " + eClass().getName()); - } - } - - protected void handleUnreconciledElement(Element child, Collection remainingModelObjects) - { - } - - protected void handleReconciliation(Collection remainingModelObjects) - { - } - - /** - * @deprecated - * TODO... remove this method! - */ - public Collection getModelObjects(Object component) - { - return getWSDLContents(); - } - - /* - protected Element getElementForModelObject(Object modelObject) - { - Element result = null; - if (modelObject instanceof Element) - { - result = (Element) modelObject; - } - else if (modelObject instanceof WSDLElement) - { - result = ((WSDLElement) modelObject).getElement(); - } - return result; - } - */ - - private Collection getContentNodes(Element changedElement) - { - Collection result = new ArrayList(); - for (Node child = changedElement.getFirstChild(); child != null; child = child.getNextSibling()) - { - if (child.getNodeType() == Node.ELEMENT_NODE) - { - result.add(child); - } - } - return result; - } - - // Some subclasses use this method - protected QName createQName(Definition definition, String prefixedName) - { - QName qname = null; - if (prefixedName != null) - { - int index = prefixedName.indexOf(":"); - String prefix = (index == -1) ? "" : prefixedName.substring(0, index); - String namespace = definition.getNamespace(prefix); - if (namespace != null) - { - String localPart = prefixedName.substring(index + 1); - qname = new QName(namespace, localPart); - } - } - return qname; - } - - // - // For reconciliation: Model -> DOM - // - - public void updateElement(boolean deep) - { - if (deep || getElement() == null) - { - updateElement(); - } - else - { - changeAttribute(null); - changeReference(null); - } - } - - public void updateElement() - { - if (getElement() == null) - { - isReconciling = true; - createElement(); - isReconciling = false; - } - - changeAttribute(null); - changeReference(null); - - Object obj = null; - for (Iterator containments = eClass().getEAllContainments().iterator(); containments.hasNext();) - { - EReference eReference = (EReference) containments.next(); - if (eReference == WSDLPackage.eINSTANCE.getXSDSchemaExtensibilityElement_Schema()) - { - // TBD - This is an instance of XSDSchemaExtensibilityElement and - // eRefernce is XSDSchema. What do we want to do for update? - } - else if (!eReference.isTransient()) - { - if (eReference.isMany()) - { - for (Iterator objects = ((Collection) eGet(eReference)).iterator(); objects.hasNext();) - { - obj = objects.next(); - if (!(obj instanceof WSDLElement) || obj == null) - { - // Skip it. Probably this is Namespace. - } - else - { - WSDLElement wsdlElement = (WSDLElement) obj; - //handleElementForAdopt(eReference, wsdlElement); - ((WSDLElementImpl) wsdlElement).updateElement(); - } - } - } - else - { - WSDLElement wsdlElement = (WSDLElement) eGet(eReference); - if (wsdlElement != null) - { - //handleElementForAdopt(eReference, wsdlElement); - ((WSDLElementImpl) wsdlElement).updateElement(); - } - } - } // end else if - } // end for - } - - protected void changeAttribute(EAttribute eAttribute) - { - if (eAttribute == WSDLPackage.eINSTANCE.getWSDLElement_Element()) - { - Element theElement = getElement(); - if (theElement != null && !isReconciling) - { - for (Node rootDocument = theElement.getParentNode(); rootDocument != null; rootDocument = rootDocument.getParentNode()) - { - if (rootDocument.getNodeType() == Node.DOCUMENT_NODE) - { - isReconciling = true; - if (getEnclosingDefinition() == null) - { - reconcileAttributes(getElement()); - isReconciling = false; - } - else - { - reconcile(getElement()); - isReconciling = false; - traverseToRootForPatching(); - } - break; - } - } - } - } - - } - - protected void traverseToRootForPatching() - { - if (!isReconciling) - { - WSDLElementImpl container = (WSDLElementImpl)getContainer(); - if (container != null) - { - container.traverseToRootForPatching(); - } - } - } - - protected void reconcile(Element changedElement) - { - reconcileAttributes(changedElement); - reconcileContents(changedElement); - } - - protected void reconcileAttributes(Element changedElement) - { - } - - protected void reconcileContents(Element changedElement) - { - List remainingModelObjects = new ArrayList(getWSDLContents()); - - Collection contentNodes = getContentNodes(changedElement); - - Element theDocumentationElement = null; - - // for each applicable child node of changedElement - LOOP : for (Iterator i = contentNodes.iterator(); i.hasNext();) - { - Element child = (Element) i.next(); - // Set Documentation element if exists - if (WSDLConstants.DOCUMENTATION_ELEMENT_TAG.equals(child.getLocalName()) && - WSDLConstants.isMatchingNamespace(child.getNamespaceURI(), WSDLConstants.WSDL_NAMESPACE_URI)) - { - // assume the first 'documentation' element is 'the' documentation element - // 'there can be only one!' - if (theDocumentationElement == null) - { - theDocumentationElement = child; - } - } - // go thru the model objects to collect matching object for reuse - for (Iterator contents = remainingModelObjects.iterator(); contents.hasNext();) - { - Object modelObject = (Object) contents.next(); - if (((WSDLElement) modelObject).getElement() == child) - { - contents.remove(); // removes the 'child' Node from the remainingModelObjects list - continue LOOP; - } - } - - // if the documentation element has changed... update it - // - if (theDocumentationElement != getDocumentationElement()) - { - setDocumentationElement(theDocumentationElement); - } - - // we haven't found a matching model object for the Node, se we may need to - // create a new model object - handleUnreconciledElement(child, remainingModelObjects); - } - - // now we can remove the remaining model objects - handleReconciliation(remainingModelObjects); - - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public Definition getEnclosingDefinition() - { - if (enclosingDefinition != null) - return enclosingDefinition; - - // TBD - Revisit - //EObject c = eContaier(); c != null; c = c.eContainter()) - //{ - - for (WSDLElement container = this; container != null; container = ((WSDLElementImpl) container).getContainer()) - { - if (container instanceof Definition) - { - enclosingDefinition = (Definition) container; - return enclosingDefinition; - } - } - - return null; - } - - /* - public Definition getRootEnclosingDefinition() - { - if (enclosingDefinition == null) - { - Resource resource = eResource(); - List contents = resource.getContents(); - if (contents.size() == 1 - && contents.get(0) instanceof Definition) - enclosingDefinition = (Definition)contents.get(0); - } - return enclosingDefinition; - } - */ - - public WSDLElement getContainer() - { - return eContainer() instanceof WSDLElement ? (WSDLElement) eContainer() : null; - } - - protected void niceSetAttribute(Element element, String attribute, String value) - { - if (isReconciling) - { - //System.out.println("**** cyclic dom attribute writeback avoided " + eClass().getName()); - return; - } - - if (value == null) - { - if (element.hasAttributeNS(null, attribute)) - { - updatingDOM = true; - element.removeAttribute(attribute); - updatingDOM = false; - } - } - else if (!element.hasAttributeNS(null, attribute) || !element.getAttributeNS(null, attribute).equals(value)) - { - updatingDOM = true; - element.setAttributeNS(null, attribute, value); - updatingDOM = false; - } - } - - protected String niceCreateNamespaceAttribute(String namespace) - { - // Create and return a unique prefix for "namespace." - return null; - } - - protected void niceSetAttributeURIValue(Element element, String attribute, String uriList) - { - if (isReconciling) - { - // System.out.println("**** cyclic dom attribute writeback avoided " + eClass().getName()); - return; - } - - if (uriList == null) - { - updatingDOM = true; - element.removeAttribute(attribute); - updatingDOM = false; - } - else - { - StringBuffer value = new StringBuffer(); - for (StringTokenizer stringTokenizer = new StringTokenizer(uriList, " "); stringTokenizer.hasMoreElements();) - { - String uri = stringTokenizer.nextToken(); - String namespace = null; - String localName = uri; - int index = uri.lastIndexOf("#"); - if (index != -1) - { - if (index > 0) - { - namespace = uri.substring(0, index); - } - localName = uri.substring(index + 1); - } - String qualifier = XSDConstants.lookupQualifier(element, namespace); - if (qualifier == null) - { - qualifier = niceCreateNamespaceAttribute(namespace); - } - - String qName = qualifier == null || qualifier.length() == 0 ? localName : qualifier + ":" + localName; - - if (value.length() != 0) - { - value.append(' '); - } - value.append(qName); - } - - if (!element.hasAttributeNS(null, attribute) || !element.getAttributeNS(null, attribute).equals(value.toString())) - { - updatingDOM = true; - element.setAttributeNS(null, attribute, value.toString()); - updatingDOM = false; - } - } - } - - protected void changeReference(EReference eReference) - { - } - - protected Element createElement() // Should I make this abstract? - { - return null; - } - - protected final Element createElement(int nodeType) - { - Definition definition = null; - if (this instanceof Definition) - definition = (Definition) this; - else - definition = getEnclosingDefinition(); - - if (definition == null) - return null; - - Document document = definition.getDocument(); - if (document == null) - document = ((DefinitionImpl) definition).updateDocument(); - - // Retrieve the namespace prefix for the WSDL namespace - String wsdlNamespace = WSDLConstants.WSDL_NAMESPACE_URI; - String qualifier = definition.getPrefix(wsdlNamespace); - - Element newElement = document.createElementNS(wsdlNamespace, (qualifier == null ? "" : qualifier + ":") + WSDLConstants.getElementTag(nodeType)); - - if (document.getDocumentElement() == null) - document.appendChild(newElement); - - if (getDocumentationElement() != null) - newElement.appendChild(document.importNode(getDocumentationElement(), true)); - - return newElement; - } - - public void reconcileReferences(boolean deep) - { - if (deep) - { - for (Iterator contents = getWSDLContents().iterator(); contents.hasNext();) - { - Object content = contents.next(); - if (content instanceof WSDLElementImpl) - { - WSDLElementImpl element = (WSDLElementImpl) content; - element.isReconciling = true; - element.reconcileReferences(true); - element.isReconciling = false; - } - } - } - } - - public WSDLElement getBestWSDLElement(List elementPath) - { - WSDLElement result = this; - for (Iterator components = getWSDLContents().iterator(); components.hasNext(); ) - { - WSDLElementImpl childWSDLElement = (WSDLElementImpl)components.next(); - if (elementPath.contains(childWSDLElement.getElement())) - { - result = childWSDLElement; - WSDLElement betterWSDLElement = childWSDLElement.getBestWSDLElement(elementPath); - if (betterWSDLElement != null) - { - result = betterWSDLElement; - } - - if (!considerAllContainsForBestWSDLElement()) - { - break; - } - } - } - - return result; - } - - protected boolean considerAllContainsForBestWSDLElement() - { - return false; - } - - public void elementAttributesChanged(Element changedElement) - { - if (!isUpdatingDOM()) - { - if (!isReconciling) - { - // System.out.println("**** changeFor " + eClass().getName()); - - isReconciling = true; - reconcileAttributes(changedElement); - - WSDLElementImpl theContainer = (WSDLElementImpl)getContainer(); - if (theContainer != null && theContainer.getElement() == changedElement) - { - theContainer.elementAttributesChanged(changedElement); - } - - isReconciling = false; - traverseToRootForPatching(); - } - else - { - // System.out.println("**** cyclic internal reconcile avoided " + eClass().getName()); - } - } - else - { - // System.out.println("**** cyclic DOM reconcile avoided " + eClass().getName()); - } - } - - public void elementContentsChanged(Element changedElement) - { - if (!isUpdatingDOM()) - { - if (!isReconciling) - { - // System.out.println("**** changeFor " + eClass().getName()); - - isReconciling = true; - reconcileContents(changedElement); - - WSDLElementImpl theContainer = (WSDLElementImpl)getContainer(); - if (theContainer != null && theContainer.getElement() == changedElement) - { - theContainer.elementContentsChanged(changedElement); - } - - isReconciling = false; - traverseToRootForPatching(); - } - else - { - // System.out.println("**** cyclic internal reconcile avoided " + eClass().getName()); - } - } - else - { - // System.out.println("**** cyclic DOM reconcile avoided " + eClass().getName()); - } - } - - protected void updatePrefix(Node node, String namespace, String oldPrefix, String newPrefix) - { - if ((namespace == null ? node.getNamespaceURI() == null : namespace.equals(node.getNamespaceURI())) && - (oldPrefix == null ? node.getPrefix() == null : oldPrefix.equals(node.getPrefix()))) - { - node.setPrefix(newPrefix); - } - - for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) - { - updatePrefix(child, namespace, oldPrefix, newPrefix); - } - } - - protected String getNamespace(Element element) - { - String name = element.getTagName(); - int index = name.indexOf(":"); - if (index == -1) - return null; - else if (getEnclosingDefinition() != null) - return getEnclosingDefinition().getNamespace(name.substring(0,index)); - else - return null; - } - - protected String getLocalName(Element element) - { - String name = element.getTagName(); - int index = name.indexOf(":"); - if ( index == -1) - return name; - else - return name.substring(index+1); - } - -} //WSDLElementImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLFactoryImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLFactoryImpl.java deleted file mode 100644 index c6cdfd3d9..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLFactoryImpl.java +++ /dev/null @@ -1,523 +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; - -import javax.wsdl.OperationType; -import javax.wsdl.WSDLException; -import javax.xml.namespace.QName; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.Types; -import org.eclipse.wst.wsdl.UnknownExtensibilityElement; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.WSDLPlugin; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; -import org.eclipse.wst.wsdl.util.ExtensibilityElementFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - - -/** - * <!-- begin-user-doc --> - * An implementation of the model <b>Factory</b>. - * <!-- end-user-doc --> - * @generated - */ -public class WSDLFactoryImpl extends EFactoryImpl implements WSDLFactory -{ - /** - * Creates and instance of the factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLFactoryImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case WSDLPackage.PORT_TYPE: return createPortType(); - case WSDLPackage.OPERATION: return createOperation(); - case WSDLPackage.MESSAGE: return createMessage(); - case WSDLPackage.PART: return createPart(); - case WSDLPackage.BINDING: return createBinding(); - case WSDLPackage.BINDING_OPERATION: return createBindingOperation(); - case WSDLPackage.SERVICE: return createService(); - case WSDLPackage.PORT: return createPort(); - case WSDLPackage.EXTENSIBILITY_ELEMENT: return createExtensibilityElement(); - case WSDLPackage.DEFINITION: return createDefinition(); - case WSDLPackage.IMPORT: return createImport(); - case WSDLPackage.INPUT: return createInput(); - case WSDLPackage.OUTPUT: return createOutput(); - case WSDLPackage.FAULT: return createFault(); - case WSDLPackage.BINDING_INPUT: return createBindingInput(); - case WSDLPackage.BINDING_OUTPUT: return createBindingOutput(); - case WSDLPackage.BINDING_FAULT: return createBindingFault(); - case WSDLPackage.NAMESPACE: return createNamespace(); - case WSDLPackage.TYPES: return createTypes(); - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT: return createUnknownExtensibilityElement(); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT: return createXSDSchemaExtensibilityElement(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object createFromString(EDataType eDataType, String initialValue) - { - switch (eDataType.getClassifierID()) - { - case WSDLPackage.QNAME: - return createQNameFromString(eDataType, initialValue); - case WSDLPackage.OPERATION_TYPE: - return createOperationTypeFromString(eDataType, initialValue); - case WSDLPackage.DOM_ELEMENT: - return createDOMElementFromString(eDataType, initialValue); - case WSDLPackage.WSDL_EXCEPTION: - return createWSDLExceptionFromString(eDataType, initialValue); - case WSDLPackage.DOM_DOCUMENT: - return createDOMDocumentFromString(eDataType, initialValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertToString(EDataType eDataType, Object instanceValue) - { - switch (eDataType.getClassifierID()) - { - case WSDLPackage.QNAME: - return convertQNameToString(eDataType, instanceValue); - case WSDLPackage.OPERATION_TYPE: - return convertOperationTypeToString(eDataType, instanceValue); - case WSDLPackage.DOM_ELEMENT: - return convertDOMElementToString(eDataType, instanceValue); - case WSDLPackage.WSDL_EXCEPTION: - return convertWSDLExceptionToString(eDataType, instanceValue); - case WSDLPackage.DOM_DOCUMENT: - return convertDOMDocumentToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public PortType createPortType() - { - PortTypeImpl portType = new PortTypeImpl(); - return portType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Operation createOperation() - { - OperationImpl operation = new OperationImpl(); - return operation; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Message createMessage() - { - MessageImpl message = new MessageImpl(); - return message; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Part createPart() - { - PartImpl part = new PartImpl(); - return part; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Binding createBinding() - { - BindingImpl binding = new BindingImpl(); - return binding; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public BindingOperation createBindingOperation() - { - BindingOperationImpl bindingOperation = new BindingOperationImpl(); - return bindingOperation; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Service createService() - { - ServiceImpl service = new ServiceImpl(); - return service; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Port createPort() - { - PortImpl port = new PortImpl(); - return port; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public ExtensibilityElement createExtensibilityElement() - { - ExtensibilityElementImpl extensibilityElement = new ExtensibilityElementImpl(); - return extensibilityElement; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Definition createDefinition() - { - DefinitionImpl definition = new DefinitionImpl(); - return definition; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Import createImport() - { - ImportImpl import_ = new ImportImpl(); - return import_; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Input createInput() - { - InputImpl input = new InputImpl(); - return input; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Output createOutput() - { - OutputImpl output = new OutputImpl(); - return output; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Fault createFault() - { - FaultImpl fault = new FaultImpl(); - return fault; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public BindingInput createBindingInput() - { - BindingInputImpl bindingInput = new BindingInputImpl(); - return bindingInput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public BindingOutput createBindingOutput() - { - BindingOutputImpl bindingOutput = new BindingOutputImpl(); - return bindingOutput; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public BindingFault createBindingFault() - { - BindingFaultImpl bindingFault = new BindingFaultImpl(); - return bindingFault; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Namespace createNamespace() - { - NamespaceImpl namespace = new NamespaceImpl(); - return namespace; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Types createTypes() - { - TypesImpl types = new TypesImpl(); - return types; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public UnknownExtensibilityElement createUnknownExtensibilityElement() - { - UnknownExtensibilityElementImpl unknownExtensibilityElement = new UnknownExtensibilityElementImpl(); - return unknownExtensibilityElement; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDSchemaExtensibilityElement createXSDSchemaExtensibilityElement() - { - XSDSchemaExtensibilityElementImpl xsdSchemaExtensibilityElement = new XSDSchemaExtensibilityElementImpl(); - return xsdSchemaExtensibilityElement; - } - - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public QName createQNameFromString(EDataType eDataType, String initialValue) - { - return (QName)super.createFromString(eDataType, initialValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertQNameToString(EDataType eDataType, Object instanceValue) - { - return super.convertToString(eDataType, instanceValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public OperationType createOperationTypeFromString(EDataType eDataType, String initialValue) - { - return (OperationType)super.createFromString(eDataType, initialValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertOperationTypeToString(EDataType eDataType, Object instanceValue) - { - return super.convertToString(eDataType, instanceValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Element createDOMElementFromString(EDataType eDataType, String initialValue) - { - return (Element)super.createFromString(eDataType, initialValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertDOMElementToString(EDataType eDataType, Object instanceValue) - { - return super.convertToString(eDataType, instanceValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLException createWSDLExceptionFromString(EDataType eDataType, String initialValue) - { - return (WSDLException)super.createFromString(eDataType, initialValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertWSDLExceptionToString(EDataType eDataType, Object instanceValue) - { - return super.convertToString(eDataType, instanceValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Document createDOMDocumentFromString(EDataType eDataType, String initialValue) - { - return (Document)super.createFromString(eDataType, initialValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertDOMDocumentToString(EDataType eDataType, Object instanceValue) - { - return super.convertToString(eDataType, instanceValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLPackage getWSDLPackage() - { - return (WSDLPackage)getEPackage(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @deprecated - * @generated - */ - public static WSDLPackage getPackage() - { - return WSDLPackage.eINSTANCE; - } - - // - // - // - public ExtensibilityElement createExtensibilityElement(String namespace, String localName) - { - ExtensibilityElementFactory factory = WSDLPlugin.INSTANCE.getExtensibilityElementFactory(namespace); - if (factory != null) - return factory.createExtensibilityElement(namespace, localName); - else - return createUnknownExtensibilityElement(); - } - - /* - public void setAlwaysUseUnknownExtensibilityElement(boolean value) - { - System.out.println("Deprecated: WSDLFactoryImpl.setUseExtensionFactories"); - } - */ -} //WSDLFactoryImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLPackageImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLPackageImpl.java deleted file mode 100644 index 84c303d9e..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/WSDLPackageImpl.java +++ /dev/null @@ -1,2506 +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; - -import java.net.URL; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.wsdl.OperationType; -import javax.wsdl.WSDLException; -import javax.wsdl.extensions.ExtensionRegistry; -import javax.xml.namespace.QName; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.ExtensibleElement; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.MessageReference; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.Types; -import org.eclipse.wst.wsdl.UnknownExtensibilityElement; -import org.eclipse.wst.wsdl.WSDLElement; -import org.eclipse.wst.wsdl.WSDLFactory; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; -import org.eclipse.xsd.XSDPackage; -import org.eclipse.xsd.impl.XSDPackageImpl; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * <!-- begin-user-doc --> - * An implementation of the model <b>Package</b>. - * <!-- end-user-doc --> - * @generated - */ -public class WSDLPackageImpl extends EPackageImpl implements WSDLPackage -{ - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass wsdlElementEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass portTypeEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass operationEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass messageEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass partEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass bindingEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass bindingOperationEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass serviceEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass portEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass extensibilityElementEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass definitionEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass importEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass extensibleElementEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass inputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass outputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass faultEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass bindingInputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass bindingOutputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass bindingFaultEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass namespaceEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iPortTypeEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iOperationEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iInputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iOutputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iFaultEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iMessageEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iPartEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iServiceEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iPortEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iBindingEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iBindingOperationEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iBindingInputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iBindingOutputEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iBindingFaultEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iExtensibilityElementEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iDefinitionEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iImportEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iListEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iMapEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iurlEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iExtensionRegistryEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass typesEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iIteratorEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass iTypesEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass unknownExtensibilityElementEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass xsdSchemaExtensibilityElementEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EClass messageReferenceEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EDataType qNameEDataType = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EDataType operationTypeEDataType = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EDataType domElementEDataType = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EDataType wsdlExceptionEDataType = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private EDataType domDocumentEDataType = null; - - /** - * Creates an instance of the model <b>Package</b>, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - * <p>Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.wst.wsdl.WSDLPackage#eNS_URI - * @see #init() - * @generated - */ - private WSDLPackageImpl() - { - super(eNS_URI, WSDLFactory.eINSTANCE); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the <b>Package</b> for this - * model, and for any others upon which it depends. Simple - * dependencies are satisfied by calling this method on all - * dependent packages before doing anything else. This method drives - * initialization for interdependent packages directly, in parallel - * with this package, itself. - * <p>Of this package and its interdependencies, all packages which - * have not yet been registered by their URI values are first created - * and registered. The packages are then initialized in two steps: - * meta-model objects for all of the packages are created before any - * are initialized, since one package's meta-model objects may refer to - * those of another. - * <p>Invocation of this method will not affect any packages that have - * already been initialized. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static WSDLPackage init() - { - if (isInited) return (WSDLPackage)EPackage.Registry.INSTANCE.getEPackage(WSDLPackage.eNS_URI); - - // Obtain or create and register package - WSDLPackageImpl theWSDLPackage = (WSDLPackageImpl) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof WSDLPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new WSDLPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - XSDPackageImpl.init(); - - // Create package meta-data objects - theWSDLPackage.createPackageContents(); - - theWSDLPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theWSDLPackage.freeze(); - - return theWSDLPackage; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getWSDLElement() - { - return wsdlElementEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getWSDLElement_DocumentationElement() - { - return (EAttribute) wsdlElementEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getWSDLElement_Element() - { - return (EAttribute) wsdlElementEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getPortType() - { - return portTypeEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPortType_QName() - { - return (EAttribute) portTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPortType_Undefined() - { - return (EAttribute) portTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPortType_Proxy() - { - return (EAttribute) portTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPortType_ResourceURI() - { - return (EAttribute) portTypeEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getPortType_EOperations() - { - return (EReference) portTypeEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getOperation() - { - return operationEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getOperation_Style() - { - return (EAttribute) operationEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getOperation_Name() - { - return (EAttribute) operationEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getOperation_Undefined() - { - return (EAttribute) operationEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getOperation_Proxy() - { - return (EAttribute) operationEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getOperation_ResourceURI() - { - return (EAttribute) operationEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getOperation_EInput() - { - return (EReference) operationEClass.getEStructuralFeatures().get(5); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getOperation_EOutput() - { - return (EReference) operationEClass.getEStructuralFeatures().get(6); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getOperation_EFaults() - { - return (EReference) operationEClass.getEStructuralFeatures().get(7); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getOperation_EParameterOrdering() - { - return (EReference) operationEClass.getEStructuralFeatures().get(8); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getMessage() - { - return messageEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getMessage_QName() - { - return (EAttribute) messageEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getMessage_Undefined() - { - return (EAttribute) messageEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getMessage_Proxy() - { - return (EAttribute) messageEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getMessage_ResourceURI() - { - return (EAttribute) messageEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getMessage_EParts() - { - return (EReference) messageEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getPart() - { - return partEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPart_Name() - { - return (EAttribute) partEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPart_ElementName() - { - return (EAttribute) partEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPart_TypeName() - { - return (EAttribute) partEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getPart_TypeDefinition() - { - return (EReference) partEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getPart_ElementDeclaration() - { - return (EReference) partEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getPart_EMessage() - { - return (EReference) partEClass.getEStructuralFeatures().get(5); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getBinding() - { - return bindingEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBinding_QName() - { - return (EAttribute) bindingEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBinding_Undefined() - { - return (EAttribute) bindingEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBinding_Proxy() - { - return (EAttribute) bindingEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBinding_ResourceURI() - { - return (EAttribute) bindingEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBinding_EPortType() - { - return (EReference) bindingEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBinding_EBindingOperations() - { - return (EReference) bindingEClass.getEStructuralFeatures().get(5); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getBindingOperation() - { - return bindingOperationEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBindingOperation_Name() - { - return (EAttribute) bindingOperationEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingOperation_EOperation() - { - return (EReference) bindingOperationEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingOperation_EBindingInput() - { - return (EReference) bindingOperationEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingOperation_EBindingOutput() - { - return (EReference) bindingOperationEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingOperation_EBindingFaults() - { - return (EReference) bindingOperationEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getService() - { - return serviceEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getService_QName() - { - return (EAttribute) serviceEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getService_Undefined() - { - return (EAttribute) serviceEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getService_Proxy() - { - return (EAttribute) serviceEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getService_ResourceURI() - { - return (EAttribute) serviceEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getService_EPorts() - { - return (EReference) serviceEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getPort() - { - return portEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getPort_Name() - { - return (EAttribute) portEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getPort_EBinding() - { - return (EReference) portEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getExtensibilityElement() - { - return extensibilityElementEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getExtensibilityElement_Required() - { - return (EAttribute) extensibilityElementEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getExtensibilityElement_ElementType() - { - return (EAttribute) extensibilityElementEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getDefinition() - { - return definitionEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getDefinition_TargetNamespace() - { - return (EAttribute) definitionEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getDefinition_Location() - { - return (EAttribute) definitionEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getDefinition_QName() - { - return (EAttribute) definitionEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getDefinition_Encoding() - { - return (EAttribute) definitionEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_EMessages() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(6); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_EPortTypes() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(7); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_EBindings() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(8); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_EServices() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(9); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_ENamespaces() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(10); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_ETypes() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(5); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getDefinition_EImports() - { - return (EReference) definitionEClass.getEStructuralFeatures().get(4); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getImport() - { - return importEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getImport_NamespaceURI() - { - return (EAttribute) importEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getImport_LocationURI() - { - return (EAttribute) importEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getImport_EDefinition() - { - return (EReference) importEClass.getEStructuralFeatures().get(2); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getImport_ESchema() - { - return (EReference) importEClass.getEStructuralFeatures().get(3); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getExtensibleElement() - { - return extensibleElementEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getExtensibleElement_EExtensibilityElements() - { - return (EReference) extensibleElementEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getInput() - { - return inputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getOutput() - { - return outputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getFault() - { - return faultEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getBindingInput() - { - return bindingInputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBindingInput_Name() - { - return (EAttribute) bindingInputEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingInput_EInput() - { - return (EReference) bindingInputEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getBindingOutput() - { - return bindingOutputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBindingOutput_Name() - { - return (EAttribute) bindingOutputEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingOutput_EOutput() - { - return (EReference) bindingOutputEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getBindingFault() - { - return bindingFaultEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getBindingFault_Name() - { - return (EAttribute) bindingFaultEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getBindingFault_EFault() - { - return (EReference) bindingFaultEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getNamespace() - { - return namespaceEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getNamespace_URI() - { - return (EAttribute) namespaceEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getNamespace_Prefix() - { - return (EAttribute) namespaceEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIPortType() - { - return iPortTypeEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIOperation() - { - return iOperationEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIInput() - { - return iInputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIOutput() - { - return iOutputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIFault() - { - return iFaultEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIMessage() - { - return iMessageEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIPart() - { - return iPartEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIService() - { - return iServiceEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIPort() - { - return iPortEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIBinding() - { - return iBindingEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIBindingOperation() - { - return iBindingOperationEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIBindingInput() - { - return iBindingInputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIBindingOutput() - { - return iBindingOutputEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIBindingFault() - { - return iBindingFaultEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIExtensibilityElement() - { - return iExtensibilityElementEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIDefinition() - { - return iDefinitionEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIImport() - { - return iImportEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIList() - { - return iListEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIMap() - { - return iMapEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIURL() - { - return iurlEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIExtensionRegistry() - { - return iExtensionRegistryEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getTypes() - { - return typesEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getIIterator() - { - return iIteratorEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getITypes() - { - return iTypesEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getUnknownExtensibilityElement() - { - return unknownExtensibilityElementEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getUnknownExtensibilityElement_Children() - { - return (EReference) unknownExtensibilityElementEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getXSDSchemaExtensibilityElement() - { - return xsdSchemaExtensibilityElementEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getXSDSchemaExtensibilityElement_Schema() - { - return (EReference) xsdSchemaExtensibilityElementEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EClass getMessageReference() - { - return messageReferenceEClass; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EAttribute getMessageReference_Name() - { - return (EAttribute) messageReferenceEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EReference getMessageReference_EMessage() - { - return (EReference) messageReferenceEClass.getEStructuralFeatures().get(1); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EDataType getQName() - { - return qNameEDataType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EDataType getOperationType() - { - return operationTypeEDataType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EDataType getDOMElement() - { - return domElementEDataType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EDataType getWSDLException() - { - return wsdlExceptionEDataType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EDataType getDOMDocument() - { - return domDocumentEDataType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLFactory getWSDLFactory() - { - return (WSDLFactory) getEFactoryInstance(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - wsdlElementEClass = createEClass(WSDL_ELEMENT); - createEAttribute(wsdlElementEClass, WSDL_ELEMENT__DOCUMENTATION_ELEMENT); - createEAttribute(wsdlElementEClass, WSDL_ELEMENT__ELEMENT); - - portTypeEClass = createEClass(PORT_TYPE); - createEAttribute(portTypeEClass, PORT_TYPE__QNAME); - createEAttribute(portTypeEClass, PORT_TYPE__UNDEFINED); - createEAttribute(portTypeEClass, PORT_TYPE__PROXY); - createEAttribute(portTypeEClass, PORT_TYPE__RESOURCE_URI); - createEReference(portTypeEClass, PORT_TYPE__EOPERATIONS); - - operationEClass = createEClass(OPERATION); - createEAttribute(operationEClass, OPERATION__STYLE); - createEAttribute(operationEClass, OPERATION__NAME); - createEAttribute(operationEClass, OPERATION__UNDEFINED); - createEAttribute(operationEClass, OPERATION__PROXY); - createEAttribute(operationEClass, OPERATION__RESOURCE_URI); - createEReference(operationEClass, OPERATION__EINPUT); - createEReference(operationEClass, OPERATION__EOUTPUT); - createEReference(operationEClass, OPERATION__EFAULTS); - createEReference(operationEClass, OPERATION__EPARAMETER_ORDERING); - - messageEClass = createEClass(MESSAGE); - createEAttribute(messageEClass, MESSAGE__QNAME); - createEAttribute(messageEClass, MESSAGE__UNDEFINED); - createEAttribute(messageEClass, MESSAGE__PROXY); - createEAttribute(messageEClass, MESSAGE__RESOURCE_URI); - createEReference(messageEClass, MESSAGE__EPARTS); - - partEClass = createEClass(PART); - createEAttribute(partEClass, PART__NAME); - createEAttribute(partEClass, PART__ELEMENT_NAME); - createEAttribute(partEClass, PART__TYPE_NAME); - createEReference(partEClass, PART__TYPE_DEFINITION); - createEReference(partEClass, PART__ELEMENT_DECLARATION); - createEReference(partEClass, PART__EMESSAGE); - - bindingEClass = createEClass(BINDING); - createEAttribute(bindingEClass, BINDING__QNAME); - createEAttribute(bindingEClass, BINDING__UNDEFINED); - createEAttribute(bindingEClass, BINDING__PROXY); - createEAttribute(bindingEClass, BINDING__RESOURCE_URI); - createEReference(bindingEClass, BINDING__EPORT_TYPE); - createEReference(bindingEClass, BINDING__EBINDING_OPERATIONS); - - bindingOperationEClass = createEClass(BINDING_OPERATION); - createEAttribute(bindingOperationEClass, BINDING_OPERATION__NAME); - createEReference(bindingOperationEClass, BINDING_OPERATION__EOPERATION); - createEReference(bindingOperationEClass, BINDING_OPERATION__EBINDING_INPUT); - createEReference(bindingOperationEClass, BINDING_OPERATION__EBINDING_OUTPUT); - createEReference(bindingOperationEClass, BINDING_OPERATION__EBINDING_FAULTS); - - serviceEClass = createEClass(SERVICE); - createEAttribute(serviceEClass, SERVICE__QNAME); - createEAttribute(serviceEClass, SERVICE__UNDEFINED); - createEAttribute(serviceEClass, SERVICE__PROXY); - createEAttribute(serviceEClass, SERVICE__RESOURCE_URI); - createEReference(serviceEClass, SERVICE__EPORTS); - - portEClass = createEClass(PORT); - createEAttribute(portEClass, PORT__NAME); - createEReference(portEClass, PORT__EBINDING); - - extensibilityElementEClass = createEClass(EXTENSIBILITY_ELEMENT); - createEAttribute(extensibilityElementEClass, EXTENSIBILITY_ELEMENT__REQUIRED); - createEAttribute(extensibilityElementEClass, EXTENSIBILITY_ELEMENT__ELEMENT_TYPE); - - definitionEClass = createEClass(DEFINITION); - createEAttribute(definitionEClass, DEFINITION__TARGET_NAMESPACE); - createEAttribute(definitionEClass, DEFINITION__LOCATION); - createEAttribute(definitionEClass, DEFINITION__QNAME); - createEAttribute(definitionEClass, DEFINITION__ENCODING); - createEReference(definitionEClass, DEFINITION__EIMPORTS); - createEReference(definitionEClass, DEFINITION__ETYPES); - createEReference(definitionEClass, DEFINITION__EMESSAGES); - createEReference(definitionEClass, DEFINITION__EPORT_TYPES); - createEReference(definitionEClass, DEFINITION__EBINDINGS); - createEReference(definitionEClass, DEFINITION__ESERVICES); - createEReference(definitionEClass, DEFINITION__ENAMESPACES); - - importEClass = createEClass(IMPORT); - createEAttribute(importEClass, IMPORT__NAMESPACE_URI); - createEAttribute(importEClass, IMPORT__LOCATION_URI); - createEReference(importEClass, IMPORT__EDEFINITION); - createEReference(importEClass, IMPORT__ESCHEMA); - - extensibleElementEClass = createEClass(EXTENSIBLE_ELEMENT); - createEReference(extensibleElementEClass, EXTENSIBLE_ELEMENT__EEXTENSIBILITY_ELEMENTS); - - inputEClass = createEClass(INPUT); - - outputEClass = createEClass(OUTPUT); - - faultEClass = createEClass(FAULT); - - bindingInputEClass = createEClass(BINDING_INPUT); - createEAttribute(bindingInputEClass, BINDING_INPUT__NAME); - createEReference(bindingInputEClass, BINDING_INPUT__EINPUT); - - bindingOutputEClass = createEClass(BINDING_OUTPUT); - createEAttribute(bindingOutputEClass, BINDING_OUTPUT__NAME); - createEReference(bindingOutputEClass, BINDING_OUTPUT__EOUTPUT); - - bindingFaultEClass = createEClass(BINDING_FAULT); - createEAttribute(bindingFaultEClass, BINDING_FAULT__NAME); - createEReference(bindingFaultEClass, BINDING_FAULT__EFAULT); - - namespaceEClass = createEClass(NAMESPACE); - createEAttribute(namespaceEClass, NAMESPACE__URI); - createEAttribute(namespaceEClass, NAMESPACE__PREFIX); - - iPortTypeEClass = createEClass(IPORT_TYPE); - - iOperationEClass = createEClass(IOPERATION); - - iInputEClass = createEClass(IINPUT); - - iOutputEClass = createEClass(IOUTPUT); - - iFaultEClass = createEClass(IFAULT); - - iMessageEClass = createEClass(IMESSAGE); - - iPartEClass = createEClass(IPART); - - iServiceEClass = createEClass(ISERVICE); - - iPortEClass = createEClass(IPORT); - - iBindingEClass = createEClass(IBINDING); - - iBindingOperationEClass = createEClass(IBINDING_OPERATION); - - iBindingInputEClass = createEClass(IBINDING_INPUT); - - iBindingOutputEClass = createEClass(IBINDING_OUTPUT); - - iBindingFaultEClass = createEClass(IBINDING_FAULT); - - iExtensibilityElementEClass = createEClass(IEXTENSIBILITY_ELEMENT); - - iDefinitionEClass = createEClass(IDEFINITION); - - iImportEClass = createEClass(IIMPORT); - - iListEClass = createEClass(ILIST); - - iMapEClass = createEClass(IMAP); - - iurlEClass = createEClass(IURL); - - iExtensionRegistryEClass = createEClass(IEXTENSION_REGISTRY); - - typesEClass = createEClass(TYPES); - - iIteratorEClass = createEClass(IITERATOR); - - iTypesEClass = createEClass(ITYPES); - - unknownExtensibilityElementEClass = createEClass(UNKNOWN_EXTENSIBILITY_ELEMENT); - createEReference(unknownExtensibilityElementEClass, UNKNOWN_EXTENSIBILITY_ELEMENT__CHILDREN); - - xsdSchemaExtensibilityElementEClass = createEClass(XSD_SCHEMA_EXTENSIBILITY_ELEMENT); - createEReference(xsdSchemaExtensibilityElementEClass, XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA); - - messageReferenceEClass = createEClass(MESSAGE_REFERENCE); - createEAttribute(messageReferenceEClass, MESSAGE_REFERENCE__NAME); - createEReference(messageReferenceEClass, MESSAGE_REFERENCE__EMESSAGE); - - // Create data types - qNameEDataType = createEDataType(QNAME); - operationTypeEDataType = createEDataType(OPERATION_TYPE); - domElementEDataType = createEDataType(DOM_ELEMENT); - wsdlExceptionEDataType = createEDataType(WSDL_EXCEPTION); - domDocumentEDataType = createEDataType(DOM_DOCUMENT); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - XSDPackageImpl theXSDPackage = (XSDPackageImpl) EPackage.Registry.INSTANCE.getEPackage(XSDPackage.eNS_URI); - - // Add supertypes to classes - portTypeEClass.getESuperTypes().add(this.getWSDLElement()); - portTypeEClass.getESuperTypes().add(this.getIPortType()); - operationEClass.getESuperTypes().add(this.getWSDLElement()); - operationEClass.getESuperTypes().add(this.getIOperation()); - messageEClass.getESuperTypes().add(this.getWSDLElement()); - messageEClass.getESuperTypes().add(this.getIMessage()); - partEClass.getESuperTypes().add(this.getWSDLElement()); - partEClass.getESuperTypes().add(this.getIPart()); - bindingEClass.getESuperTypes().add(this.getExtensibleElement()); - bindingEClass.getESuperTypes().add(this.getIBinding()); - bindingOperationEClass.getESuperTypes().add(this.getExtensibleElement()); - bindingOperationEClass.getESuperTypes().add(this.getIBindingOperation()); - serviceEClass.getESuperTypes().add(this.getExtensibleElement()); - serviceEClass.getESuperTypes().add(this.getIService()); - portEClass.getESuperTypes().add(this.getExtensibleElement()); - portEClass.getESuperTypes().add(this.getIPort()); - extensibilityElementEClass.getESuperTypes().add(this.getWSDLElement()); - extensibilityElementEClass.getESuperTypes().add(this.getIExtensibilityElement()); - definitionEClass.getESuperTypes().add(this.getExtensibleElement()); - definitionEClass.getESuperTypes().add(this.getIDefinition()); - importEClass.getESuperTypes().add(this.getWSDLElement()); - importEClass.getESuperTypes().add(this.getIImport()); - extensibleElementEClass.getESuperTypes().add(this.getWSDLElement()); - inputEClass.getESuperTypes().add(this.getMessageReference()); - inputEClass.getESuperTypes().add(this.getWSDLElement()); - inputEClass.getESuperTypes().add(this.getIInput()); - outputEClass.getESuperTypes().add(this.getMessageReference()); - outputEClass.getESuperTypes().add(this.getWSDLElement()); - outputEClass.getESuperTypes().add(this.getIOutput()); - faultEClass.getESuperTypes().add(this.getMessageReference()); - faultEClass.getESuperTypes().add(this.getWSDLElement()); - faultEClass.getESuperTypes().add(this.getIFault()); - bindingInputEClass.getESuperTypes().add(this.getExtensibleElement()); - bindingInputEClass.getESuperTypes().add(this.getIBindingInput()); - bindingOutputEClass.getESuperTypes().add(this.getExtensibleElement()); - bindingOutputEClass.getESuperTypes().add(this.getIBindingOutput()); - bindingFaultEClass.getESuperTypes().add(this.getExtensibleElement()); - bindingFaultEClass.getESuperTypes().add(this.getIBindingFault()); - typesEClass.getESuperTypes().add(this.getExtensibleElement()); - typesEClass.getESuperTypes().add(this.getITypes()); - unknownExtensibilityElementEClass.getESuperTypes().add(this.getExtensibilityElement()); - xsdSchemaExtensibilityElementEClass.getESuperTypes().add(this.getExtensibilityElement()); - messageReferenceEClass.getESuperTypes().add(this.getWSDLElement()); - - // Initialize classes and features; add operations and parameters - initEClass(wsdlElementEClass, WSDLElement.class, "WSDLElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getWSDLElement_DocumentationElement(), this.getDOMElement(), "documentationElement", null, 0, 1, WSDLElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getWSDLElement_Element(), this.getDOMElement(), "element", null, 0, 1, WSDLElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(wsdlElementEClass, this.getDefinition(), "getEnclosingDefinition"); - - EOperation op = addEOperation(wsdlElementEClass, null, "setEnclosingDefinition"); - addEParameter(op, this.getDefinition(), "definition"); - - initEClass(portTypeEClass, PortType.class, "PortType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPortType_QName(), this.getQName(), "qName", null, 0, 1, PortType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPortType_Undefined(), ecorePackage.getEBoolean(), "undefined", null, 0, 1, PortType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPortType_Proxy(), ecorePackage.getEBoolean(), "proxy", null, 0, 1, PortType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPortType_ResourceURI(), ecorePackage.getEString(), "resourceURI", null, 0, 1, PortType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPortType_EOperations(), this.getOperation(), null, "eOperations", null, 0, -1, PortType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(operationEClass, Operation.class, "Operation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getOperation_Style(), this.getOperationType(), "style", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getOperation_Name(), ecorePackage.getEString(), "name", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getOperation_Undefined(), ecorePackage.getEBoolean(), "undefined", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getOperation_Proxy(), ecorePackage.getEBoolean(), "proxy", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getOperation_ResourceURI(), ecorePackage.getEString(), "resourceURI", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getOperation_EInput(), this.getInput(), null, "eInput", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getOperation_EOutput(), this.getOutput(), null, "eOutput", null, 0, 1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getOperation_EFaults(), this.getFault(), null, "eFaults", null, 0, -1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getOperation_EParameterOrdering(), this.getPart(), null, "eParameterOrdering", null, 0, -1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(messageEClass, Message.class, "Message", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getMessage_QName(), this.getQName(), "qName", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getMessage_Undefined(), ecorePackage.getEBoolean(), "undefined", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getMessage_Proxy(), ecorePackage.getEBoolean(), "proxy", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getMessage_ResourceURI(), ecorePackage.getEString(), "resourceURI", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getMessage_EParts(), this.getPart(), null, "eParts", null, 0, -1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(partEClass, Part.class, "Part", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPart_Name(), ecorePackage.getEString(), "name", null, 0, 1, Part.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPart_ElementName(), this.getQName(), "elementName", null, 0, 1, Part.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPart_TypeName(), this.getQName(), "typeName", null, 0, 1, Part.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPart_TypeDefinition(), theXSDPackage.getXSDTypeDefinition(), null, "typeDefinition", null, 0, 1, Part.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPart_ElementDeclaration(), theXSDPackage.getXSDElementDeclaration(), null, "elementDeclaration", null, 0, 1, Part.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPart_EMessage(), this.getMessage(), null, "eMessage", null, 0, 1, Part.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(bindingEClass, Binding.class, "Binding", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getBinding_QName(), this.getQName(), "qName", null, 0, 1, Binding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getBinding_Undefined(), ecorePackage.getEBoolean(), "undefined", null, 0, 1, Binding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getBinding_Proxy(), ecorePackage.getEBoolean(), "proxy", null, 0, 1, Binding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getBinding_ResourceURI(), ecorePackage.getEString(), "resourceURI", null, 0, 1, Binding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBinding_EPortType(), this.getPortType(), null, "ePortType", null, 1, 1, Binding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBinding_EBindingOperations(), this.getBindingOperation(), null, "eBindingOperations", null, 0, -1, Binding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(bindingOperationEClass, BindingOperation.class, "BindingOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getBindingOperation_Name(), ecorePackage.getEString(), "name", null, 0, 1, BindingOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingOperation_EOperation(), this.getOperation(), null, "eOperation", null, 1, 1, BindingOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingOperation_EBindingInput(), this.getBindingInput(), null, "eBindingInput", null, 0, 1, BindingOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingOperation_EBindingOutput(), this.getBindingOutput(), null, "eBindingOutput", null, 0, 1, BindingOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingOperation_EBindingFaults(), this.getBindingFault(), null, "eBindingFaults", null, 0, -1, BindingOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(serviceEClass, Service.class, "Service", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getService_QName(), this.getQName(), "qName", null, 0, 1, Service.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getService_Undefined(), ecorePackage.getEBoolean(), "undefined", null, 0, 1, Service.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getService_Proxy(), ecorePackage.getEBoolean(), "proxy", null, 0, 1, Service.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getService_ResourceURI(), ecorePackage.getEString(), "resourceURI", null, 0, 1, Service.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getService_EPorts(), this.getPort(), null, "ePorts", null, 0, -1, Service.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(portEClass, Port.class, "Port", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPort_Name(), ecorePackage.getEString(), "name", null, 0, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getPort_EBinding(), this.getBinding(), null, "eBinding", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(extensibilityElementEClass, ExtensibilityElement.class, "ExtensibilityElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getExtensibilityElement_Required(), ecorePackage.getEBoolean(), "required", null, 0, 1, ExtensibilityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getExtensibilityElement_ElementType(), this.getQName(), "elementType", null, 0, 1, ExtensibilityElement.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(definitionEClass, Definition.class, "Definition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getDefinition_TargetNamespace(), ecorePackage.getEString(), "targetNamespace", null, 0, 1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDefinition_Location(), ecorePackage.getEString(), "location", null, 0, 1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDefinition_QName(), this.getQName(), "qName", null, 0, 1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getDefinition_Encoding(), ecorePackage.getEString(), "encoding", null, 0, 1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_EImports(), this.getImport(), null, "eImports", null, 0, -1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_ETypes(), this.getTypes(), null, "eTypes", null, 0, 1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_EMessages(), this.getMessage(), null, "eMessages", null, 0, -1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_EPortTypes(), this.getPortType(), null, "ePortTypes", null, 0, -1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_EBindings(), this.getBinding(), null, "eBindings", null, 0, -1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_EServices(), this.getService(), null, "eServices", null, 0, -1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getDefinition_ENamespaces(), this.getNamespace(), null, "eNamespaces", null, 0, -1, Definition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(definitionEClass, this.getDOMDocument(), "getDocument"); - - op = addEOperation(definitionEClass, null, "setDocument"); - addEParameter(op, this.getDOMDocument(), "document"); - - initEClass(importEClass, Import.class, "Import", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getImport_NamespaceURI(), ecorePackage.getEString(), "namespaceURI", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getImport_LocationURI(), ecorePackage.getEString(), "locationURI", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getImport_EDefinition(), this.getDefinition(), null, "eDefinition", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getImport_ESchema(), theXSDPackage.getXSDSchema(), null, "eSchema", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(importEClass, theXSDPackage.getXSDSchema(), "getSchema"); - - op = addEOperation(importEClass, null, "setSchema"); - addEParameter(op, theXSDPackage.getXSDSchema(), "schema"); - - initEClass(extensibleElementEClass, ExtensibleElement.class, "ExtensibleElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getExtensibleElement_EExtensibilityElements(), this.getExtensibilityElement(), null, "eExtensibilityElements", null, 0, -1, ExtensibleElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(extensibleElementEClass, this.getIList(), "getExtensibilityElements"); - - op = addEOperation(extensibleElementEClass, null, "addExtensibilityElement"); - addEParameter(op, this.getIExtensibilityElement(), "extElement"); - - initEClass(inputEClass, Input.class, "Input", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(outputEClass, Output.class, "Output", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(faultEClass, Fault.class, "Fault", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(bindingInputEClass, BindingInput.class, "BindingInput", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getBindingInput_Name(), ecorePackage.getEString(), "name", null, 0, 1, BindingInput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingInput_EInput(), this.getInput(), null, "eInput", null, 1, 1, BindingInput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(bindingInputEClass, this.getIInput(), "getInput"); - - op = addEOperation(bindingInputEClass, null, "setInput"); - addEParameter(op, this.getIInput(), "input"); - - initEClass(bindingOutputEClass, BindingOutput.class, "BindingOutput", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getBindingOutput_Name(), ecorePackage.getEString(), "name", null, 0, 1, BindingOutput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingOutput_EOutput(), this.getOutput(), null, "eOutput", null, 1, 1, BindingOutput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(bindingOutputEClass, this.getIOutput(), "getOutput"); - - op = addEOperation(bindingOutputEClass, null, "setOutput"); - addEParameter(op, this.getIOutput(), "output"); - - initEClass(bindingFaultEClass, BindingFault.class, "BindingFault", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getBindingFault_Name(), ecorePackage.getEString(), "name", null, 0, 1, BindingFault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getBindingFault_EFault(), this.getFault(), null, "eFault", null, 1, 1, BindingFault.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - addEOperation(bindingFaultEClass, this.getIFault(), "getFault"); - - op = addEOperation(bindingFaultEClass, null, "setFault"); - addEParameter(op, this.getIFault(), "fault"); - - initEClass(namespaceEClass, Namespace.class, "Namespace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getNamespace_URI(), ecorePackage.getEString(), "URI", null, 0, 1, Namespace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getNamespace_Prefix(), ecorePackage.getEString(), "prefix", null, 0, 1, Namespace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(iPortTypeEClass, javax.wsdl.PortType.class, "IPortType", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iPortTypeEClass, null, "addOperation"); - addEParameter(op, this.getIOperation(), "operation"); - - op = addEOperation(iPortTypeEClass, this.getIOperation(), "getOperation"); - addEParameter(op, ecorePackage.getEString(), "name"); - addEParameter(op, ecorePackage.getEString(), "inputName"); - addEParameter(op, ecorePackage.getEString(), "outputName"); - - addEOperation(iPortTypeEClass, this.getIList(), "getOperations"); - - initEClass(iOperationEClass, javax.wsdl.Operation.class, "IOperation", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iOperationEClass, null, "addFault"); - addEParameter(op, this.getIFault(), "fault"); - - op = addEOperation(iOperationEClass, this.getIFault(), "getFault"); - addEParameter(op, ecorePackage.getEString(), "name"); - - addEOperation(iOperationEClass, this.getIMap(), "getFaults"); - - addEOperation(iOperationEClass, this.getIList(), "getParameterOrdering"); - - op = addEOperation(iOperationEClass, null, "setParameterOrdering"); - addEParameter(op, this.getIList(), "parameterOrder"); - - addEOperation(iOperationEClass, this.getIInput(), "getInput"); - - op = addEOperation(iOperationEClass, null, "setInput"); - addEParameter(op, this.getIInput(), "input"); - - addEOperation(iOperationEClass, this.getIOutput(), "getOutput"); - - op = addEOperation(iOperationEClass, null, "setOutput"); - addEParameter(op, this.getIOutput(), "output"); - - initEClass(iInputEClass, javax.wsdl.Input.class, "IInput", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(iInputEClass, this.getIMessage(), "getMessage"); - - op = addEOperation(iInputEClass, null, "setMessage"); - addEParameter(op, this.getIMessage(), "message"); - - initEClass(iOutputEClass, javax.wsdl.Output.class, "IOutput", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(iOutputEClass, this.getIMessage(), "getMessage"); - - op = addEOperation(iOutputEClass, null, "setMessage"); - addEParameter(op, this.getIMessage(), "message"); - - initEClass(iFaultEClass, javax.wsdl.Fault.class, "IFault", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(iFaultEClass, this.getIMessage(), "getMessage"); - - op = addEOperation(iFaultEClass, null, "setMessage"); - addEParameter(op, this.getIMessage(), "message"); - - initEClass(iMessageEClass, javax.wsdl.Message.class, "IMessage", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iMessageEClass, null, "addPart"); - addEParameter(op, this.getIPart(), "part"); - - op = addEOperation(iMessageEClass, this.getIPart(), "getPart"); - addEParameter(op, ecorePackage.getEString(), "name"); - - addEOperation(iMessageEClass, this.getIMap(), "getParts"); - - op = addEOperation(iMessageEClass, this.getIList(), "getOrderedParts"); - addEParameter(op, this.getIList(), "partOrder"); - - initEClass(iPartEClass, javax.wsdl.Part.class, "IPart", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iPartEClass, null, "setExtensionAttribute"); - addEParameter(op, this.getQName(), "name"); - addEParameter(op, this.getQName(), "value"); - addEException(op, this.getWSDLException()); - - addEOperation(iPartEClass, this.getIIterator(), "getExtensionAttributeNames"); - - op = addEOperation(iPartEClass, this.getQName(), "getExtensionAttribute"); - addEParameter(op, this.getQName(), "name"); - - initEClass(iServiceEClass, javax.wsdl.Service.class, "IService", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iServiceEClass, null, "addPort"); - addEParameter(op, this.getIPort(), "port"); - - addEOperation(iServiceEClass, this.getIMap(), "getPorts"); - - op = addEOperation(iServiceEClass, this.getIPort(), "getPort"); - addEParameter(op, ecorePackage.getEString(), "name"); - - initEClass(iPortEClass, javax.wsdl.Port.class, "IPort", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - addEOperation(iPortEClass, this.getIBinding(), "getBinding"); - - op = addEOperation(iPortEClass, null, "setBinding"); - addEParameter(op, this.getIBinding(), "binding"); - - initEClass(iBindingEClass, javax.wsdl.Binding.class, "IBinding", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iBindingEClass, null, "addBindingOperation"); - addEParameter(op, this.getIBindingOperation(), "bindingOperation"); - - op = addEOperation(iBindingEClass, this.getIBindingOperation(), "getBindingOperation"); - addEParameter(op, ecorePackage.getEString(), "name"); - addEParameter(op, ecorePackage.getEString(), "inputName"); - addEParameter(op, ecorePackage.getEString(), "outputName"); - - addEOperation(iBindingEClass, this.getIList(), "getBindingOperations"); - - addEOperation(iBindingEClass, this.getIPortType(), "getPortType"); - - op = addEOperation(iBindingEClass, null, "setPortType"); - addEParameter(op, this.getIPortType(), "portType"); - - initEClass(iBindingOperationEClass, javax.wsdl.BindingOperation.class, "IBindingOperation", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iBindingOperationEClass, null, "addBindingFault"); - addEParameter(op, this.getIBindingFault(), "bindingFault"); - - op = addEOperation(iBindingOperationEClass, this.getIBindingFault(), "getBindingFault"); - addEParameter(op, ecorePackage.getEString(), "name"); - - addEOperation(iBindingOperationEClass, this.getIMap(), "getBindingFaults"); - - addEOperation(iBindingOperationEClass, this.getIOperation(), "getOperation"); - - op = addEOperation(iBindingOperationEClass, null, "setOperation"); - addEParameter(op, this.getIOperation(), "operation"); - - addEOperation(iBindingOperationEClass, this.getIBindingInput(), "getBindingInput"); - - op = addEOperation(iBindingOperationEClass, null, "setBindingInput"); - addEParameter(op, this.getIBindingInput(), "bindingInput"); - - addEOperation(iBindingOperationEClass, this.getIBindingOutput(), "getBindingOutput"); - - op = addEOperation(iBindingOperationEClass, null, "setBindingOutput"); - addEParameter(op, this.getIBindingOutput(), "bindingOutput"); - - initEClass(iBindingInputEClass, javax.wsdl.BindingInput.class, "IBindingInput", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iBindingOutputEClass, javax.wsdl.BindingOutput.class, "IBindingOutput", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iBindingFaultEClass, javax.wsdl.BindingFault.class, "IBindingFault", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iExtensibilityElementEClass, javax.wsdl.extensions.ExtensibilityElement.class, "IExtensibilityElement", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iDefinitionEClass, javax.wsdl.Definition.class, "IDefinition", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - op = addEOperation(iDefinitionEClass, null, "addBinding"); - addEParameter(op, this.getIBinding(), "binding"); - - op = addEOperation(iDefinitionEClass, null, "addImport"); - addEParameter(op, this.getIImport(), "importDef"); - - op = addEOperation(iDefinitionEClass, null, "addMessage"); - addEParameter(op, this.getIMessage(), "message"); - - op = addEOperation(iDefinitionEClass, null, "addNamespace"); - addEParameter(op, ecorePackage.getEString(), "prefix"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - - op = addEOperation(iDefinitionEClass, null, "addPortType"); - addEParameter(op, this.getIPortType(), "portType"); - - op = addEOperation(iDefinitionEClass, null, "addService"); - addEParameter(op, this.getIService(), "service"); - - addEOperation(iDefinitionEClass, this.getIBindingFault(), "createBindingFault"); - - addEOperation(iDefinitionEClass, this.getIBindingInput(), "createBindingInput"); - - addEOperation(iDefinitionEClass, this.getIBindingOutput(), "createBindingOutput"); - - addEOperation(iDefinitionEClass, this.getIBindingOperation(), "createBindingOperation"); - - addEOperation(iDefinitionEClass, this.getIBinding(), "createBinding"); - - addEOperation(iDefinitionEClass, this.getIFault(), "createFault"); - - addEOperation(iDefinitionEClass, this.getIImport(), "createImport"); - - addEOperation(iDefinitionEClass, this.getIInput(), "createInput"); - - addEOperation(iDefinitionEClass, this.getIMessage(), "createMessage"); - - addEOperation(iDefinitionEClass, this.getIOperation(), "createOperation"); - - addEOperation(iDefinitionEClass, this.getIOutput(), "createOutput"); - - addEOperation(iDefinitionEClass, this.getIPart(), "createPart"); - - addEOperation(iDefinitionEClass, this.getIPort(), "createPort"); - - addEOperation(iDefinitionEClass, this.getIPortType(), "createPortType"); - - addEOperation(iDefinitionEClass, this.getIService(), "createService"); - - op = addEOperation(iDefinitionEClass, this.getIBinding(), "getBinding"); - addEParameter(op, this.getQName(), "name"); - - addEOperation(iDefinitionEClass, this.getIMap(), "getBindings"); - - addEOperation(iDefinitionEClass, this.getIMap(), "getImports"); - - op = addEOperation(iDefinitionEClass, this.getIList(), "getImports"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - - op = addEOperation(iDefinitionEClass, this.getIMessage(), "getMessage"); - addEParameter(op, this.getQName(), "name"); - - addEOperation(iDefinitionEClass, this.getIMap(), "getMessages"); - - op = addEOperation(iDefinitionEClass, ecorePackage.getEString(), "getNamespace"); - addEParameter(op, ecorePackage.getEString(), "prefix"); - - addEOperation(iDefinitionEClass, this.getIMap(), "getNamespaces"); - - op = addEOperation(iDefinitionEClass, this.getIPortType(), "getPortType"); - addEParameter(op, this.getQName(), "name"); - - addEOperation(iDefinitionEClass, this.getIMap(), "getPortTypes"); - - op = addEOperation(iDefinitionEClass, ecorePackage.getEString(), "getPrefix"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - - op = addEOperation(iDefinitionEClass, this.getIService(), "getService"); - addEParameter(op, this.getQName(), "name"); - - addEOperation(iDefinitionEClass, this.getIMap(), "getServices"); - - addEOperation(iDefinitionEClass, this.getIExtensionRegistry(), "getExtensionRegistry"); - - op = addEOperation(iDefinitionEClass, null, "setExtensionRegistry"); - addEParameter(op, this.getIExtensionRegistry(), "extensionRegistry"); - - addEOperation(iDefinitionEClass, ecorePackage.getEString(), "getDocumentBaseURI"); - - op = addEOperation(iDefinitionEClass, null, "setDocumentBaseURI"); - addEParameter(op, ecorePackage.getEString(), "documentBase"); - - addEOperation(iDefinitionEClass, this.getITypes(), "createTypes"); - - op = addEOperation(iDefinitionEClass, this.getIService(), "removeService"); - addEParameter(op, this.getQName(), "name"); - - op = addEOperation(iDefinitionEClass, this.getIBinding(), "removeBinding"); - addEParameter(op, this.getQName(), "name"); - - op = addEOperation(iDefinitionEClass, this.getIPortType(), "removePortType"); - addEParameter(op, this.getQName(), "name"); - - op = addEOperation(iDefinitionEClass, this.getIMessage(), "removeMessage"); - addEParameter(op, this.getQName(), "name"); - - addEOperation(iDefinitionEClass, this.getITypes(), "getTypes"); - - op = addEOperation(iDefinitionEClass, null, "setTypes"); - addEParameter(op, this.getITypes(), "types"); - - initEClass(iImportEClass, javax.wsdl.Import.class, "IImport", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iListEClass, List.class, "IList", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iMapEClass, Map.class, "IMap", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iurlEClass, URL.class, "IURL", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iExtensionRegistryEClass, ExtensionRegistry.class, "IExtensionRegistry", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(typesEClass, Types.class, "Types", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - addEOperation(typesEClass, this.getIList(), "getSchemas"); - - op = addEOperation(typesEClass, this.getIList(), "getSchemas"); - addEParameter(op, ecorePackage.getEString(), "namespaceURI"); - - initEClass(iIteratorEClass, Iterator.class, "IIterator", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(iTypesEClass, javax.wsdl.Types.class, "ITypes", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(unknownExtensibilityElementEClass, UnknownExtensibilityElement.class, "UnknownExtensibilityElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getUnknownExtensibilityElement_Children(), this.getUnknownExtensibilityElement(), null, "children", null, 0, -1, UnknownExtensibilityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(xsdSchemaExtensibilityElementEClass, XSDSchemaExtensibilityElement.class, "XSDSchemaExtensibilityElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getXSDSchemaExtensibilityElement_Schema(), theXSDPackage.getXSDSchema(), null, "schema", null, 0, 1, XSDSchemaExtensibilityElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(messageReferenceEClass, MessageReference.class, "MessageReference", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getMessageReference_Name(), ecorePackage.getEString(), "name", null, 0, 1, MessageReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getMessageReference_EMessage(), this.getMessage(), null, "eMessage", null, 1, 1, MessageReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Initialize data types - initEDataType(qNameEDataType, QName.class, "QName", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(operationTypeEDataType, OperationType.class, "OperationType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(domElementEDataType, Element.class, "DOMElement", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(wsdlExceptionEDataType, WSDLException.class, "WSDLException", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(domDocumentEDataType, Document.class, "DOMDocument", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - - // Create resource - createResource(eNS_URI); - } - -} //WSDLPackageImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/XSDSchemaExtensibilityElementImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/XSDSchemaExtensibilityElementImpl.java deleted file mode 100644 index e48409d6e..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/impl/XSDSchemaExtensibilityElementImpl.java +++ /dev/null @@ -1,414 +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; - -import javax.xml.namespace.QName; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; -import org.eclipse.xsd.XSDFactory; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.impl.XSDSchemaImpl; -import org.eclipse.xsd.util.XSDConstants; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>XSD Schema Extensibility Element</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.wsdl.impl.XSDSchemaExtensibilityElementImpl#getSchema <em>Schema</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class XSDSchemaExtensibilityElementImpl extends ExtensibilityElementImpl implements XSDSchemaExtensibilityElement -{ - /** - * The cached value of the '{@link #getSchema() <em>Schema</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getSchema() - * @generated - * @ordered - */ - protected XSDSchema schema = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected XSDSchemaExtensibilityElementImpl() - { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() - { - return WSDLPackage.eINSTANCE.getXSDSchemaExtensibilityElement(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public XSDSchema getSchema() - { - return schema; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetSchema(XSDSchema newSchema, NotificationChain msgs) - { - XSDSchema oldSchema = schema; - schema = newSchema; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA, oldSchema, newSchema); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setSchema(XSDSchema newSchema) - { - if (newSchema != schema) - { - NotificationChain msgs = null; - if (schema != null) - msgs = ((InternalEObject)schema).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA, null, msgs); - if (newSchema != null) - msgs = ((InternalEObject)newSchema).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA, null, msgs); - msgs = basicSetSchema(newSchema, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA, newSchema, newSchema)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) - { - if (featureID >= 0) - { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) - { - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA: - return basicSetSchema(null, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - return getDocumentationElement(); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT: - return getElement(); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__REQUIRED: - return isRequired() ? Boolean.TRUE : Boolean.FALSE; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - return getElementType(); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA: - return getSchema(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement((Element)newValue); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT: - setElement((Element)newValue); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__REQUIRED: - setRequired(((Boolean)newValue).booleanValue()); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - setElementType((QName)newValue); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA: - setSchema((XSDSchema)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - setDocumentationElement(DOCUMENTATION_ELEMENT_EDEFAULT); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT: - setElement(ELEMENT_EDEFAULT); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__REQUIRED: - setRequired(REQUIRED_EDEFAULT); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - setElementType(ELEMENT_TYPE_EDEFAULT); - return; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA: - setSchema((XSDSchema)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) - { - switch (eDerivedStructuralFeatureID(eFeature)) - { - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__DOCUMENTATION_ELEMENT: - return DOCUMENTATION_ELEMENT_EDEFAULT == null ? documentationElement != null : !DOCUMENTATION_ELEMENT_EDEFAULT.equals(documentationElement); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT: - return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__REQUIRED: - return required != REQUIRED_EDEFAULT; - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__ELEMENT_TYPE: - return ELEMENT_TYPE_EDEFAULT == null ? elementType != null : !ELEMENT_TYPE_EDEFAULT.equals(elementType); - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT__SCHEMA: - return schema != null; - } - return eDynamicIsSet(eFeature); - } - - /* (non-Javadoc) - * @see org.eclipse.wsdl.impl.WSDLElementImpl#reconcile(org.w3c.dom.Element) - */ - protected void reconcile(Element changedElement) - { - element = changedElement; // This line may not needed. - if (schema == null) - { - XSDSchema newSchema = XSDSchemaImpl.createSchema(changedElement); - setSchema(newSchema); - } - } - - public XSDSchema createSchema(Element element) - { - if (element.getLocalName().equals("schema") && XSDConstants.isSchemaForSchemaNamespace(element.getNamespaceURI())) - { - XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema(); - xsdSchema.setElement(element); - return xsdSchema; - } - else - { - return null; - } - } - - public Element getElement() - { - if (element != null) - return element; - else if (getSchema() != null) - element = getSchema().getElement(); - - return element; - } - - public void setElement(Element newElement) - { - if (newElement == null && !isReconciling) - { - element = null; - } - else - { - setElementGen(newElement); - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public QName getElementType() - { - if (elementType == null) - elementType = new QName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001,XSDConstants.SCHEMA_ELEMENT_TAG); - - return elementType; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated NOT - */ - public void setElementType(QName newElementType) - { - // Should not do anything. - } - - public void reconcileAttributes(Element changedElement) - { - super.reconcileAttributes(changedElement); - } - - public Element createElement() - { - if (schema == null) // kb Note: This case is not supposed to happen. - { - // cs ... why do we do this if its not supposed to happen? - // Is there a scenario where this is a usefull fallback? - // Under what conditions does this code get executed (i.e. why would schema == null)? - schema = XSDFactory.eINSTANCE.createXSDSchema(); - schema.setSchemaForSchemaQNamePrefix("xsd"); - schema.setTargetNamespace("http://tempuri.org/"); - java.util.Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap(); - qNamePrefixToNamespaceMap.put("", schema.getTargetNamespace()); - qNamePrefixToNamespaceMap.put - (schema.getSchemaForSchemaQNamePrefix(),org.eclipse.xsd.util.XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); - adopt(schema); - schema.updateElement(true); - return schema.getElement(); - } - else - { - element = schema.getElement(); - if (element == null) - { - adopt(schema); - schema.updateElement(true); - element = schema.getElement(); - } - return element; - } - } - - private void adopt(XSDSchema xsdSchema) - { - Definition definition = getEnclosingDefinition(); - if (definition == null) - return; - - Document document = definition.getDocument(); - if (document == null) - document = ((DefinitionImpl) definition).updateDocument(); - - if (xsdSchema.getDocument() != null) - xsdSchema.setDocument(null); - - xsdSchema.setDocument(document); - } - - /* - private Element adopt(Element element) - { - Definition definition = getEnclosingDefinition(); - if (definition == null) - return element; - - Document document = definition.getDocument(); - if (document == null) - document = ((DefinitionImpl) definition).updateDocument(); - - return (Element)document.importNode(element,true); - } - */ - - protected void changeAttribute(EAttribute eAttribute) - { - if (isReconciling) - return; - - // TODO... revist this block of code - // - if (eAttribute == null || eAttribute == WSDLPackage.eINSTANCE.getXSDSchemaExtensibilityElement_Schema()) - { - // We got a new schema so re-parent it. - // cs... are we really doing the right thing here? this seems strange - if (schema != null) - { - if ((schema.getElement() == null && getElement() == null) || - (schema.getElement() != getElement())) - { - schema.setDocument(null); - schema.setElement(null); - adopt(schema); - schema.updateElement(); - } - } - } - else if (eAttribute == WSDLPackage.eINSTANCE.getWSDLElement_Element()) - { - setSchema(createSchema(element)); // element is not null - } - } -} //XSDSchemaExtensibilityElementImpl 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); - } - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/Reconcilable.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/Reconcilable.java deleted file mode 100644 index b9d2a9067..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/Reconcilable.java +++ /dev/null @@ -1,23 +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.util; - -import org.w3c.dom.Element; - -// TODO... why do we need this? -// -public interface Reconcilable -{ - public void setElement(Element element); - public Element getElement(); - public void reconcileAttributes(Element changedElement); - public void reconcileReferences(boolean deep); -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLAdapterFactory.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLAdapterFactory.java deleted file mode 100644 index e7c620a89..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLAdapterFactory.java +++ /dev/null @@ -1,1039 +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.util; - -import java.net.URL; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.wsdl.extensions.ExtensionRegistry; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.ExtensibleElement; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.MessageReference; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.Types; -import org.eclipse.wst.wsdl.UnknownExtensibilityElement; -import org.eclipse.wst.wsdl.WSDLElement; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; - - -/** - * <!-- begin-user-doc --> - * The <b>Adapter Factory</b> for the model. - * It provides an adapter <code>createXXX</code> method for each class of the model. - * <!-- end-user-doc --> - * @see org.eclipse.wsdl.WSDLPackage - * @generated - */ -public class WSDLAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected static WSDLPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLAdapterFactory() - { - if (modelPackage == null) - { - modelPackage = WSDLPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * <!-- begin-user-doc --> - * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. - * <!-- end-user-doc --> - * @return whether this factory is applicable for the type of the object. - * @generated - */ - public boolean isFactoryForType(Object object) - { - if (object == modelPackage) - { - return true; - } - if (object instanceof EObject) - { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the <code>createXXX</code> methods. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected WSDLSwitch modelSwitch = - new WSDLSwitch() - { - public Object caseWSDLElement(WSDLElement object) - { - return createWSDLElementAdapter(); - } - public Object casePortType(PortType object) - { - return createPortTypeAdapter(); - } - public Object caseOperation(Operation object) - { - return createOperationAdapter(); - } - public Object caseMessage(Message object) - { - return createMessageAdapter(); - } - public Object casePart(Part object) - { - return createPartAdapter(); - } - public Object caseBinding(Binding object) - { - return createBindingAdapter(); - } - public Object caseBindingOperation(BindingOperation object) - { - return createBindingOperationAdapter(); - } - public Object caseService(Service object) - { - return createServiceAdapter(); - } - public Object casePort(Port object) - { - return createPortAdapter(); - } - public Object caseExtensibilityElement(ExtensibilityElement object) - { - return createExtensibilityElementAdapter(); - } - public Object caseDefinition(Definition object) - { - return createDefinitionAdapter(); - } - public Object caseImport(Import object) - { - return createImportAdapter(); - } - public Object caseExtensibleElement(ExtensibleElement object) - { - return createExtensibleElementAdapter(); - } - public Object caseInput(Input object) - { - return createInputAdapter(); - } - public Object caseOutput(Output object) - { - return createOutputAdapter(); - } - public Object caseFault(Fault object) - { - return createFaultAdapter(); - } - public Object caseBindingInput(BindingInput object) - { - return createBindingInputAdapter(); - } - public Object caseBindingOutput(BindingOutput object) - { - return createBindingOutputAdapter(); - } - public Object caseBindingFault(BindingFault object) - { - return createBindingFaultAdapter(); - } - public Object caseNamespace(Namespace object) - { - return createNamespaceAdapter(); - } - public Object caseIPortType(javax.wsdl.PortType object) - { - return createIPortTypeAdapter(); - } - public Object caseIOperation(javax.wsdl.Operation object) - { - return createIOperationAdapter(); - } - public Object caseIInput(javax.wsdl.Input object) - { - return createIInputAdapter(); - } - public Object caseIOutput(javax.wsdl.Output object) - { - return createIOutputAdapter(); - } - public Object caseIFault(javax.wsdl.Fault object) - { - return createIFaultAdapter(); - } - public Object caseIMessage(javax.wsdl.Message object) - { - return createIMessageAdapter(); - } - public Object caseIPart(javax.wsdl.Part object) - { - return createIPartAdapter(); - } - public Object caseIService(javax.wsdl.Service object) - { - return createIServiceAdapter(); - } - public Object caseIPort(javax.wsdl.Port object) - { - return createIPortAdapter(); - } - public Object caseIBinding(javax.wsdl.Binding object) - { - return createIBindingAdapter(); - } - public Object caseIBindingOperation(javax.wsdl.BindingOperation object) - { - return createIBindingOperationAdapter(); - } - public Object caseIBindingInput(javax.wsdl.BindingInput object) - { - return createIBindingInputAdapter(); - } - public Object caseIBindingOutput(javax.wsdl.BindingOutput object) - { - return createIBindingOutputAdapter(); - } - public Object caseIBindingFault(javax.wsdl.BindingFault object) - { - return createIBindingFaultAdapter(); - } - public Object caseIExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement object) - { - return createIExtensibilityElementAdapter(); - } - public Object caseIDefinition(javax.wsdl.Definition object) - { - return createIDefinitionAdapter(); - } - public Object caseIImport(javax.wsdl.Import object) - { - return createIImportAdapter(); - } - public Object caseIList(List object) - { - return createIListAdapter(); - } - public Object caseIMap(Map object) - { - return createIMapAdapter(); - } - public Object caseIURL(URL object) - { - return createIURLAdapter(); - } - public Object caseIExtensionRegistry(ExtensionRegistry object) - { - return createIExtensionRegistryAdapter(); - } - public Object caseTypes(Types object) - { - return createTypesAdapter(); - } - public Object caseIIterator(Iterator object) - { - return createIIteratorAdapter(); - } - public Object caseITypes(javax.wsdl.Types object) - { - return createITypesAdapter(); - } - public Object caseUnknownExtensibilityElement(UnknownExtensibilityElement object) - { - return createUnknownExtensibilityElementAdapter(); - } - public Object caseXSDSchemaExtensibilityElement(XSDSchemaExtensibilityElement object) - { - return createXSDSchemaExtensibilityElementAdapter(); - } - public Object caseMessageReference(MessageReference object) - { - return createMessageReferenceAdapter(); - } - public Object defaultCase(EObject object) - { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the <code>target</code>. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param target the object to adapt. - * @return the adapter for the <code>target</code>. - * @generated - */ - public Adapter createAdapter(Notifier target) - { - return (Adapter)modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.WSDLElement <em>Element</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.WSDLElement - * @generated - */ - public Adapter createWSDLElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.PortType <em>Port Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.PortType - * @generated - */ - public Adapter createPortTypeAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Operation <em>Operation</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Operation - * @generated - */ - public Adapter createOperationAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Message <em>Message</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Message - * @generated - */ - public Adapter createMessageAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Part <em>Part</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Part - * @generated - */ - public Adapter createPartAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Binding <em>Binding</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Binding - * @generated - */ - public Adapter createBindingAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.BindingOperation <em>Binding Operation</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.BindingOperation - * @generated - */ - public Adapter createBindingOperationAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Service <em>Service</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Service - * @generated - */ - public Adapter createServiceAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Port <em>Port</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Port - * @generated - */ - public Adapter createPortAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.ExtensibilityElement <em>Extensibility Element</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.ExtensibilityElement - * @generated - */ - public Adapter createExtensibilityElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Definition <em>Definition</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Definition - * @generated - */ - public Adapter createDefinitionAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Import <em>Import</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Import - * @generated - */ - public Adapter createImportAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.ExtensibleElement <em>Extensible Element</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.ExtensibleElement - * @generated - */ - public Adapter createExtensibleElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Input <em>Input</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Input - * @generated - */ - public Adapter createInputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Output <em>Output</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Output - * @generated - */ - public Adapter createOutputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Fault <em>Fault</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Fault - * @generated - */ - public Adapter createFaultAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.BindingInput <em>Binding Input</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.BindingInput - * @generated - */ - public Adapter createBindingInputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.BindingOutput <em>Binding Output</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.BindingOutput - * @generated - */ - public Adapter createBindingOutputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.BindingFault <em>Binding Fault</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.BindingFault - * @generated - */ - public Adapter createBindingFaultAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Namespace <em>Namespace</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Namespace - * @generated - */ - public Adapter createNamespaceAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.PortType <em>IPort Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.PortType - * @generated - */ - public Adapter createIPortTypeAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Operation <em>IOperation</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Operation - * @generated - */ - public Adapter createIOperationAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Input <em>IInput</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Input - * @generated - */ - public Adapter createIInputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Output <em>IOutput</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Output - * @generated - */ - public Adapter createIOutputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Fault <em>IFault</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Fault - * @generated - */ - public Adapter createIFaultAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Message <em>IMessage</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Message - * @generated - */ - public Adapter createIMessageAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Part <em>IPart</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Part - * @generated - */ - public Adapter createIPartAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Service <em>IService</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Service - * @generated - */ - public Adapter createIServiceAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Port <em>IPort</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Port - * @generated - */ - public Adapter createIPortAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Binding <em>IBinding</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Binding - * @generated - */ - public Adapter createIBindingAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.BindingOperation <em>IBinding Operation</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.BindingOperation - * @generated - */ - public Adapter createIBindingOperationAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.BindingInput <em>IBinding Input</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.BindingInput - * @generated - */ - public Adapter createIBindingInputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.BindingOutput <em>IBinding Output</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.BindingOutput - * @generated - */ - public Adapter createIBindingOutputAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.BindingFault <em>IBinding Fault</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.BindingFault - * @generated - */ - public Adapter createIBindingFaultAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.extensions.ExtensibilityElement <em>IExtensibility Element</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.extensions.ExtensibilityElement - * @generated - */ - public Adapter createIExtensibilityElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Definition <em>IDefinition</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Definition - * @generated - */ - public Adapter createIDefinitionAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Import <em>IImport</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Import - * @generated - */ - public Adapter createIImportAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link java.util.List <em>IList</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see java.util.List - * @generated - */ - public Adapter createIListAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link java.util.Map <em>IMap</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see java.util.Map - * @generated - */ - public Adapter createIMapAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link java.net.URL <em>IURL</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see java.net.URL - * @generated - */ - public Adapter createIURLAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.extensions.ExtensionRegistry <em>IExtension Registry</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.extensions.ExtensionRegistry - * @generated - */ - public Adapter createIExtensionRegistryAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.Types <em>Types</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.Types - * @generated - */ - public Adapter createTypesAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link java.util.Iterator <em>IIterator</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see java.util.Iterator - * @generated - */ - public Adapter createIIteratorAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link javax.wsdl.Types <em>ITypes</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see javax.wsdl.Types - * @generated - */ - public Adapter createITypesAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.UnknownExtensibilityElement <em>Unknown Extensibility Element</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.UnknownExtensibilityElement - * @generated - */ - public Adapter createUnknownExtensibilityElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.XSDSchemaExtensibilityElement <em>XSD Schema Extensibility Element</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement - * @generated - */ - public Adapter createXSDSchemaExtensibilityElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.wsdl.MessageReference <em>Message Reference</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.wst.wsdl.MessageReference - * @generated - */ - public Adapter createMessageReferenceAdapter() - { - return null; - } - - /** - * Creates a new adapter for the default case. - * <!-- begin-user-doc --> - * This default implementation returns null. - * <!-- end-user-doc --> - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() - { - return null; - } - -} //WSDLAdapterFactory diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLDefinitionFactory.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLDefinitionFactory.java deleted file mode 100644 index 09ef53220..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLDefinitionFactory.java +++ /dev/null @@ -1,61 +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.util; - -import javax.wsdl.WSDLException; -import javax.wsdl.xml.WSDLReader; - -import org.eclipse.wst.wsdl.internal.impl.WSDLFactoryImpl; -import org.eclipse.wst.wsdl.internal.impl.WSDLPackageImpl; - -import com.ibm.wsdl.xml.WSDLReaderImpl; - -public class WSDLDefinitionFactory extends com.ibm.wsdl.factory.WSDLFactoryImpl -{ - - private static WSDLDefinitionFactory instance = null; - - public WSDLDefinitionFactory() - { - // Make sure the WSDL package is initialized. - WSDLPackageImpl.init(); - } - - /** - * Create a new instance of Definition. - */ - public javax.wsdl.Definition newDefinition() - { - javax.wsdl.Definition definition = WSDLFactoryImpl.eINSTANCE.createDefinition(); - return definition; - } - - /** - * Returns a singleton instance of this factory - */ - public static javax.wsdl.factory.WSDLFactory getInstance() throws WSDLException - { - if (instance == null) - instance = new WSDLDefinitionFactory(); - return instance; - } - - /** - * Creates a WSDLReader. - */ - public WSDLReader newWSDLReader() - { - WSDLReader reader = new WSDLReaderImpl(); - reader.setFactoryImplName(getClass().getName()); - return reader; - } - -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLModelLocator.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLModelLocator.java deleted file mode 100644 index c19b0c472..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLModelLocator.java +++ /dev/null @@ -1,56 +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.util; - -/** - * An adapter interface used by {@link org.eclipse.wst.wsdl.ImportImpl to find referenced resources. - * When the resource referenced by a wsdl import needs to be determined, - * the containing {@link org.eclipse.emf.ecore.resource.Resource} - * will be {@link org.eclipse.emf.ecore.util.EcoreUtil#getRegisteredAdapter(org.eclipse.emf.ecore.resource.Resource,Object) inspected} - * for an adapter that implements this interface. - * As such, you can register an adapter factory like this to tailor the algorithm used to locate the resource : - *<pre> - * ResourceSet resourceSet = new ResourceSetImpl(); - * resourceSet.getAdapterFactories().add - * (new AdapterFactoryImpl() - * { - * class CustomURIResolver extends AdapterImpl implements WSDLModelLocator - * { - * public String resolveURI(String baseLocation, String namespace, String location); - * { - * return null; // Additional logic... - * } - * - * public boolean isAdatperForType(Object type) - * { - * return type == WSDLModelLocator.class; - * } - * } - * - * protected CustomURIResolver customURIResolver = new CustomURIResolver(); - * - * public boolean isFactoryForType(Object type) - * { - * return type == WSDLModelLocator.class; - * } - * - * public Adapter adaptNew(Notifier target, Object type) - * { - * return customURIResolver; - * } - * }); - *</pre> - * @see org.eclipse.emf.ecore.util.EcoreUtil#getRegisteredAdapter(org.eclipse.emf.ecore.resource.Resource,Object) - */ -public interface WSDLModelLocator -{ - public String resolveURI(String baseLocation, String namespace, String location); -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLResourceFactoryImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLResourceFactoryImpl.java deleted file mode 100644 index c3986a6ca..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLResourceFactoryImpl.java +++ /dev/null @@ -1,49 +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.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; -import org.eclipse.wst.wsdl.util.WSDLResourceImpl; - -/** - * <!-- begin-user-doc --> - * The <b>Resource Factory</b> associated with the package. - * <!-- end-user-doc --> - * @see org.eclipse.wst.wsdl.util.WSDLResourceImpl - * @generated - */ -public class WSDLResourceFactoryImpl extends ResourceFactoryImpl -{ - /** - * Creates an instance of the resource factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLResourceFactoryImpl() - { - super(); - } - - /** - * Creates an instance of the resource. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Resource createResource(URI uri) - { - Resource result = new WSDLResourceImpl(uri); - return result; - } -} //WSDLResourceFactoryImpl diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLSwitch.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLSwitch.java deleted file mode 100644 index f860668a4..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLSwitch.java +++ /dev/null @@ -1,1074 +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.util; - -import java.net.URL; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.wsdl.extensions.ExtensionRegistry; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.wst.wsdl.Binding; -import org.eclipse.wst.wsdl.BindingFault; -import org.eclipse.wst.wsdl.BindingInput; -import org.eclipse.wst.wsdl.BindingOperation; -import org.eclipse.wst.wsdl.BindingOutput; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.ExtensibleElement; -import org.eclipse.wst.wsdl.Fault; -import org.eclipse.wst.wsdl.Import; -import org.eclipse.wst.wsdl.Input; -import org.eclipse.wst.wsdl.Message; -import org.eclipse.wst.wsdl.MessageReference; -import org.eclipse.wst.wsdl.Namespace; -import org.eclipse.wst.wsdl.Operation; -import org.eclipse.wst.wsdl.Output; -import org.eclipse.wst.wsdl.Part; -import org.eclipse.wst.wsdl.Port; -import org.eclipse.wst.wsdl.PortType; -import org.eclipse.wst.wsdl.Service; -import org.eclipse.wst.wsdl.Types; -import org.eclipse.wst.wsdl.UnknownExtensibilityElement; -import org.eclipse.wst.wsdl.WSDLElement; -import org.eclipse.wst.wsdl.WSDLPackage; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; - - -/** - * <!-- begin-user-doc --> - * The <b>Switch</b> for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch doSwitch(object)} - * to invoke the <code>caseXXX</code> method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * <!-- end-user-doc --> - * @see org.eclipse.wsdl.WSDLPackage - * @generated - */ -public class WSDLSwitch { - /** - * The cached model package - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected static WSDLPackage modelPackage; - - /** - * Creates an instance of the switch. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public WSDLSwitch() - { - if (modelPackage == null) - { - modelPackage = WSDLPackage.eINSTANCE; - } - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - public Object doSwitch(EObject theEObject) - { - EClass theEClass = theEObject.eClass(); - if (theEClass.eContainer() == modelPackage) - { - switch (theEClass.getClassifierID()) - { - case WSDLPackage.PORT_TYPE: - { - PortType portType = (PortType)theEObject; - Object result = casePortType(portType); - if (result == null) result = caseWSDLElement(portType); - if (result == null) result = caseIPortType(portType); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.OPERATION: - { - Operation operation = (Operation)theEObject; - Object result = caseOperation(operation); - if (result == null) result = caseWSDLElement(operation); - if (result == null) result = caseIOperation(operation); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.MESSAGE: - { - Message message = (Message)theEObject; - Object result = caseMessage(message); - if (result == null) result = caseWSDLElement(message); - if (result == null) result = caseIMessage(message); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.PART: - { - Part part = (Part)theEObject; - Object result = casePart(part); - if (result == null) result = caseWSDLElement(part); - if (result == null) result = caseIPart(part); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.BINDING: - { - Binding binding = (Binding)theEObject; - Object result = caseBinding(binding); - if (result == null) result = caseExtensibleElement(binding); - if (result == null) result = caseIBinding(binding); - if (result == null) result = caseWSDLElement(binding); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.BINDING_OPERATION: - { - BindingOperation bindingOperation = (BindingOperation)theEObject; - Object result = caseBindingOperation(bindingOperation); - if (result == null) result = caseExtensibleElement(bindingOperation); - if (result == null) result = caseIBindingOperation(bindingOperation); - if (result == null) result = caseWSDLElement(bindingOperation); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.SERVICE: - { - Service service = (Service)theEObject; - Object result = caseService(service); - if (result == null) result = caseExtensibleElement(service); - if (result == null) result = caseIService(service); - if (result == null) result = caseWSDLElement(service); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.PORT: - { - Port port = (Port)theEObject; - Object result = casePort(port); - if (result == null) result = caseExtensibleElement(port); - if (result == null) result = caseIPort(port); - if (result == null) result = caseWSDLElement(port); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.EXTENSIBILITY_ELEMENT: - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement)theEObject; - Object result = caseExtensibilityElement(extensibilityElement); - if (result == null) result = caseWSDLElement(extensibilityElement); - if (result == null) result = caseIExtensibilityElement(extensibilityElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.DEFINITION: - { - Definition definition = (Definition)theEObject; - Object result = caseDefinition(definition); - if (result == null) result = caseExtensibleElement(definition); - if (result == null) result = caseIDefinition(definition); - if (result == null) result = caseWSDLElement(definition); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.IMPORT: - { - Import import_ = (Import)theEObject; - Object result = caseImport(import_); - if (result == null) result = caseWSDLElement(import_); - if (result == null) result = caseIImport(import_); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.INPUT: - { - Input input = (Input)theEObject; - Object result = caseInput(input); - if (result == null) result = caseMessageReference(input); - if (result == null) result = caseWSDLElement(input); - if (result == null) result = caseIInput(input); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.OUTPUT: - { - Output output = (Output)theEObject; - Object result = caseOutput(output); - if (result == null) result = caseMessageReference(output); - if (result == null) result = caseWSDLElement(output); - if (result == null) result = caseIOutput(output); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.FAULT: - { - Fault fault = (Fault)theEObject; - Object result = caseFault(fault); - if (result == null) result = caseMessageReference(fault); - if (result == null) result = caseWSDLElement(fault); - if (result == null) result = caseIFault(fault); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.BINDING_INPUT: - { - BindingInput bindingInput = (BindingInput)theEObject; - Object result = caseBindingInput(bindingInput); - if (result == null) result = caseExtensibleElement(bindingInput); - if (result == null) result = caseIBindingInput(bindingInput); - if (result == null) result = caseWSDLElement(bindingInput); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.BINDING_OUTPUT: - { - BindingOutput bindingOutput = (BindingOutput)theEObject; - Object result = caseBindingOutput(bindingOutput); - if (result == null) result = caseExtensibleElement(bindingOutput); - if (result == null) result = caseIBindingOutput(bindingOutput); - if (result == null) result = caseWSDLElement(bindingOutput); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.BINDING_FAULT: - { - BindingFault bindingFault = (BindingFault)theEObject; - Object result = caseBindingFault(bindingFault); - if (result == null) result = caseExtensibleElement(bindingFault); - if (result == null) result = caseIBindingFault(bindingFault); - if (result == null) result = caseWSDLElement(bindingFault); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.NAMESPACE: - { - Namespace namespace = (Namespace)theEObject; - Object result = caseNamespace(namespace); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.TYPES: - { - Types types = (Types)theEObject; - Object result = caseTypes(types); - if (result == null) result = caseExtensibleElement(types); - if (result == null) result = caseITypes(types); - if (result == null) result = caseWSDLElement(types); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.UNKNOWN_EXTENSIBILITY_ELEMENT: - { - UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement)theEObject; - Object result = caseUnknownExtensibilityElement(unknownExtensibilityElement); - if (result == null) result = caseExtensibilityElement(unknownExtensibilityElement); - if (result == null) result = caseWSDLElement(unknownExtensibilityElement); - if (result == null) result = caseIExtensibilityElement(unknownExtensibilityElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - case WSDLPackage.XSD_SCHEMA_EXTENSIBILITY_ELEMENT: - { - XSDSchemaExtensibilityElement xsdSchemaExtensibilityElement = (XSDSchemaExtensibilityElement)theEObject; - Object result = caseXSDSchemaExtensibilityElement(xsdSchemaExtensibilityElement); - if (result == null) result = caseExtensibilityElement(xsdSchemaExtensibilityElement); - if (result == null) result = caseWSDLElement(xsdSchemaExtensibilityElement); - if (result == null) result = caseIExtensibilityElement(xsdSchemaExtensibilityElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - return defaultCase(theEObject); - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Element</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Element</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseWSDLElement(WSDLElement object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Port Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Port Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object casePortType(PortType object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Operation</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Operation</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseOperation(Operation object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Message</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Message</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseMessage(Message object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Part</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Part</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object casePart(Part object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Binding</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Binding</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseBinding(Binding object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Binding Operation</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Binding Operation</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseBindingOperation(BindingOperation object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Service</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Service</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseService(Service object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Port</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Port</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object casePort(Port object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Extensibility Element</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Extensibility Element</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseExtensibilityElement(ExtensibilityElement object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Definition</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Definition</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseDefinition(Definition object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Import</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Import</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseImport(Import object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Extensible Element</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Extensible Element</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseExtensibleElement(ExtensibleElement object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Input</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Input</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseInput(Input object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Output</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Output</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseOutput(Output object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Fault</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Fault</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseFault(Fault object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Binding Input</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Binding Input</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseBindingInput(BindingInput object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Binding Output</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Binding Output</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseBindingOutput(BindingOutput object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Binding Fault</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Binding Fault</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseBindingFault(BindingFault object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Namespace</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Namespace</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseNamespace(Namespace object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IPort Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IPort Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIPortType(javax.wsdl.PortType object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IOperation</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IOperation</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIOperation(javax.wsdl.Operation object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IInput</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IInput</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIInput(javax.wsdl.Input object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IOutput</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IOutput</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIOutput(javax.wsdl.Output object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IFault</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IFault</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIFault(javax.wsdl.Fault object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IMessage</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IMessage</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIMessage(javax.wsdl.Message object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IPart</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IPart</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIPart(javax.wsdl.Part object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IService</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IService</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIService(javax.wsdl.Service object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IPort</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IPort</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIPort(javax.wsdl.Port object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IBinding</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IBinding</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIBinding(javax.wsdl.Binding object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IBinding Operation</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IBinding Operation</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIBindingOperation(javax.wsdl.BindingOperation object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IBinding Input</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IBinding Input</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIBindingInput(javax.wsdl.BindingInput object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IBinding Output</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IBinding Output</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIBindingOutput(javax.wsdl.BindingOutput object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IBinding Fault</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IBinding Fault</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIBindingFault(javax.wsdl.BindingFault object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IExtensibility Element</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IExtensibility Element</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IDefinition</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IDefinition</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIDefinition(javax.wsdl.Definition object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IImport</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IImport</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIImport(javax.wsdl.Import object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IList</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IList</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIList(List object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IMap</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IMap</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIMap(Map object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IURL</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IURL</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIURL(URL object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IExtension Registry</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IExtension Registry</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIExtensionRegistry(ExtensionRegistry object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Types</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Types</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseTypes(Types object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>IIterator</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IIterator</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseIIterator(Iterator object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>ITypes</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>ITypes</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseITypes(javax.wsdl.Types object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Unknown Extensibility Element</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Unknown Extensibility Element</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseUnknownExtensibilityElement(UnknownExtensibilityElement object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>XSD Schema Extensibility Element</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>XSD Schema Extensibility Element</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseXSDSchemaExtensibilityElement(XSDSchemaExtensibilityElement object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>Message Reference</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Message Reference</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public Object caseMessageReference(MessageReference object) - { - return null; - } - - /** - * Returns the result of interpretting the object as an instance of '<em>EObject</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>EObject</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public Object defaultCase(EObject object) - { - return null; - } - -} //WSDLSwitch diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLUtil.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLUtil.java deleted file mode 100644 index da79b0421..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/WSDLUtil.java +++ /dev/null @@ -1,155 +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.util; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.ExtensibilityElement; -import org.eclipse.wst.wsdl.ExtensibleElement; -import org.eclipse.wst.wsdl.util.WSDLConstants; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - - -public class WSDLUtil extends WSDLConstants -{ - protected static WSDLUtil instance; - // protected NodeAssociationManager nodeAssociationManager = new NodeAssociationManager(); - - protected HashMap elementNameToTypeMap = new HashMap(); - - public static WSDLUtil getInstance() - { - if (instance == null) - { - instance = new WSDLUtil(); - } - return instance; - } - - public WSDLUtil() - { - elementNameToTypeMap.put(BINDING_ELEMENT_TAG, new Integer(BINDING)); - elementNameToTypeMap.put(DEFINITION_ELEMENT_TAG, new Integer(DEFINITION)); - elementNameToTypeMap.put(DOCUMENTATION_ELEMENT_TAG, new Integer(DOCUMENTATION)); - elementNameToTypeMap.put(FAULT_ELEMENT_TAG, new Integer(FAULT)); - elementNameToTypeMap.put(IMPORT_ELEMENT_TAG, new Integer(IMPORT)); - elementNameToTypeMap.put(INPUT_ELEMENT_TAG, new Integer(INPUT)); - elementNameToTypeMap.put(MESSAGE_ELEMENT_TAG, new Integer(MESSAGE)); - elementNameToTypeMap.put(OPERATION_ELEMENT_TAG, new Integer(OPERATION)); - elementNameToTypeMap.put(OUTPUT_ELEMENT_TAG, new Integer(OUTPUT)); - elementNameToTypeMap.put(PART_ELEMENT_TAG, new Integer(PART)); - elementNameToTypeMap.put(PORT_ELEMENT_TAG, new Integer(PORT)); - elementNameToTypeMap.put(PORT_TYPE_ELEMENT_TAG, new Integer(PORT_TYPE)); - elementNameToTypeMap.put(SERVICE_ELEMENT_TAG, new Integer(SERVICE)); - elementNameToTypeMap.put(TYPES_ELEMENT_TAG, new Integer(TYPES)); - } - - public int getWSDLType(Element element) - { - int result = -1; - - Integer integer = (Integer) elementNameToTypeMap.get(element.getLocalName()); - if (integer != null) - { - result = integer.intValue(); - } - return result; - } - - protected List getParentElementChain(Element element) - { - List list = new ArrayList(); - while (element != null) - { - list.add(0, element); - Node node = element.getParentNode(); - element = (node != null && node.getNodeType() == Node.ELEMENT_NODE) ? (Element) node : null; - } - return list; - } - - /* - public Object findModelObjectForElement(Definition definition, Element targetElement) - { - Object o = nodeAssociationManager.getModelObjectForNode(definition, targetElement); - return o; - } - - - public Element getElementForObject(Object o) - { - Node node = nodeAssociationManager.getNode(o); - return (node != null && node.getNodeType() == Node.ELEMENT_NODE) ? (Element)node : null; - } - - public Node getNodeForObject(Object o) - { - return nodeAssociationManager.getNode(o); - } - - public ITypeSystemProvider getTypeSystemProvider(Definition definition) - { - return WSDLToDOMElementUtil.getTypeSystemProvider(definition); - } - - - public void setTypeSystemProvider(Definition definition, ITypeSystemProvider typeSystemProvider) - { - WSDLToDOMElementUtil.setTypeSystemProvider(definition, typeSystemProvider); - } - */ - - public static QName createQName(Definition definition, String prefixedName) - { - QName qname = null; - if (prefixedName != null) - { - int index = prefixedName.indexOf(":"); - String prefix = (index == -1) ? null : prefixedName.substring(0, index); - if (prefix != null) - { - String namespace = definition.getNamespace(prefix); - if (namespace != null) - { - String localPart = prefixedName.substring(index + 1); - qname = new QName(namespace, localPart); - } - } - } - return qname; - } - - public List getExtensibilityElementNodes(ExtensibleElement extensibleElement) - { - List childList = new ArrayList(); - for (Iterator i = extensibleElement.getEExtensibilityElements().iterator(); i.hasNext();) - { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) i.next(); - if (extensibilityElement != null) - { - Element element = extensibilityElement.getElement(); - if (element != null) - { - childList.add(element); - } - } - } - return childList; - //return extensibleElement.getEExtensibilityElements(); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/XSDSchemaLocatorAdapterFactory.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/XSDSchemaLocatorAdapterFactory.java deleted file mode 100644 index 8e4ee818b..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/XSDSchemaLocatorAdapterFactory.java +++ /dev/null @@ -1,31 +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.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.xsd.util.XSDSchemaLocator; - -public class XSDSchemaLocatorAdapterFactory extends AdapterFactoryImpl -{ - protected XSDSchemaLocatorImpl schemaLocator = new XSDSchemaLocatorImpl(); - - public boolean isFactoryForType(Object type) - { - return type == XSDSchemaLocator.class; - } - - public Adapter adaptNew(Notifier target, Object type) - { - return schemaLocator; - } -} diff --git a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/XSDSchemaLocatorImpl.java b/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/XSDSchemaLocatorImpl.java deleted file mode 100644 index 155b44bc9..000000000 --- a/bundles/org.eclipse.wst.wsdl/src-wsdl/org/eclipse/wst/wsdl/internal/util/XSDSchemaLocatorImpl.java +++ /dev/null @@ -1,73 +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.util; - -import java.util.Iterator; - -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.wst.wsdl.Definition; -import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDSchemaLocator; - -public class XSDSchemaLocatorImpl extends AdapterImpl implements XSDSchemaLocator -{ - /** - * @see org.eclipse.xsd.util.XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema, - * java.lang.String, java.lang.String, java.lang.String) - */ - public XSDSchema locateSchema(XSDSchema xsdSchema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI) - { - XSDSchema resolvedSchema = null; - - // Bugzilla 122624: WSDL model does not resolve <import> of inline schema with no namespace. - // KB: We are not resolving <import>ed or <include>d schemas from the root inline schemas. - // In other words, since we are resolving only between multiple root inline schemas, - // do not attempt to resolve if "rawSchemaLocationURI" is not null. - if (namespaceURI != null && rawSchemaLocationURI == null) - { - Definition definition = null; - - for (EObject parent = xsdSchema.eContainer(); parent != null; parent = parent.eContainer()) - { - if (parent instanceof Definition) - { - definition = (Definition) parent; - break; - } - } - - if (definition != null && definition.getETypes() != null) - { - for (Iterator i = definition.getETypes().getEExtensibilityElements().iterator(); i.hasNext();) - { - Object o = i.next(); - if (o instanceof XSDSchemaExtensibilityElement) - { - XSDSchema schema = ((XSDSchemaExtensibilityElement) o).getSchema(); - if (schema != null && namespaceURI.equals(schema.getTargetNamespace())) - { - resolvedSchema = schema; - break; - } - } - } - } - } - return resolvedSchema; - } - - public boolean isAdatperForType(Object type) - { - return type == XSDSchemaLocator.class; - } -} |