Examples of rewrite()


Examples of org.eclipse.assemblyformatter.ir.Formatter.rewrite()

        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.rewrite();
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.rewrite()

      TypeDeclaration typeDec = (TypeDeclaration) cunit.types().get(0);
      List list = typeDec.superInterfaceTypes();
      Name name = ast.newName(cName);
      Type interfaceType = ast.newSimpleType(name);
      list.add(interfaceType);
      TextEdit edits = cunit.rewrite(document, icunit.getJavaProject()
          .getOptions(true));
      edits.apply(document);
      String newSource = document.get();
      icunit.getBuffer().setContents(newSource);
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.Program.rewrite()

      FunctionDeclaration function = previewAST.newFunctionDeclaration(previewAST.newIdentifier(fMethodName), computeArguments(previewAST), previewAST.newBlock(), false);
      MethodDeclaration method = previewAST.newMethodDeclaration(fModifierAccessFlag, function);
      previewProgram.statements().add(method);
     
      Document myDoc = new Document();
      previewProgram.rewrite(myDoc, null).apply(myDoc);
     
      return myDoc.get().substring(0, myDoc.get().indexOf(METHOD_ARGUMENT_CLOSING_CHAR) + 1);
     
    } catch (Exception e) {
      return RefactoringMessages.ExtractMethodPreviewPage_NoSignaturePreviewAvailable;
View Full Code Here

Examples of org.elasticsearch.common.lucene.search.MoreLikeThisQuery.rewrite()

        MemoryIndex index = new MemoryIndex();
        index.addField("name.first", "apache lucene", new WhitespaceAnalyzer());
        index.addField("name.last", "1 2 3 4", new WhitespaceAnalyzer());

        // two clauses, one for items and one for like_text if set
        BooleanQuery luceneQuery = (BooleanQuery) mltQuery.rewrite(index.createSearcher().getIndexReader());
        BooleanClause[] clauses = luceneQuery.getClauses();

        // check for items
        int minNumberShouldMatch = ((BooleanQuery) (clauses[0].getQuery())).getMinimumNumberShouldMatch();
        assertThat(minNumberShouldMatch, is(4));
View Full Code Here

Examples of org.grouplens.grapht.solver.DependencySolver.rewrite()

        final DAGNode<Component, Dependency> toBuild;
        RecommenderGraphBuilder rgb = new RecommenderGraphBuilder();
        rgb.addBindings(config.getBindings());
        DependencySolver solver = rgb.buildDependencySolver();
        try {
            toBuild = solver.rewrite(graph);
        } catch (ResolutionException ex) {
            throw new RecommenderConfigurationException("error reconfiguring recommender", ex);
        }
        GraphtUtils.checkForPlaceholders(toBuild, logger);
View Full Code Here

Examples of org.jboss.seam.web.Rewrite.rewrite()

    }
   
    public void testMatchIn(Pattern pattern, String incoming, String expected) {
        Rewrite rewrite = pattern.matchIncoming(incoming);
        assertTrue(rewrite.isMatch(), incoming);
        assertEquals(rewrite.rewrite(), expected);
    }
   
    public void testMatchOut(Pattern pattern, String incoming, String expected) {
        Rewrite rewrite = pattern.matchOutgoing(incoming);
        assertTrue(rewrite.isMatch(), incoming);
View Full Code Here

Examples of org.jboss.seam.web.Rewrite.rewrite()

    }
   
    public void testMatchOut(Pattern pattern, String incoming, String expected) {
        Rewrite rewrite = pattern.matchOutgoing(incoming);
        assertTrue(rewrite.isMatch(), incoming);
        assertEquals(rewrite.rewrite(), expected);
    }

}
View Full Code Here

Examples of org.tmatesoft.hg.util.PathRewrite.rewrite()

  public void testNationalChars() {
    String s = "Привет.txt";
    //
    propertyOverrides.put(Internals.CFG_PROPERTY_FS_FILENAME_ENCODING, "cp1251");
    PathRewrite sph = repoInit.buildDataFilesHelper(sessionCtx);
    errorCollector.checkThat(sph.rewrite(s), CoreMatchers.<CharSequence>equalTo("store/data/~cf~f0~e8~e2~e5~f2.txt.i"));
    //
    propertyOverrides.put(Internals.CFG_PROPERTY_FS_FILENAME_ENCODING, "UTF8");
    sph = repoInit.buildDataFilesHelper(sessionCtx);
    errorCollector.checkThat(sph.rewrite(s), CoreMatchers.<CharSequence>equalTo("store/data/~d0~9f~d1~80~d0~b8~d0~b2~d0~b5~d1~82.txt.i"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.