Package org.jibx.schema
Class TreeWalker
java.lang.Object
org.jibx.schema.TreeWalker
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ISchemaListener
Listener for entering and exiting referenced schemas.private final ISkipElements
Selector for elements to be skipped when walking tree (null
if unused).private static final Logger
Logger for class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Level
setLogging
(Level level) Control the logging level for this class.void
walkChildren
(SchemaBase root, SchemaVisitor visitor) Walk the descendants of a root element.void
walkElement
(SchemaBase root, SchemaVisitor visitor) Walk schema model element tree.void
walkSchema
(SchemaElement schema, SchemaVisitor visitor) Walk entire schema model.
-
Field Details
-
s_logger
private static final Logger s_loggerLogger for class. -
m_skipSet
Selector for elements to be skipped when walking tree (null
if unused). -
m_schemaListener
Listener for entering and exiting referenced schemas. (null
if unused).
-
-
Constructor Details
-
TreeWalker
Constructor.- Parameters:
skip
- selector for elements to be skipped (null
if none skipped)listen
- schema reference listener (null
if none)
-
-
Method Details
-
setLogging
public static Level setLogging(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
-- Returns:
- prior level
-
walkSchema
Walk entire schema model.- Parameters:
schema
- root element of schema to be traversedvisitor
- target visitor for element notifications
-
walkElement
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
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
-