Skip to content

利用 JavaParser 将 Wrapper 变为 Interface #1

@yfblock

Description

@yfblock

原来的

package io.github.yfblock.test.Runners;

import io.github.yfblock.test.Bean.User;
import io.github.yfblock.yfSql.Annotation.DataRunner;
import io.github.yfblock.yfSql.Annotation.Select;

import java.sql.SQLException;
import java.util.List;

@DataRunner
public class TestService {

//    private SqlRunner sqlRunner;

    @Select("select id, username from user")
    public List<User> getUsers() throws SQLException {
        return null;
    }
}

目标:

package io.github.yfblock.test;

import io.github.yfblock.test.Bean.User;
import io.github.yfblock.yfSql.Annotation.DataRunner;
import io.github.yfblock.yfSql.Annotation.Select;

import java.sql.SQLException;
import java.util.List;

@DataRunner
public interface TestInterface {

    @Select("select id, username from user")
    public List<User> getUsers() throws SQLException;
}

预计方案:利用 JavaParser 生成类,然后利用注解处理器将初始化函数插入到注解存在的位置。

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions