Class TreeWalker


  • public class TreeWalker
    extends Object
    Handles walking the tree structure of schema model. This traverses the structure defined by the nesting of elements and schema references in the XML representation.
    Author:
    Dennis M. Sosnoski
    • Constructor Detail

      • TreeWalker

        public TreeWalker​(ISkipElements skip,
                          ISchemaListener listen)
        Constructor.
        Parameters:
        skip - selector for elements to be skipped (null if none skipped)
        listen - schema reference listener (null if none)
    • Method Detail

      • setLogging

        public static org.apache.log4j.Level setLogging​(org.apache.log4j.Level level)
        Control the logging level for this class. Since the generated logs at debug level can become huge, this gives a way for external code to provide granular control over the logging.
        Parameters:
        level - Logging Level
        Returns:
        prior level
      • walkSchema

        public void walkSchema​(SchemaElement schema,
                               SchemaVisitor visitor)
        Walk entire schema model.
        Parameters:
        schema - root element of schema to be traversed
        visitor - target visitor for element notifications
      • walkElement

        public void walkElement​(SchemaBase root,
                                SchemaVisitor visitor)
        Walk schema model element tree. This recursively traverses the schema model tree rooted in the supplied element, including the element itself, notifying the visitor of each element visited during the traversal.
        Parameters:
        root - node of tree to be toured
        visitor - target visitor for element notifications
      • walkChildren

        public void walkChildren​(SchemaBase root,
                                 SchemaVisitor visitor)
        Walk the descendants of a root element. This recursively traverses the schema model tree rooted in the supplied element, excluding the element itself, notifying the visitor of each element visited during the traversal.
        Parameters:
        root - node of tree to be toured
        visitor - target visitor for element notifications