Package org.python.pydev.refactoring.ast.visitors.context

Examples of org.python.pydev.refactoring.ast.visitors.context.ClassDefVisitor


    @Override
    public void runTest() throws Throwable {
        StringBuffer buffer = new StringBuffer();
        ModuleAdapter module = VisitorFactory.createModuleAdapter(null, null, new Document(data.source),
                new PythonNatureStub(), createVersionProvider());
        ClassDefVisitor classVisitor = VisitorFactory.createContextVisitor(ClassDefVisitor.class, module.getASTNode(),
                module, module);

        assertTrue(classVisitor.getAll().size() > 0);
        ClassDefAdapter classDefAdapter = (ClassDefAdapter) classVisitor.getAll().get(0);
        PropertyVisitor propertyVisitor = VisitorFactory.createContextVisitor(PropertyVisitor.class,
                classDefAdapter.getASTNode(), module, classDefAdapter);

        printProperties(buffer, propertyVisitor);
View Full Code Here


        StringBuffer buffer = new StringBuffer();
        ModuleAdapter module = VisitorFactory.createModuleAdapter(null, null, new Document(data.source),
                new PythonNatureStub(), createVersionProvider());
        GlobalAttributeVisitor globalVisitor = VisitorFactory.createContextVisitor(GlobalAttributeVisitor.class,
                module.getASTNode(), module, module);
        ClassDefVisitor classVisitor = VisitorFactory.createContextVisitor(ClassDefVisitor.class, module.getASTNode(),
                module, module);
        assertTrue(classVisitor.getAll().size() > 0);

        ClassDefAdapter classDefAdapter = (ClassDefAdapter) classVisitor.getAll().get(0);
        LocalAttributeVisitor localVisitor = VisitorFactory.createContextVisitor(LocalAttributeVisitor.class,
                classDefAdapter.getASTNode(), module, classDefAdapter);
        printAttributes(buffer, globalVisitor);
        printAttributes(buffer, localVisitor);
View Full Code Here

    @Override
    public void runTest() throws Throwable {
        StringBuffer buffer = new StringBuffer();
        ModuleAdapter module = VisitorFactory.createModuleAdapter(null, null, new Document(data.source),
                new PythonNatureStub(), createVersionProvider());
        ClassDefVisitor visitor = VisitorFactory.createContextVisitor(ClassDefVisitor.class, module.getASTNode(),
                module, module);
        Iterator<IClassDefAdapter> iter = visitor.iterator();

        buffer.append("# " + visitor.getAll().size() + "\n");
        while (iter.hasNext()) {
            IClassDefAdapter adapter = iter.next();
            buffer.append("# " + adapter.getName() + " " + adapter.isNested() + "\n");
        }
        this.setTestGenerated(buffer.toString().trim());

        assertEquals(3, visitor.getAll().size());
        assertEquals(getExpected(), getGenerated());
    }
View Full Code Here

        return functions;
    }

    public List<IClassDefAdapter> getClasses() {
        if (this.classes == null) {
            ClassDefVisitor visitor = VisitorFactory.createContextVisitor(ClassDefVisitor.class, this.getASTNode(),
                    getModule(), this);

            this.classes = visitor.getAll();
        }
        return this.classes;
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.refactoring.ast.visitors.context.ClassDefVisitor

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.