Package org.jibx.schema
Class SchemaContextTracker
java.lang.Object
org.jibx.schema.SchemaContextTracker
- All Implemented Interfaces:
ISchemaListener
- Direct Known Subclasses:
ValidationContext
Current schema name context tracker. This tracks the current schema and the name register associated with that
schema.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NameRegister
Schema global name register.private final ObjectStack
Schema element stack.private final Set
Set of schema elements already visited. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the set of schemas that have been traversed.boolean
enterSchema
(SchemaElement schema) Enter schema.void
Exit schema.Get current schema element.Get name register.void
Set name register.
-
Field Details
-
m_nameRegister
Schema global name register. -
m_traversedSchemas
Set of schema elements already visited. -
m_schemaStack
Schema element stack. The bottom item in this will always be the root schema element being traversed, while other items represent referenced schemas. The top item will always be the current schema.
-
-
Constructor Details
-
SchemaContextTracker
public SchemaContextTracker()Constructor.
-
-
Method Details
-
getNameRegister
Get name register. This requires the name register to have been set, throwing an exception if it has not.- Returns:
- name register (never
null
)
-
setNameRegister
Set name register. This is provided for cases where components are being processed individually, so that the user can set the appropriate register for a component directly.- Parameters:
reg
-
-
getCurrentSchema
Get current schema element. This requires the schema to have been set, throwing an exception if it has not.- Returns:
- current schema element (never
null
)
-
clearTraversed
public void clearTraversed()Clear the set of schemas that have been traversed. This must be called between passes on a set of schemas, so that all the schemas will again be processed in the new pass. -
enterSchema
Description copied from interface:ISchemaListener
Enter schema. This is called before beginning the traversal of a schema, including both standalone schemas and referenced schemas.- Specified by:
enterSchema
in interfaceISchemaListener
- Parameters:
schema
-- Returns:
true
if schema should be entered,false
if not
-
exitSchema
public void exitSchema()Description copied from interface:ISchemaListener
Exit schema. This is called when the tranversal of a schema is completed.- Specified by:
exitSchema
in interfaceISchemaListener
-