Package com.google.code.apis.rest.client.Wadl

Examples of com.google.code.apis.rest.client.Wadl.Analyzer


      HorizontalPanel addParamPanel = new HorizontalPanel();
         
      Button addParamButton = new Button(GuiFactory.strings.addParam());
      addParamButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {         
          Analyzer analyzer = null;
          if (parentNode instanceof RequestNode) {   
            ((RequestNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((RequestNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ResponseNode) {     
            ((ResponseNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((ResponseNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ResourceTypeNode) {     
            ((ResourceTypeNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((ResourceTypeNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ResourceNode) {     
            ((ResourceNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((ResourceNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof FaultNode) {     
            ((FaultNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((FaultNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof RepresentationNode) {     
            ((RepresentationNode) parentNode).addParam(new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, ((GenericNode) parentNode).getApplication()));           
            analyzer = ((RepresentationNode) parentNode).getApplication().getAnalyzer();
          }
          else if (parentNode instanceof ApplicationNode) {
            ParamNode param = new ParamNode(GuiFactory.strings.newParam(), (GenericNode) parentNode, (ApplicationNode) parentNode);
            param.setId(GuiFactory.strings.newId());
            ((ApplicationNode) parentNode).addParam(param);           
            analyzer = ((ApplicationNode) parentNode).getAnalyzer();
          }        
          String newRequestString = analyzer.getRequestString();
          if (!newRequestString.equals("")) {
            TextBox requestUriTextBox = ReferenceManager.getRequestUriTextBox(newRequestString);
            Uri uri = new Uri(requestUriTextBox.getText());
            String newUri = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath() + "?";
            String[] queryParameters = uri.getQueryParameters();
            String[] queryValues = uri.getQueryValues();
            for (int i = 0; i < queryParameters.length; i++) {         
              if (i > 0) newUri += "&";      
              newUri += queryParameters[i] + "=" + queryValues[i];
            }
            if (queryParameters.length > 0) {
              newUri += "&";
            }
            newUri += GuiFactory.strings.newParam() + "=" + GuiFactory.strings.paramValue();         
            ListBox httpMethodListBox = ReferenceManager.getHttpMethodListBox(newRequestString);
            ParameterTree parameterTree = ReferenceManager.getParameterTree(newRequestString);
            parameterTree.updateReferences(requestUriTextBox, newUri);
            parameterTree.updateTree();         
            newRequestString = httpMethodListBox.getItemText(httpMethodListBox.getSelectedIndex()) + " " + newUri;
            analyzer.setRequestString(newRequestString);
          }
          listParams(parentNode, parentTreeItem, newRequestString);
        }
      });
      addParamPanel.add(addParamButton);
View Full Code Here


    ApplicationNode application = null;
    for(int i = 0; i < separatedRequestStrings.length; i++) {          
      RequestUriTree requestUriTree = new RequestUriTree(separatedRequestStrings[i]);
      RequestUriPanel.uriTree.addItem(requestUriTree);    
     
      Analyzer analyzer = new Analyzer(separatedRequestStrings[i]);     
      application = analyzer.analyze();
    }   
    WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
    Tree wadlTree = wadlTreeRoot.buildTree(application);
   
    WadlPanel.wadlArea.setWidget(wadlTree);
View Full Code Here

   
    // start analyze button
    startAnalyzeButton = new Button(GuiFactory.strings.analyze());
    startAnalyzeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {            
        Analyzer analyzer = new Analyzer(parameterTree.requestString);
        ApplicationNode application = analyzer.analyze();
           
        WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
        Tree wadlTree = wadlTreeRoot.buildTree(application);
       
        WadlPanel.wadlArea.setWidget(wadlTree);
View Full Code Here

TOP

Related Classes of com.google.code.apis.rest.client.Wadl.Analyzer

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.