org.springframework.boot.ansi

Class AnsiPropertySource

  • java.lang.Object
    • org.springframework.core.env.PropertySource<AnsiElement>
      • org.springframework.boot.ansi.AnsiPropertySource


  • public class AnsiPropertySource
    extends org.springframework.core.env.PropertySource<AnsiElement>
    PropertyResolver for AnsiStyle, AnsiColor, AnsiBackground and Ansi8BitColor elements. Supports properties of the form AnsiStyle.BOLD, AnsiColor.RED or AnsiBackground.GREEN. Also supports a prefix of Ansi. which is an aggregation of everything (with background colors prefixed BG_).

    ANSI 8-bit color codes can be used with AnsiColor and AnsiBackground. For example, AnsiColor.208 will render orange text. Wikipedia has a complete list of the 8-bit color codes that can be used.

    Since:
    1.3.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource

        org.springframework.core.env.PropertySource.StubPropertySource
    • Field Summary

      • Fields inherited from class org.springframework.core.env.PropertySource

        logger, name, source
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object getProperty(java.lang.String name) 
      • Methods inherited from class org.springframework.core.env.PropertySource

        containsProperty, equals, getName, getSource, hashCode, named, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AnsiPropertySource

        public AnsiPropertySource(java.lang.String name,
                                  boolean encode)
        Create a new AnsiPropertySource instance.
        Parameters:
        name - the name of the property source
        encode - if the output should be encoded
    • Method Detail

      • getProperty

        public java.lang.Object getProperty(java.lang.String name)
        Specified by:
        getProperty in class org.springframework.core.env.PropertySource<AnsiElement>