Package org.jline.utils
Class StyleResolver
- java.lang.Object
-
- org.jline.utils.StyleResolver
-
public class StyleResolver extends java.lang.Object
Resolves named (or source-referenced)AttributedStyle
.- Since:
- 3.6
-
-
Constructor Summary
Constructors Constructor Description StyleResolver(java.util.function.Function<java.lang.String,java.lang.String> source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributedStyle
resolve(java.lang.String spec)
Resolve the given style specification.AttributedStyle
resolve(java.lang.String spec, java.lang.String defaultSpec)
Resolve the given style specification.
-
-
-
Method Detail
-
resolve
public AttributedStyle resolve(java.lang.String spec)
Resolve the given style specification.If for some reason the specification is invalid, then
AttributedStyle.DEFAULT
will be used.- Parameters:
spec
- the specification- Returns:
- the style
-
resolve
public AttributedStyle resolve(java.lang.String spec, java.lang.String defaultSpec)
Resolve the given style specification.If this resolves to
AttributedStyle.DEFAULT
then given default specification is used if non-null.- Parameters:
spec
- the specificationdefaultSpec
- the default specifiaction- Returns:
- the style
-
-