Class SimpleSchemaContext
java.lang.Object
org.opendaylight.yangtools.yang.model.spi.AbstractSchemaContext
org.opendaylight.yangtools.yang.model.spi.SimpleSchemaContext
- All Implemented Interfaces:
Immutable
,AnnotationSchemaNodeAware
,AnnotationSchemaNodeAwareSchemaContext
,ActionNodeContainer
,AddedByUsesAware
,AugmentationTarget
,ContainerLike
,CopyableNode
,DataNodeContainer
,DataSchemaNode
,DocumentedNode
,DocumentedNode.WithStatus
,MustConstraintAware
,NotificationNodeContainer
,SchemaContext
,SchemaNode
,WhenConditionAware
- Direct Known Subclasses:
EffectiveSchemaContext
@Beta
public class SimpleSchemaContext
extends AbstractSchemaContext
implements AnnotationSchemaNodeAwareSchemaContext
Simple subclass of
AbstractSchemaContext
which performs some amount of indexing to speed up common
SchemaContext operations. This implementation assumes input modules are consistent and does not perform
any extensive analysis to ensure the resulting object complies to SchemaContext interface.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode
DocumentedNode.WithStatus
-
Field Summary
Fields inherited from class org.opendaylight.yangtools.yang.model.spi.AbstractSchemaContext
NAME_REVISION_COMPARATOR, REVISION_COMPARATOR
Fields inherited from interface org.opendaylight.yangtools.yang.model.api.SchemaContext
NAME
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleSchemaContext
(Collection<? extends @NonNull Module> modules) -
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
addToStringAttributes
(MoreObjects.ToStringHelper toStringHelper) final Optional<AnnotationSchemaNode>
findAnnotation
(QName qname) Find an annotation based on its QName.static SimpleSchemaContext
forModules
(Collection<? extends Module> modules) Create a new instance from specified modules.protected Map<QNameModule,
Module> Returns the namespace+revision-to-module mapping.Returns modules which are part of the schema context.protected final SetMultimap<XMLNamespace,
Module> Returns the namespace-to-module mapping.protected final SetMultimap<String,
Module> Returns the module name-to-module mapping.final String
toString()
Methods inherited from class org.opendaylight.yangtools.yang.model.spi.AbstractSchemaContext
createModuleSet, dataChildByName, findModule, findModule, findModules, findModules, getChildNodes, getDataDefinitions, getDerivedIdentities, getExtensions, getGroupings, getNotifications, getOperations, getTypeDefinitions, getUnknownSchemaNodes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataNodeContainer
dataChildByName, findDataChildByName, findDataChildByName, findDataTreeChild, findDataTreeChild, getChildNodes, getDataChildByName, getGroupings, getTypeDefinitions
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DataSchemaNode
isConfiguration
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.DocumentedNode
getUnknownSchemaNodes
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.NotificationNodeContainer
getNotifications
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.SchemaContext
effectiveConfig, findAction, findDataTreeChild, findModule, findModule, findModule, findModule, findModule, findModule, findModule, findModules, findModules, findNotification, getActions, getAvailableAugmentations, getDataDefinitions, getDerivedIdentities, getDescription, getExtensions, getMustConstraints, getOperations, getQName, getReference, getStatus, getUses, getWhenCondition, isAddedByUses, isAugmenting
-
Constructor Details
-
SimpleSchemaContext
-
-
Method Details
-
forModules
Create a new instance from specified modules. Note that no module validation is done and hence the consistency of the resulting SchemaContext is completely in hands of the caller. -
getModules
Description copied from interface:SchemaContext
Returns modules which are part of the schema context. Returned set is required to have its iteration ordered by module revision, so that if modules are filtered byModuleLike.getName()
orQNameModuleAware.getNamespace()
, modules having the same attribute are encountered newest revision first.- Specified by:
getModules
in interfaceSchemaContext
- Returns:
- set of the modules which belong to the schema context
-
findAnnotation
Description copied from interface:AnnotationSchemaNodeAware
Find an annotation based on its QName.- Specified by:
findAnnotation
in interfaceAnnotationSchemaNodeAware
- Parameters:
qname
- Annotation name- Returns:
- AnnotationSchemaNode if found
-
getModuleMap
Description copied from class:AbstractSchemaContext
Returns the namespace+revision-to-module mapping.- Specified by:
getModuleMap
in classAbstractSchemaContext
- Returns:
- Map of modules where key is Module's QNameModule.
-
getNamespaceToModules
Description copied from class:AbstractSchemaContext
Returns the namespace-to-module mapping.- Specified by:
getNamespaceToModules
in classAbstractSchemaContext
- Returns:
- Map of modules where key is namespace
-
getNameToModules
Description copied from class:AbstractSchemaContext
Returns the module name-to-module mapping.- Specified by:
getNameToModules
in classAbstractSchemaContext
- Returns:
- Map of modules where key is name of module
-
toString
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
-