use of org.checkerframework.checker.calledmethods.builder.AutoValueSupport in project checker-framework by typetools.
the class CalledMethodsAnnotatedTypeFactory method enableFrameworks.
/**
* Enables support for the default builder-generation frameworks, except those listed in the
* disabled builder frameworks parsed from the -AdisableBuilderFrameworkSupport option's
* arguments. Throws a UserError if the user included an unsupported framework in the list of
* frameworks to be disabled.
*
* @param disabledFrameworks the disabled builder frameworks
*/
private void enableFrameworks(String[] disabledFrameworks) {
boolean enableAutoValueSupport = true;
boolean enableLombokSupport = true;
for (String framework : disabledFrameworks) {
switch(framework) {
case "autovalue":
enableAutoValueSupport = false;
break;
case "lombok":
enableLombokSupport = false;
break;
default:
throw new UserError("Unsupported builder framework in -AdisableBuilderFrameworkSupports: " + framework);
}
}
if (enableAutoValueSupport) {
builderFrameworkSupports.add(new AutoValueSupport(this));
}
if (enableLombokSupport) {
builderFrameworkSupports.add(new LombokSupport(this));
}
}
Aggregations