public final class SchemaContextUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static SchemaNode |
findDataSchemaNode(SchemaContext context,
Module module,
RevisionAwareXPath nonCondXPath)
Method attempts to find DataSchemaNode inside of provided Schema Context
and Yang Module accordingly to Non-conditional Revision Aware XPath.
|
static SchemaNode |
findDataSchemaNode(SchemaContext context,
SchemaPath schemaPath)
Method attempts to find DataSchemaNode in Schema Context via specified
Schema Path.
|
static SchemaNode |
findDataSchemaNodeForRelativeXPath(SchemaContext context,
Module module,
SchemaNode actualSchemaNode,
RevisionAwareXPath relativeXPath)
Method attempts to find DataSchemaNode inside of provided Schema Context
and Yang Module accordingly to Non-conditional relative Revision Aware
XPath.
|
static SchemaNode |
findNodeInSchemaContext(SchemaContext context,
Iterable<QName> path) |
static Module |
findParentModule(SchemaContext context,
SchemaNode schemaNode)
Returns parent Yang Module for specified Schema Context in which Schema
Node is declared.
|
static TypeDefinition<?> |
getBaseTypeForLeafRef(LeafrefTypeDefinition typeDefinition,
SchemaContext schemaContext,
QName qname)
Returns base type for
typeDefinition which belongs to module specified via qname. |
static TypeDefinition<?> |
getBaseTypeForLeafRef(LeafrefTypeDefinition typeDefinition,
SchemaContext schemaContext,
SchemaNode schema)
Extracts the base type of node on which schema node points to.
|
static Set<SourceIdentifier> |
getConstituentModuleIdentifiers(SchemaContext context)
Extract the identifiers of all modules and submodules which were used to create a particular SchemaContext.
|
static @Nullable NotificationDefinition |
getNotificationSchema(@NonNull SchemaContext schema,
@NonNull SchemaPath path)
Returns NotificationDefinition from Schema Context.
|
static @Nullable ContainerSchemaNode |
getRpcDataSchema(@NonNull SchemaContext schema,
@NonNull SchemaPath path)
Returns RPC Input or Output Data container from RPC definition.
|
public static SchemaNode findDataSchemaNode(SchemaContext context, SchemaPath schemaPath)
null. null values) the method will throw
IllegalArgumentException.context - Schema ContextschemaPath - Schema Path to search fornull
if the Node is not present.IllegalArgumentException - if context or schemaPath is not correct.public static SchemaNode findDataSchemaNode(SchemaContext context, Module module, RevisionAwareXPath nonCondXPath)
null. null references the method will throw
IllegalArgumentException null.context - Schema Contextmodule - Yang ModulenonCondXPath - Non Conditional Revision Aware XPathnull if the
DataSchemaNode is not present in Schema Context.public static SchemaNode findDataSchemaNodeForRelativeXPath(SchemaContext context, Module module, SchemaNode actualSchemaNode, RevisionAwareXPath relativeXPath)
null. null references the method
will throw IllegalArgumentException isAbsolute == false the method will throw
IllegalArgumentException. null.context - Schema Contextmodule - Yang ModuleactualSchemaNode - Actual Schema NoderelativeXPath - Relative Non Conditional Revision Aware XPathnull.public static Module findParentModule(SchemaContext context, SchemaNode schemaNode)
null. null references
the method will throw IllegalArgumentExceptioncontext - Schema ContextschemaNode - Schema Nodenullpublic static SchemaNode findNodeInSchemaContext(SchemaContext context, Iterable<QName> path)
@Beta public static @Nullable NotificationDefinition getNotificationSchema(@NonNull SchemaContext schema, @NonNull SchemaPath path)
schema - SchemaContext in which lookup should be performed.path - Schema Path of notification@Beta public static @Nullable ContainerSchemaNode getRpcDataSchema(@NonNull SchemaContext schema, @NonNull SchemaPath path)
schema - SchemaContext in which lookup should be performed.path - Schema path of RPC input/output data containerpublic static Set<SourceIdentifier> getConstituentModuleIdentifiers(SchemaContext context)
context - SchemaContext to be examinedpublic static TypeDefinition<?> getBaseTypeForLeafRef(LeafrefTypeDefinition typeDefinition, SchemaContext schemaContext, SchemaNode schema)
typeDefinition - type of node which will be extractedschemaContext - Schema Contextschema - Schema Nodepublic static TypeDefinition<?> getBaseTypeForLeafRef(LeafrefTypeDefinition typeDefinition, SchemaContext schemaContext, QName qname)
typeDefinition which belongs to module specified via qname. This handle
the case when leafref type isn't specified as type substatement of leaf or leaf-list but is defined in other
module as typedef which is then imported to referenced module.
Because typeDefinition is definied via typedef statement, only absolute path is meaningful.
Copyright © 2019 OpenDaylight. All rights reserved.