Class XmlRenderer

  • All Implemented Interfaces:
    Renderer
    Direct Known Subclasses:
    XmlRendererANF

    public class XmlRenderer
    extends AbstractRenderer
    This class is the renderer that converts a Block tree into XML Element Normal Form. It uses the XmlRendererBlockVisitorENF class to perform the actual traversal of the Block tree.
    Since:
    MicroStrategy Web 9.0.0
    • Constructor Detail

      • XmlRenderer

        public XmlRenderer()
    • Method Detail

      • getBlockVisitor

        protected com.microstrategy.web.blocks.renderers.XmlRendererBlockVisitor getBlockVisitor​(BlockContext context)
        By default the XMLRenderer will return a block visitor of ENF type. The ENF type block visitor will output the XML in Element Normal Form.
        Parameters:
        context - the BlockContext object.
        Returns:
        the XmlRendererBlockVisitorENF object
        Since:
        MicroStrategy Web 9.0.1
      • getBlockPropertyComparator

        protected java.util.Comparator<BlockProperty> getBlockPropertyComparator()
        Returns a comparator used to sort the block properties. Since by default the XMLRenderer outputs the XML in ENF form it doesn't need to sort the block properties therefore it returns null.
        Returns:
        null
        Since:
        MicroStrategy Web 9.0.1
      • generateMarkup

        public MarkupOutput generateMarkup​(BlockContext context,
                                           Block block)
                                    throws java.lang.Exception
        Description copied from interface: Renderer
        Generate the markup representation of the specified Block.
        Parameters:
        context - 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.