class CloudJobBeanBuilder implements BeanBuilder<CloudJob> {
    private static final CloudJobBeanBuilder instance = new CloudJobBeanBuilder();

    public static CloudJobBeanBuilder getInstance() {
        return instance;
    }

    //要使用有顺序的 LinkedHashMap
    private final Map<Class<?>, BeanBuilder<CloudJob>> builderMap = new LinkedHashMap<>();

    /**
     * @since 2.0
     * */
    public void addBuilder(Class<?> beanClz, BeanBuilder<CloudJob> beanBuilder) {
        if (!builderMap.containsKey(beanClz)) {
            builderMap.put(beanClz, beanBuilder);
        }
    }

    public CloudJobBeanBuilder() {
        //默认添加 CloudJobHandler 构建器
        addBuilder(CloudJobHandler.class, (clz, bw, anno) -> {
            //支持${xxx}配置
            String name = Solon.cfg().getByParse(Utils.annoAlias(anno.value(), anno.name()));
            //支持${xxx}配置
            String description = Solon.cfg().getByParse(anno.description());

            CloudClient.job().register(name, anno.cron7x(), description, new CloudJobBean(bw));
        });
    }

    @Override
    public void doBuild(Class<?> clz, BeanWrap bw, CloudJob anno) throws Throwable {<FILL_FUNCTION_BODY>}
}

        if (CloudClient.job() == null) {
            throw new IllegalArgumentException("Missing CloudJobService component");
        }

        //@since 2.0
        for (Map.Entry<Class<?>, BeanBuilder<CloudJob>> kv : builderMap.entrySet()) {
            if (kv.getKey().isAssignableFrom(clz)) {
                kv.getValue().doBuild(clz, bw, anno);
                return; //只处理第一个找到的类型
            }
        }

        throw new IllegalArgumentException("Illegal CloudJob type: " + clz.getName());
    
<no_super_class>