Class StyleBundleInvocationHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    class StyleBundleInvocationHandler
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    StyleBundle proxy invocation-handler to convert method calls into string styling.
    Since:
    3.4
    See Also:
    StyleBundle
    • Field Detail

      • log

        private static final java.util.logging.Logger log
      • type

        private final java.lang.Class<? extends StyleBundle> type
    • Constructor Detail

      • StyleBundleInvocationHandler

        public StyleBundleInvocationHandler​(java.lang.Class<? extends StyleBundle> type,
                                            StyleResolver resolver)
    • Method Detail

      • emptyToNull

        @Nullable
        private static java.lang.String emptyToNull​(@Nullable
                                                    java.lang.String value)
      • getStyleGroup

        @Nullable
        private static java.lang.String getStyleGroup​(java.lang.Class<?> type)
        Returns the style group-name for given type, or null if unable to determine.
      • getStyleName

        private static java.lang.String getStyleName​(java.lang.reflect.Method method)
        Returns the style-name for given method, or null if unable to determine.
      • getDefaultStyle

        @Nullable
        private static java.lang.String getDefaultStyle​(java.lang.reflect.Method method)
        Returns the default-style for given method, or null if unable to determine.
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • toString

        public java.lang.String toString()
        Slightly better logging for proxies.
        Overrides:
        toString in class java.lang.Object