Package org.jline.style
Class Styler
- java.lang.Object
-
- org.jline.style.Styler
-
public class Styler extends java.lang.Object
Style facade.- Since:
- 3.4
- See Also:
StyleBundle
,StyleFactory
,StyleSource
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
log
private static StyleSource
source
-
Constructor Summary
Constructors Modifier Constructor Description private
Styler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends StyleBundle>
Tbundle(java.lang.Class<T> type)
Create aStyleBundle
proxy.static <T extends StyleBundle>
Tbundle(java.lang.String group, java.lang.Class<T> type)
Create aStyleBundle
proxy with explicit style-group.static StyleFactory
factory(java.lang.String group)
Create a factory for the given style-group.static StyleSource
getSource()
Returns globalStyleSource
.static StyleResolver
resolver(java.lang.String group)
Create a resolver for the given style-group.static void
setSource(StyleSource source)
Install globalStyleSource
.
-
-
-
Field Detail
-
log
private static final java.util.logging.Logger log
-
source
private static volatile StyleSource source
-
-
Method Detail
-
getSource
public static StyleSource getSource()
Returns globalStyleSource
.- Returns:
- the global style source
-
setSource
public static void setSource(StyleSource source)
Install globalStyleSource
.- Parameters:
source
- the new global style source
-
resolver
public static StyleResolver resolver(java.lang.String group)
Create a resolver for the given style-group.- Parameters:
group
- the group- Returns:
- the resolver
-
factory
public static StyleFactory factory(java.lang.String group)
Create a factory for the given style-group.- Parameters:
group
- the group- Returns:
- the factory
-
bundle
public static <T extends StyleBundle> T bundle(java.lang.Class<T> type)
Create aStyleBundle
proxy.Target class must be annotated with
StyleBundle.StyleGroup
.- Type Parameters:
T
- the interface to proxy- Parameters:
type
- the interface to proxy- Returns:
- the proxy
-
bundle
public static <T extends StyleBundle> T bundle(java.lang.String group, java.lang.Class<T> type)
Create aStyleBundle
proxy with explicit style-group.- Type Parameters:
T
- the interface to proxy- Parameters:
group
- the grouptype
- the interface to proxy- Returns:
- the proxy
-
-