Package com.google.gwt.xml.client

Examples of com.google.gwt.xml.client.Element


    }   
  }
 
  private void createApplicationElement(ApplicationNode application) {
    // applicationChildren = {resourcesNode, grammarsNode, resourceTypeNode, methodNode, representationNode, faultNode, docNode}
    Element applicationElement = wadl.createElement(applicationNode);
    applicationElement.setAttribute(application_xmlns_xsi, xmlns_xsi);
    applicationElement.setAttribute(application_xmlns_xsd, xmlns_xsd);
    applicationElement.setAttribute(application_xsi_schemaLocation, xsi_schemaLocation);
    applicationElement.setAttribute(application_xmlns, xmlns);   
 
    // external additional namespaces
    Vector allNamespaces = application.getAllNamespaces();
    Iterator namespaceIterator = allNamespaces.iterator();
    int namespaceCounter = 0;
    // add additional application-specific namespaces
    while (namespaceIterator.hasNext()) {
      NamespaceAttribute namespace = (NamespaceAttribute) namespaceIterator.next();
      if (namespace.getName() == null) {
        applicationElement.setAttribute(application_xmlns_extNs + namespaceCounter, namespace.getValue());
      }
      else {
        applicationElement.setAttribute(namespace.getName(), namespace.getValue());
      }
      namespaceCounter++;
   
   
    // <grammars>
View Full Code Here


   * @param resourceType
   * @param applicationElement
   */
  private void createResourceTypeElement(ResourceTypeNode resourceType, Element applicationElement) {
    //resource_typeChildren = {paramNode, methodNode, docNode};
    Element resourceTypeElement = wadl.createElement(resourceTypeNode);
   
    // <param>
    Vector allResourceParams = resourceType.getAllParams();
    Iterator resourceParamIterator = allResourceParams.iterator();
    while (resourceParamIterator.hasNext()) {                 
View Full Code Here

    applicationElement.appendChild(resourceTypeElement);
  }

  private void createGrammarsElement(GrammarsNode grammars, Element applicationElement) {
    // grammarsChildren = {includeNode, docNode}   
    Element grammarsElement = wadl.createElement(grammarsNode);
    // <include>   
    if (grammars != null) {
      Vector allIncludes = grammars.getAllIncludes();
      Iterator includeIterator = allIncludes.iterator();
      while (includeIterator.hasNext()) {
        Element includeElement =  wadl.createElement(includeNode);
        includeElement.setAttribute(include_href, (String) includeIterator.next());
        grammarsElement.appendChild(includeElement);
      }     
    } 
   
    // <doc>
View Full Code Here

    applicationElement.appendChild(grammarsElement);   
  }

  private void createResourcesElement(ResourcesNode resources, Element applicationElement) {
    // resourcesChildren = {resourceNode, docNode}
    Element resourcesElement = wadl.createElement(resourcesNode);   
    resourcesElement.setAttribute(resources_base, resources.getBase());
   
    // <resource path="xsd:string">
    Vector allResources =  resources.getAllResources();
    Iterator resourceIterator = allResources.iterator();
    while (resourceIterator.hasNext()) {     
View Full Code Here

    applicationElement.appendChild(resourcesElement);
  }
   
  private void createResourceElement(ResourceNode resource, Element parentElement) {
    // resourceChildren = {paramNode, methodNode, resourceNode, docNode}
    Element resourceElement = wadl.createElement(resourceNode);
    if (resource.getHref() != null) {
      resourceElement.setAttribute(resource_href, resource.getHref());
    }
    else {   
      resourceElement.setAttribute(resource_path, resource.getPath());
      if (resource.getId() != null) resourceElement.setAttribute(resource_id, resource.getId());
    }
   
    // <resource>
    Vector allInnerResources =  resource.getAllResources();
    Iterator innerResourceIterator = allInnerResources.iterator();
View Full Code Here

    parentElement.appendChild(resourceElement);
  }
 
  private void createMethodElement(MethodNode method, Element parentElement) {
    // methodChildren = {requestNode, responseNode, docNode};
    Element methodElement = wadl.createElement(methodNode);
    if (method.getHref() != null) {
      methodElement.setAttribute(method_href, method.getHref());
    }
    else {
      methodElement.setAttribute(method_name, method.getName());
      if (method.getId() != null) methodElement.setAttribute(method_id, method.getId());
    }
       
    // <request>     
    createRequestElement(method.getRequest(), methodElement);           
   
View Full Code Here

  private void createRequestElement(RequestNode request, Element parentElement) {
    if (request == null) {
      return;
    }
    // requestChildren = {representationNode, paramNode, docNode}
    Element requestElement = wadl.createElement(requestNode);
   
    // <param>
    Vector allParams = request.getAllParams();
    Iterator paramIterator = allParams.iterator();
    while (paramIterator.hasNext()) {       
View Full Code Here

    parentElement.appendChild(requestElement);
  }
 
  private void createParamElement(ParamNode param, Element parentElement) {
    // paramChildren = {optionNode, linkNode, docNode}
    Element paramElement = wadl.createElement(paramNode);
    if (param.getHref() != null) {
      paramElement.setAttribute(param_href, param.getHref());
    }
    else {
      if (!param.getName().equals("")) paramElement.setAttribute(param_name, param.getName());         
      if (!param.getType().equals("")) paramElement.setAttribute(param_type, param.getType());
      if (!param.getStyle().equals("")) paramElement.setAttribute(param_style, param.getStyle());
      if (!param.getDefaultValue().equals("")) paramElement.setAttribute(param_default, param.getDefaultValue());
      if (!param.getFixedValue().equals("")) paramElement.setAttribute(param_fixed, param.getFixedValue());
      if (!param.getPath().equals("")) paramElement.setAttribute(param_path, param.getPath());
      if (param.getIsRequired()) paramElement.setAttribute(param_required, "" + param.getIsRequired());
      if (param.getIsRepeating()) paramElement.setAttribute(param_repeating, "" + param.getIsRepeating());
      if (param.getId() != null) paramElement.setAttribute(param_id, param.getId());
    }   
   
    // <option>
    if (param.getOptions().size() > 0) {
      Iterator optionsIterator = param.getOptions().iterator();
      while (optionsIterator.hasNext()) {
        Element optionElement = wadl.createElement(optionNode);
        optionElement.setAttribute(option_value, (String) optionsIterator.next());
        paramElement.appendChild(optionElement);
      }
    }
   
    // <link>
View Full Code Here

  private void createResponseElement(ResponseNode response, Element parentElement) {
    if (response == null) {
      return;
    }
    // responseChildren = {representationNode, faultNode, paramNode, docNode}
    Element responseElement = wadl.createElement(responseNode);
   
    // <representation>
    Vector allRepresentations = response.getAllRepresentations();
    Iterator allRepresentationsIterator = allRepresentations.iterator();
    while (allRepresentationsIterator.hasNext()) {
View Full Code Here

    parentElement.appendChild(responseElement);
  }
 
  private void createRepresentationElement(RepresentationNode representation, Element parentElement) {
    // representationChildren = {paramNode, docNode}
    Element representationElement = wadl.createElement(representationNode);
    if (representation.getHref() != null) {
      representationElement.setAttribute(representation_href, representation.getHref());
    }
    else {
      if (!representation.getMediaType().equals("")) representationElement.setAttribute(representation_mediaType, representation.getMediaType());
      if (!representation.getElement().equals("")) representationElement.setAttribute(representation_element, representation.getElement());
      if (!representation.getStatus().equals("")) representationElement.setAttribute(representation_status, representation.getStatus());
      if (!representation.getProfile().equals("")) representationElement.setAttribute(representation_profile, representation.getProfile());
      if (representation.getId() != null) representationElement.setAttribute(representation_id, representation.getId());
    }   
   
    // <param>
    Vector allRepresentationParams = representation.getAllParams();
    Iterator representationParamIterator = allRepresentationParams.iterator();
View Full Code Here

TOP

Related Classes of com.google.gwt.xml.client.Element

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.