Search in sources :

Example 1 with Enabled

use of org.springframework.boot.ansi.AnsiOutput.Enabled in project spring-boot by spring-projects.

the class AnsiOutputApplicationListener method onApplicationEvent.

@Override
public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
    RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(event.getEnvironment(), "spring.output.ansi.");
    if (resolver.containsProperty("enabled")) {
        String enabled = resolver.getProperty("enabled");
        AnsiOutput.setEnabled(Enum.valueOf(Enabled.class, enabled.toUpperCase()));
    }
    if (resolver.containsProperty("console-available")) {
        AnsiOutput.setConsoleAvailable(resolver.getProperty("console-available", Boolean.class));
    }
}
Also used : RelaxedPropertyResolver(org.springframework.boot.bind.RelaxedPropertyResolver) Enabled(org.springframework.boot.ansi.AnsiOutput.Enabled)

Aggregations

Enabled (org.springframework.boot.ansi.AnsiOutput.Enabled)1 RelaxedPropertyResolver (org.springframework.boot.bind.RelaxedPropertyResolver)1