如何从项目类生成库占位符类?

时间:2019-09-26 08:44:27

标签: android

我正在重构一些Android项目,它使用了主应用程序和许多扩展应用程序。 要创建扩展应用程序,您必须使用从主应用程序部分生成的android库(我认为)。 扩展应用程序知道库可以使用主应用程序中的哪些对象时,就需要使用该库。

这是来自主应用程序的代码示例:

    @Public
    public static class ReadSinglePostData implements HttpRequest.HolderPreset {
        @Public
        public final String boardName;
        @Public
        public final String postNumber;
        @Public
        public final HttpHolder holder;

        public ReadSinglePostData(String boardName, String postNumber, HttpHolder holder) {
            this.boardName = boardName;
            this.postNumber = postNumber;
            this.holder = holder;
        }

        @Override
        public HttpHolder getHolder() {
            return holder;
        }
    }

这是库中代码的示例,其中所有方法的主体都替换为throw new IllegalAccessError();

    /**
     * <p>Arguments holder for {@link #onReadSinglePost(ReadSinglePostData)}. Notify that this class might
     * be used as {@link HttpRequest.Preset}.</p>
     */
    public static class ReadSinglePostData implements HttpRequest.Preset {
        /**
         * <p>Board name argument.</p>
         */
        public final String boardName;

        /**
         * <p>Post number argument.</p>
         */
        public final String postNumber;

        /**
         * <p>HTTP holder. You must use it when building new {@link HttpRequest}.</p>
         */
        public final HttpHolder holder;

        ReadSinglePostData() {
            throw new IllegalAccessError();
        }
    }

我的问题是什么:如何从任何其他项目类中生成相同的库类?

我试图在Android Studio中找到用于此目的的工具,但搜索失败。

0 个答案:

没有答案
相关问题