public final class SchemaContextUtil extends Object
Modifier and Type | Method and Description |
---|---|
static SchemaNode |
findDataSchemaNode(SchemaContext context,
List<QName> path)
Attempt to find a DataSchemaNode based on its path from root, similar to
findDataSchemaNode(SchemaContext, Module, PathExpression) without requiring an expression. |
static SchemaNode |
findDataSchemaNode(SchemaContext context,
Module module,
PathExpression nonCondXPath)
|
static SchemaNode |
findDataSchemaNode(SchemaContext context,
QName... path)
Attempt to find a DataSchemaNode based on its path from root, similar to
findDataSchemaNode(SchemaContext, Module, PathExpression) without requiring an expression. |
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,
PathExpression relativeXPath)
Method attempts to find DataSchemaNode inside of provided Schema Context
and Yang Module accordingly to Non-conditional relative Revision Aware
XPath.
|
static SchemaNode |
findDataTreeSchemaNode(SchemaContext ctx,
QNameModule localModule,
PathExpression absPath) |
static SchemaNode |
findDataTreeSchemaNode(SchemaContext ctx,
QNameModule localModule,
YangLocationPath absPath) |
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
.
In case that Schema Context or Schema Path are not specified correctly (i.e. contains null
values) the
method will throw IllegalArgumentException.
context
- Schema ContextschemaPath
- Schema Path to search fornull
if the Node is not present.NullPointerException
- if context or schemaPath is null@Beta public static SchemaNode findDataSchemaNode(SchemaContext context, List<QName> path)
findDataSchemaNode(SchemaContext, Module, PathExpression)
without requiring an expression.context
- Schema Contextpath
- Path to search fornull
if the Node is not present.NullPointerException
- if a any argument is null or if the path contains a null element@Beta public static SchemaNode findDataSchemaNode(SchemaContext context, QName... path)
findDataSchemaNode(SchemaContext, Module, PathExpression)
without requiring an expression.context
- Schema Contextpath
- Path to search fornull
if the Node is not present.NullPointerException
- if a any argument is null or if the path contains a null element@Deprecated public static SchemaNode findDataSchemaNode(SchemaContext context, Module module, PathExpression nonCondXPath)
findDataTreeSchemaNode(SchemaContext, QNameModule, YangLocationPath)
or
findDataTreeSchemaNode(SchemaContext, QNameModule, PathExpression)
instead.null
. null
.context
- Schema Contextmodule
- Yang ModulenonCondXPath
- Non Conditional Revision Aware XPathnull
if the
DataSchemaNode is not present in Schema Context.NullPointerException
- if any of the arguments is null@Beta public static SchemaNode findDataTreeSchemaNode(SchemaContext ctx, QNameModule localModule, YangLocationPath absPath)
@Beta public static SchemaNode findDataTreeSchemaNode(SchemaContext ctx, QNameModule localModule, PathExpression absPath)
public static SchemaNode findDataSchemaNodeForRelativeXPath(SchemaContext context, Module module, SchemaNode actualSchemaNode, PathExpression relativeXPath)
null
. isAbsolute == false
the method will throw
IllegalArgumentException. null
.context
- Schema Contextmodule
- Yang ModuleactualSchemaNode
- Actual Schema NoderelativeXPath
- Relative Non Conditional Revision Aware XPathnull
.NullPointerException
- if any argument is nullpublic static Module findParentModule(SchemaContext context, SchemaNode schemaNode)
null
.context
- Schema ContextschemaNode
- Schema Nodenull
NullPointerException
- if any of the arguments is nullpublic 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 © 2020 OpenDaylight. All rights reserved.