class APIParser extends SingleParser<T> {

    @Override
    protected void parse(T type) {
       var api = environment.resolver.any(type, API.class);
       if (api.value() != Version.INFERRED) {
           environment.mappings.put("api-version", api.value().toString());
           return;
       }
       
       for (var version : Version.values()) {
           if (environment.project.api.startsWith(version + ".") || environment.project.api.startsWith(version + "-")) {
               environment.mappings.put("api-version", version.toString());
               break;
           }
       }
       
       if (!environment.mappings.containsKey("api-version")) {
           environment.mappings.put("api-version", Version.INFERRED.toString());
           environment.warn(type, "Could not infer \"api-version\", \"" + Version.INFERRED + "\" will be used instead");
       }
    }

    public  APIParser(Environment<T> environment);

}