Package org.evolizer.famix.importer

Examples of org.evolizer.famix.importer.ProjectParser


    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IJavaModel model =  JavaCore.create(workspace.getRoot());
    IJavaProject project = model.getJavaProject("TestProject");
    List<IJavaElement> selection = new ArrayList<IJavaElement>();
    selection.add(project);
    ProjectParser parser = new ProjectParser(selection);
    parser.parse(null);
    fModel = parser.getModel();

//     output all entities and source anchors
    for (AbstractFamixEntity entity : fModel.getFamixEntities()) {
      System.out.print(entity.getUniqueName());
      if (entity.getSourceAnchor() != null) {
View Full Code Here


    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IJavaModel model =  JavaCore.create(workspace.getRoot());
    IJavaProject project = model.getJavaProject("TestProject");
    List<IJavaElement> selection = new ArrayList<IJavaElement>();
    selection.add(project);
    ProjectParser parser = new ProjectParser(selection);
    parser.parse(null);
    fModel = parser.getModel();
   
    fUnresolvedInvocationHandler = new UnresolvedInvocationHandler(fModel, parser.getUnresolvedCalls());
    fUnresolvedInvocationHandler.process(new NullProgressMonitor());
    fUnresolvedInvocationHandler.addInvocations(new NullProgressMonitor());
   
//      output all entities and source anchors
        for (AbstractFamixEntity entity : fModel.getFamixEntities()) {
View Full Code Here

  public static void setUpBeforeClass() throws Exception, AssertionError {
    AbstractEvolizerFamixImporterTest.setUpBeforeClass();

    List<IJavaElement> selection = new LinkedList<IJavaElement>();
    selection.add(project);
    ProjectParser parser = new ProjectParser(selection);
    parser.parse(null);

    aModel = parser.getModel();
   
    // output all entities and source anchors
//    for (AbstractFamixEntity entity : aModel.getAllElements()) {
//      System.out.print(entity.getUniqueName());
//      if (entity.getSourceAnchor() != null) {
View Full Code Here

    EvolizerSessionHandler.getHandler().dropSchema(project.getProject());
    EvolizerSessionHandler.getHandler().createSchema(project.getProject());
   
    List<IJavaElement> selection = new ArrayList<IJavaElement>();
    selection.add(project);
    ProjectParser parser = new ProjectParser(selection);
    parser.parse(null);
    createdModel = parser.getModel();
   
    fUnresolvedInvocationHandler = new UnresolvedInvocationHandler(createdModel, parser.getUnresolvedCalls());
    fUnresolvedInvocationHandler.process(new NullProgressMonitor());
    fUnresolvedInvocationHandler.addInvocations(new NullProgressMonitor());
   
    EvolizerSessionHandler.getHandler().getCurrentSession(project.getProject());
    aDAOModel = new DAOModel(EvolizerSessionHandler.getDBUrl(project.getProject()),createdModel);
View Full Code Here

        project = model.getJavaProject("TestProject1");
        assertTrue("TestProject1 does not exist", project.exists());
       
        List<IJavaElement> selection = new LinkedList<IJavaElement>();
        selection.add(project);
        ProjectParser parser = new ProjectParser(selection);
        parser.parse(null);

        aModel = parser.getModel();
    }
View Full Code Here

        EvolizerSessionHandler.getHandler().dropSchema(project.getProject());
        EvolizerSessionHandler.getHandler().createSchema(project.getProject());
   
        List<IJavaElement> selection = new LinkedList<IJavaElement>();
        selection.add(project);
        ProjectParser parser = new ProjectParser(selection);
        parser.parse(null);
   
    createdModel = parser.getModel();

        EvolizerSessionHandler.getHandler().getCurrentSession(project.getProject());
    aDAOModel = new DAOModel(EvolizerSessionHandler.getDBUrl(project.getProject()), createdModel);     
    aDAOModel.store(null);
View Full Code Here

    @Override
    protected IStatus run(IProgressMonitor monitor) {
        IStatus status = Status.OK_STATUS;
        SubMonitor progress = SubMonitor.convert(monitor, "Process selected items", 100);
        try {
            final ProjectParser projectParser = new ProjectParser(fSelectedJavaElements);
            status = projectParser.parse(progress.newChild(70));

            // process unresolved method calls
            if ((projectParser.getModel() != null) && (status.getSeverity() == IStatus.OK)) {
                UnresolvedInvocationHandler unresolvedInvocationHandler =
                        new UnresolvedInvocationHandler(projectParser.getModel(), projectParser
                                .getUnresolvedCalls());
                status = unresolvedInvocationHandler.process(progress.newChild(20));
                if (status.getSeverity() == IStatus.OK) {
                    status = unresolvedInvocationHandler.addInvocations(progress.newChild(10));
                }
                if (status.getSeverity() == IStatus.OK) {
                    FamixImporterPlugin.getDefault().setUnresolvedInvocationHandler(
                            unresolvedInvocationHandler);
                    FamixImporterPlugin.getDefault().setParser(projectParser);

                    fFamixModel = projectParser.getModel();
                }
               
            }
        } finally {
            if (monitor != null) {
View Full Code Here

       
        try {
            final IJavaProject javaProject = JavaSelectionHelper.getProject(selection);

            if ((selection != null) && (FamixImporterPlugin.getDefault().getParser() != null)) {
                ProjectParser currentParser = FamixImporterPlugin.getDefault().getParser();
                IJavaProject parsedProject = JavaSelectionHelper.getProject(currentParser.getSelection().iterator().next());
                if (javaProject.equals(parsedProject)) {
                    if ((currentParser.getModel() != null)
                            && (currentParser.getModel().getFamixEntities().size() > 0)) {
                        AbstractFamixEntity firstEntity = currentParser.getModel().getFamixEntities().iterator().next();
                        if (firstEntity.getId() == null) {
                            EvolizerSessionHandler.getHandler().initSessionFactory(javaProject.getProject());

                            String dbUrl = EvolizerSessionHandler.getDBUrl(javaProject.getProject());
                            Job mainJob = new FamixStoreModelJob(dbUrl, currentParser.getModel());
                            mainJob.setUser(true);
                            mainJob.schedule();
                        } else {
                            sLogger.warn("FamixModel has already been stored.");
                        }
View Full Code Here

        project = model.getJavaProject("TestProject1");
        assertTrue("TestProject1 does not exist", project.exists());
       
        List<IJavaElement> selection = new LinkedList<IJavaElement>();
        selection.add(project);
        ProjectParser parser = new ProjectParser(selection);
        parser.parse(null);

        aModel = parser.getModel();
    }
View Full Code Here

    List<IJavaElement> selection = new LinkedList<IJavaElement>();
    selection.add(javaProject1);
    selection.add(javaProject2);
   
    ProjectParser parser = new ProjectParser(selection);
    parser.parse(null);
//    parser.parseProject(project, null);
    aModel = parser.getModel();
  }
View Full Code Here

TOP

Related Classes of org.evolizer.famix.importer.ProjectParser

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.