public abstract class AbstractSchemaContext extends Object implements SchemaContext
DocumentedNode.WithStatus| Modifier and Type | Field and Description |
|---|---|
protected static Comparator<Module> |
NAME_REVISION_COMPARATOR
A
Module comparator based on Module.getName() and Module.getRevision(), ordering modules
lexicographically by their name and then in order of descending revision. |
protected static Comparator<Module> |
REVISION_COMPARATOR
A
Module comparator based on Module.getRevision(), placing latest revision first. |
NAME| Constructor and Description |
|---|
AbstractSchemaContext() |
| Modifier and Type | Method and Description |
|---|---|
protected static TreeSet<Module> |
createModuleSet()
Create a TreeSet for containing Modules with the same name, such that the set is ordered
by
REVISION_COMPARATOR. |
Optional<DataSchemaNode> |
findDataChildByName(QName name)
Returns the child node corresponding to the specified name.
|
Optional<Module> |
findModule(QNameModule qnameModule)
Returns the module matching specified
QNameModule, if present. |
Optional<Module> |
findModule(String name,
Optional<Revision> revision)
Returns module instance (from the context) with specified name and an optional revision.
|
Set<Module> |
findModules(String name)
Returns module instances (from the context) with a concrete name.
|
Set<Module> |
findModules(URI namespace)
Returns module instance (from the context) with concrete namespace.
|
Set<AugmentationSchemaNode> |
getAvailableAugmentations()
Returns augmentations targeting this element.
|
Set<DataSchemaNode> |
getChildNodes()
Returns set of all child nodes defined within this DataNodeContainer.
|
Set<DataSchemaNode> |
getDataDefinitions()
Returns data schema node instances which represents direct subnodes (like
leaf, leaf-list, list, container) in all YANG modules in the context.
|
Set<ExtensionDefinition> |
getExtensions()
Returns extension definition instances which are defined as the direct
subelements in all YANG modules in the context.
|
Set<GroupingDefinition> |
getGroupings()
Returns set of all groupings defined within this DataNodeContainer.
|
protected abstract Map<QNameModule,Module> |
getModuleMap()
Returns the namespace+revision-to-module mapping.
|
protected abstract com.google.common.collect.SetMultimap<URI,Module> |
getNamespaceToModules()
Returns the namespace-to-module mapping.
|
protected abstract com.google.common.collect.SetMultimap<String,Module> |
getNameToModules()
Returns the module name-to-module mapping.
|
Set<NotificationDefinition> |
getNotifications()
Return the set of notifications in this container, keyed by QName.
|
Set<RpcDefinition> |
getOperations()
Returns rpc definition instances which are defined as the direct
subelements in all YANG modules in the context.
|
SchemaPath |
getPath()
Returns the schema path of the instance of the type
SchemaNode. |
QName |
getQName()
Returns QName of the instance of the type
SchemaNode. |
Status |
getStatus()
Returns status of the instance of the type
SchemaNode. |
Set<TypeDefinition<?>> |
getTypeDefinitions()
Returns set of all newly defined types within this DataNodeContainer.
|
List<UnknownSchemaNode> |
getUnknownSchemaNodes()
Returns unknown schema nodes which belongs to this instance.
|
Set<UsesNode> |
getUses()
Returns grouping nodes used ny this container.
|
boolean |
isAddedByUses()
Deprecated.
|
boolean |
isAugmenting()
Deprecated.
|
boolean |
isConfiguration()
Returns
true if the data represents configuration data,
otherwise returns false. |
boolean |
isPresenceContainer()
Returns true if this container is marked as presence.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindDataTreeChild, findModule, findModule, findModule, findModule, findModule, getActions, getDescription, getModules, getMustConstraints, getReference, getWhenConditionfindDataTreeChild, findDataTreeChild, getDataChildByNameprotected static final Comparator<Module> REVISION_COMPARATOR
Module comparator based on Module.getRevision(), placing latest revision first. Note this
comparator does not take into account module name and so two modules with different names but same revisions
compare as equal.protected static final Comparator<Module> NAME_REVISION_COMPARATOR
Module comparator based on Module.getName() and Module.getRevision(), ordering modules
lexicographically by their name and then in order of descending revision. This comparator assumes that
the combination of these two attributes is sufficient to be consistent with hashCode/equals.protected static final TreeSet<Module> createModuleSet()
REVISION_COMPARATOR.protected abstract com.google.common.collect.SetMultimap<URI,Module> getNamespaceToModules()
protected abstract com.google.common.collect.SetMultimap<String,Module> getNameToModules()
protected abstract Map<QNameModule,Module> getModuleMap()
public Set<DataSchemaNode> getDataDefinitions()
SchemaContextgetDataDefinitions in interface SchemaContextDataSchemaNode instances which represents
YANG data nodes at the module top levelpublic Set<NotificationDefinition> getNotifications()
NotificationNodeContainerAugmentationSchemaNodes, GroupingDefinitions, ListSchemaNodes and
ContainerSchemaNodes can also contain NotificationDefinitions.getNotifications in interface NotificationNodeContainerpublic Set<RpcDefinition> getOperations()
SchemaContextgetOperations in interface SchemaContextRpcDefinition instances which represents
nodes defined via rpc YANG keywordpublic Set<ExtensionDefinition> getExtensions()
SchemaContextgetExtensions in interface SchemaContextExtensionDefinition instances which
represents nodes defined via extension YANG keywordpublic Optional<Module> findModule(String name, Optional<Revision> revision)
SchemaContextfindModule in interface SchemaContextname - string with the module namerevision - date of the module revisionname and revision.public Optional<Module> findModule(QNameModule qnameModule)
SchemaContextQNameModule, if present.findModule in interface SchemaContextqnameModule - requested QNameModulepublic Set<Module> findModules(URI namespace)
SchemaContextfindModules in interface SchemaContextnamespace - URI instance with specified namespacenamespace or null in other casespublic Set<Module> findModules(String name)
SchemaContextfindModules in interface SchemaContextname - string with the module name@Deprecated public boolean isAugmenting()
CopyableNodetrue if this node was added by augmentation,
otherwise returns false.isAugmenting in interface CopyableNodetrue if this node was added by augmentation,
otherwise returns false@Deprecated public boolean isAddedByUses()
AddedByUsesAwaretrue if this node was added by uses statement,
otherwise returns false.isAddedByUses in interface AddedByUsesAwaretrue if this node was added by uses statement,
otherwise returns falsepublic boolean isConfiguration()
DataSchemaNodetrue if the data represents configuration data,
otherwise returns false.isConfiguration in interface DataSchemaNodetrue if the data represents configuration data,
otherwise returns falsepublic QName getQName()
SchemaNodeSchemaNode.getQName in interface SchemaNodepublic SchemaPath getPath()
SchemaNodeSchemaNode.getPath in interface SchemaNodepublic Status getStatus()
DocumentedNode.WithStatusSchemaNode.getStatus in interface DocumentedNode.WithStatusstatus substatementpublic List<UnknownSchemaNode> getUnknownSchemaNodes()
DocumentedNodegetUnknownSchemaNodes in interface DocumentedNodepublic Set<TypeDefinition<?>> getTypeDefinitions()
DataNodeContainergetTypeDefinitions in interface DataNodeContainerpublic Set<DataSchemaNode> getChildNodes()
DataNodeContainer
Note that the nodes returned are NOT data nodes, but rather DataSchemaNodes,
hence ChoiceSchemaNode and CaseSchemaNode are present instead of their children. This
is consistent with schema tree.
getChildNodes in interface DataNodeContainerpublic Set<GroupingDefinition> getGroupings()
DataNodeContainergetGroupings in interface DataNodeContainerpublic Optional<DataSchemaNode> findDataChildByName(QName name)
DataNodeContainer
Note that the nodes searched are NOT data nodes, but rather DataSchemaNodes,
hence ChoiceSchemaNode and CaseSchemaNode are returned instead of their matching children.
findDataChildByName in interface DataNodeContainername - QName of childpublic Set<UsesNode> getUses()
DataNodeContainergetUses in interface DataNodeContainerpublic boolean isPresenceContainer()
ContainerSchemaNodeisPresenceContainer in interface ContainerSchemaNodepublic Set<AugmentationSchemaNode> getAvailableAugmentations()
AugmentationTargetgetAvailableAugmentations in interface AugmentationTargetCopyright © 2019 OpenDaylight. All rights reserved.