Class CmsXmlContentTree


  • public class CmsXmlContentTree
    extends java.lang.Object
    Tree representation of CmsXmlContent which is suitable for XML-to-JSON transformations.
    • Constructor Detail

      • CmsXmlContentTree

        public CmsXmlContentTree​(CmsXmlContent content,
                                 java.util.Locale locale)
        Creates a new instance and initializes the full tree for the given locale.
        Parameters:
        content - the content from which the tree should be generated
        locale - the locale for which the tree should be generated
    • Method Detail

      • visitNodes

        public static void visitNodes​(CmsXmlContentTree.Node node,
                                      java.util.function.Consumer<CmsXmlContentTree.Node> handler)
        Visits all Node instances that are descendants of a given node (including that node itself).
        Parameters:
        node - the root node
        handler - the handler to be invoked for all descendant nodes
      • createNode

        public CmsXmlContentTree.Node createNode​(org.dom4j.Element elem,
                                                 CmsXmlContentDefinition contentDef)
        Creates a node for the given content definition and DOM element.
        Parameters:
        elem - the XML DOM element
        contentDef - the content definition (null for non-nested values)
        Returns:
        the created node
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()