Class JsonRenderer

  • All Implemented Interfaces:
    Renderer
    Direct Known Subclasses:
    DiagnosticJsonRenderer

    public class JsonRenderer
    extends AbstractRenderer
    This class is used to render the contents of a Block in JavaScript Object Notation (JSON) format.
    Since:
    MicroStrategy Web 9.0.0
    • Field Detail

      • PROPERTY_ANNOTATION_GROUP

        public static final java.lang.String PROPERTY_ANNOTATION_GROUP
        See Also:
        Constant Field Values
      • PROPERTY_ANNOTATION_EXPRESSION

        public static final java.lang.String PROPERTY_ANNOTATION_EXPRESSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • JsonRenderer

        public JsonRenderer()
        Default no-args constructor.
    • Method Detail

      • generateMarkup

        public MarkupOutput generateMarkup​(BlockContext bContext,
                                           Block block)
                                    throws java.lang.Exception
        Description copied from interface: Renderer
        Generate the markup representation of the specified Block.
        Parameters:
        bContext - The BlockContext object that controls how BlockProperty values are expanded and Blocks are serialized.
        block - The Block to generate markup for.
        Returns:
        A new MarkupOutput object that contains the generated markup.
        Throws:
        java.lang.Exception - If an error occurs in the process of generating the markup.
      • buildJsonGeneratorTree

        public GenericJsonGenerator buildJsonGeneratorTree​(Block block,
                                                           BlockContext bContext)
        Construct a JSON Generator Tree from the Block tree.
        Parameters:
        block - The Block tree to convert into a JSON Generator.
        bContext - The BlockContext which defines how dynamic Block property values are computed.
        Returns:
        A GenericJsonGenerator that holds the contents of the Block tree.
        Since:
        MicroStrategy Web 9.0.1
      • getBlockPropertyComparator

        protected java.util.Comparator<BlockProperty> getBlockPropertyComparator()