Package org.eclipse.wst.wsdl

Examples of org.eclipse.wst.wsdl.Definition


          handleElementForAdopt(eReference, wsdlElement);
          ((WSDLElementImpl)wsdlElement).updateElement();
        }
      }

      Definition definition = getEnclosingDefinition();
      if (definition != null)
      {
        ((WSDLElementImpl)wsdlElement).adoptBy(definition);
      }
    }
View Full Code Here


    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)
View Full Code Here

    String namespaceURI = null;

    // First try to locate the namespace URI in the definition's prefix to namespace map.
    // This will provide backward compatibility for existing clients.

    Definition enclosingDefinition = getEnclosingDefinition();
    if (enclosingDefinition != null)
    {
      namespaceURI = enclosingDefinition.getNamespace(nsPrefix);
    }

    // We did not find it at the top level, try to find a locally defined namespace prefix.

    if (namespaceURI == null)
View Full Code Here

  public void reconcileReferences(boolean deep)
  {
    if (element != null)
    {
      Definition definition = getEnclosingDefinition();
      QName messageQName = createQName(definition, element.getAttribute(WSDLConstants.MESSAGE_ATTRIBUTE), element);
      Message newMessage = messageQName != null ? (Message)definition.getMessage(messageQName) : null;
      if (newMessage != getEMessage())
      {
        setEMessage(newMessage);
      }
    }
View Full Code Here

  // Reconcile methods
  //

  public void reconcileAttributes(Element changedElement)
  {
    Definition definition = getEnclosingDefinition();
    String name = changedElement.getAttribute(WSDLConstants.NAME_ATTRIBUTE);
    QName qname = new QName(definition.getTargetNamespace(), name == null ? "" : name); //$NON-NLS-1$
    setQName(qname);
    reconcileReferences(false);
  }
View Full Code Here

  public void reconcileReferences(boolean deep)
  {
    if (element != null)
    {
      Definition definition = (Definition)getEnclosingDefinition();
      QName portTypeQName = createQName(definition, element.getAttribute(WSDLConstants.TYPE_ATTRIBUTE), element);
      PortType newPortType = portTypeQName != null ? (PortType)definition.getPortType(portTypeQName) : null;
      if (newPortType != getEPortType())
      {
        setEPortType(newPortType);
      }
    }
View Full Code Here

    }
  }

  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;
View Full Code Here

    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;
  }
View Full Code Here

  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);
View Full Code Here

  }

  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;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsdl.Definition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.