Class AbstractTextRenderer

    • Field Detail

      • m_Renderers

        protected static List<TextRenderer> m_Renderers
        all available renderers.
      • m_Default

        protected static TextRenderer m_Default
        the default renderer.
    • Constructor Detail

      • AbstractTextRenderer

        public AbstractTextRenderer()
    • Method Detail

      • check

        protected String check​(Object obj)
        Renders the object as text.
        Parameters:
        obj - the object to render
        Returns:
        the generated string or null if failed to render
      • doRender

        protected abstract String doRender​(Object obj)
        Renders the object as text.
        Parameters:
        obj - the object to render
        Returns:
        the generated string or null if failed to render
      • render

        public String render​(Object obj)
        Renders the object as text.
        Specified by:
        render in interface TextRenderer
        Parameters:
        obj - the object to render
        Returns:
        the generated string or null if failed to render
      • getDefaultRenderer

        public static TextRenderer getDefaultRenderer()
        Returns the default renderer.
        Returns:
        the default
      • getRenderer

        public static TextRenderer getRenderer​(Object obj)
        Returns the renderer for the specified object.
        Parameters:
        obj - the object to get the renderer for
        Returns:
        the renderer
      • getRenderer

        public static TextRenderer getRenderer​(Class cls)
        Returns the renderer for the specified class.
        Parameters:
        cls - the class to get the renderer for
        Returns:
        the renderer
      • getRenderers

        public static List<TextRenderer> getRenderers​(Object obj)
        Returns the renderers for the specified object.
        Parameters:
        obj - the object to get the renderer for
        Returns:
        the renderers
      • getRenderers

        public static List<TextRenderer> getRenderers​(Class cls)
        Returns the renderers for the specified class.
        Parameters:
        cls - the class to get the renderer for
        Returns:
        the renderers
      • renderObject

        public static String renderObject​(Object obj)
        Renders the object.
        Parameters:
        obj - the object to render
        Returns:
        the generated string, null if failed to render