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 NameRegisterSchema global name register.private final ObjectStackSchema element stack.private final SetSet of schema elements already visited. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the set of schemas that have been traversed.booleanenterSchema(SchemaElement schema) Enter schema.voidExit schema.Get current schema element.Get name register.voidSet 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:ISchemaListenerEnter schema. This is called before beginning the traversal of a schema, including both standalone schemas and referenced schemas.- Specified by:
enterSchemain interfaceISchemaListener- Parameters:
schema-- Returns:
trueif schema should be entered,falseif not
-
exitSchema
public void exitSchema()Description copied from interface:ISchemaListenerExit schema. This is called when the tranversal of a schema is completed.- Specified by:
exitSchemain interfaceISchemaListener
-