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 NotificationDefinition |
getNotificationSchema(SchemaContext schema,
SchemaPath path)
Returns NotificationDefinition from Schema Context.
|
static ContainerSchemaNode |
getRpcDataSchema(SchemaContext schema,
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 Nodenull
public static SchemaNode findNodeInSchemaContext(SchemaContext context, Iterable<QName> path)
@Beta @Nullable public static NotificationDefinition getNotificationSchema(@Nonnull SchemaContext schema, @Nonnull SchemaPath path)
schema
- SchemaContext in which lookup should be performed.path
- Schema Path of notification@Beta @Nullable public static 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 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 © 2018 OpenDaylight. All rights reserved.