Package org.jibx.schema
Class TreeWalker
- java.lang.Object
-
- org.jibx.schema.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 Summary
Constructors Constructor Description TreeWalker(ISkipElements skip, ISchemaListener listen)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.log4j.LevelsetLogging(org.apache.log4j.Level level)Control the logging level for this class.voidwalkChildren(SchemaBase root, SchemaVisitor visitor)Walk the descendants of a root element.voidwalkElement(SchemaBase root, SchemaVisitor visitor)Walk schema model element tree.voidwalkSchema(SchemaElement schema, SchemaVisitor visitor)Walk entire schema model.
-
-
-
Constructor Detail
-
TreeWalker
public TreeWalker(ISkipElements skip, ISchemaListener listen)
Constructor.- Parameters:
skip- selector for elements to be skipped (nullif none skipped)listen- schema reference listener (nullif 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 traversedvisitor- 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 touredvisitor- 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 touredvisitor- target visitor for element notifications
-
-