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.
Constructor and Description |
---|
AnsiPropertySource(String name,
boolean encode)
Create a new
AnsiPropertySource instance. |
Modifier and Type | Method and Description |
---|---|
Object |
getProperty(String name) |
public AnsiPropertySource(String name, boolean encode)
AnsiPropertySource
instance.name
- the name of the property sourceencode
- if the output should be encodedpublic Object getProperty(String name)
getProperty
in class org.springframework.core.env.PropertySource<AnsiElement>
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.