Package org.jline.style
Class StyleBundleInvocationHandler
java.lang.Object
org.jline.style.StyleBundleInvocationHandler
- All Implemented Interfaces:
InvocationHandler
StyleBundle
proxy invocation-handler to convert method calls into string styling.- Since:
- 3.4
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Thrown when processingStyleBundle
method is found to be invalid.(package private) static class
Thrown when looking upStyleBundle.StyleGroup
on a type found to be missing or invalid.(package private) static class
Thrown whenStyleBundle
method has missingStyleBundle.DefaultStyle
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Logger
private final StyleResolver
private final Class<? extends StyleBundle>
-
Constructor Summary
ConstructorsConstructorDescriptionStyleBundleInvocationHandler
(Class<? extends StyleBundle> type, StyleResolver resolver) -
Method Summary
Modifier and TypeMethodDescription(package private) static <T extends StyleBundle>
Tcreate
(StyleResolver resolver, Class<T> type) Internal factory-method.(package private) static <T extends StyleBundle>
Tcreate
(StyleSource source, Class<T> type) Internal factory-method.private static String
emptyToNull
(String value) private static String
getDefaultStyle
(Method method) Returns the default-style for given method, ornull
if unable to determine.private static String
getStyleGroup
(Class<?> type) Returns the style group-name for given type, ornull
if unable to determine.private static String
getStyleName
(Method method) Returns the style-name for given method, ornull
if unable to determine.toString()
Slightly better logging for proxies.private static void
ThrowsStyleBundleInvocationHandler.InvalidStyleBundleMethodException
if given method is not suitable.
-
Field Details
-
log
-
type
-
resolver
-
-
Constructor Details
-
StyleBundleInvocationHandler
-
-
Method Details
-
validate
ThrowsStyleBundleInvocationHandler.InvalidStyleBundleMethodException
if given method is not suitable. -
emptyToNull
-
getStyleGroup
Returns the style group-name for given type, ornull
if unable to determine. -
getStyleName
Returns the style-name for given method, ornull
if unable to determine. -
getDefaultStyle
Returns the default-style for given method, ornull
if unable to determine. -
create
Internal factory-method.- See Also:
-
create
Internal factory-method.- See Also:
-
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
toString
Slightly better logging for proxies.
-