java.lang.Object
dev.metaschema.schemagen.ModuleIndex.DefinitionEntry
- Enclosing class:
- ModuleIndex
Represents an entry in the module index for a single definition.
Each entry tracks usage information about a definition including its references, inline status, and how it is used within choice groups.
-
Constructor Summary
ConstructorsConstructorDescriptionDefinitionEntry(dev.metaschema.core.model.IDefinition definition) Constructs a new definition entry for the specified definition. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddReference(dev.metaschema.core.model.INamedInstance reference) Adds a reference to this definition from the specified instance.dev.metaschema.core.model.IDefinitionRetrieves the definition associated with this entry.Set<dev.metaschema.core.model.INamedInstance>Retrieves all instances that reference this definition.booleanChecks if this definition is a member of a choice group.booleanChecks if this definition has sibling elements in a choice group.booleanisInline()Checks if this definition should be inlined in the generated schema.booleanChecks if this definition is referenced by any instance or is a root definition.booleanisRoot()Checks if this definition is a root assembly definition.booleanChecks if this definition is used within a choice group.booleanChecks if any reference to this definition uses a JSON key flag.booleanChecks if this definition is used without a JSON key flag or is a flag definition.booleanChecks if this definition has been visited during indexing.voidMarks this definition as having sibling elements in a choice group.voidMarks this definition as being inlined in the generated schema.voidMarks this definition as being used within a choice group.voidMarks this definition as having been visited during indexing.
-
Constructor Details
-
DefinitionEntry
Constructs a new definition entry for the specified definition.- Parameters:
definition- the definition this entry represents
-
-
Method Details
-
getDefinition
Retrieves the definition associated with this entry.- Returns:
- the definition
-
isRoot
Checks if this definition is a root assembly definition.- Returns:
trueif the definition is a root assembly,falseotherwise
-
isReferenced
Checks if this definition is referenced by any instance or is a root definition.- Returns:
trueif the definition has references or is a root,falseotherwise
-
getReferences
Retrieves all instances that reference this definition.- Returns:
- a set of referencing instances
-
addReference
Adds a reference to this definition from the specified instance.- Parameters:
reference- the instance referencing this definition- Returns:
trueif the reference was added,falseif it already existed
-
markVisited
Marks this definition as having been visited during indexing. -
isVisited
Checks if this definition has been visited during indexing.- Returns:
trueif the definition was visited,falseotherwise
-
markInline
Marks this definition as being inlined in the generated schema. -
isInline
Checks if this definition should be inlined in the generated schema.- Returns:
trueif the definition is inlined,falseotherwise
-
markUsedAsChoice
Marks this definition as being used within a choice group. -
isUsedAsChoice
Checks if this definition is used within a choice group.- Returns:
trueif the definition is used as a choice,falseotherwise
-
markAsChoiceSibling
Marks this definition as having sibling elements in a choice group. -
isChoiceSibling
Checks if this definition has sibling elements in a choice group.- Returns:
trueif the definition is a choice sibling,falseotherwise
-
isUsedAsJsonKey
Checks if any reference to this definition uses a JSON key flag.- Returns:
trueif any reference has a JSON key,falseotherwise
-
isUsedWithoutJsonKey
Checks if this definition is used without a JSON key flag or is a flag definition.- Returns:
trueif the definition is a flag or has any references without a JSON key,falseotherwise
-
isChoiceGroupMember
Checks if this definition is a member of a choice group.- Returns:
trueif any reference is a grouped model instance,falseotherwise
-