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 ISchemaListenerListener for entering and exiting referenced schemas.private final ISkipElementsSelector for elements to be skipped when walking tree (nullif unused).private static final LoggerLogger for class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LevelsetLogging(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.
-
Field Details
-
s_logger
private static final Logger s_loggerLogger for class. -
m_skipSet
Selector for elements to be skipped when walking tree (nullif unused). -
m_schemaListener
Listener for entering and exiting referenced schemas. (nullif unused).
-
-
Constructor Details
-
TreeWalker
Constructor.- Parameters:
skip- selector for elements to be skipped (nullif none skipped)listen- schema reference listener (nullif 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
-