public final class SchemaUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
belongsToCaseAugment(CaseSchemaNode caseNode,
YangInstanceIdentifier.AugmentationIdentifier childToProcess) |
static Optional<CaseSchemaNode> |
detectCase(ChoiceSchemaNode schema,
DataContainerChild<?,?> child) |
static Collection<SchemaNode> |
findChildSchemaNodesByQName(SchemaNode node,
QName qname)
Find child schema node identified by its QName within a provided schema node.
|
static AugmentationSchemaNode |
findCorrespondingAugment(DataSchemaNode parent,
DataSchemaNode child)
Tries to find in
parent which is dealed as augmentation target node with QName as child . |
static @Nullable SchemaNode |
findDataChildSchemaByQName(SchemaNode node,
QName qname)
Find child data schema node identified by its QName within a provided schema node.
|
static SchemaNode |
findDataParentSchemaOnPath(SchemaContext schemaContext,
SchemaPath path)
Finds schema node for given path in schema context.
|
static Optional<DataSchemaNode> |
findFirstSchema(QName qname,
Iterable<DataSchemaNode> dataSchemaNode)
Find the first schema with specified QName.
|
static Collection<SchemaNode> |
findParentSchemaNodesOnPath(SchemaContext schemaContext,
SchemaPath path)
Finds schema node for given path in schema context.
|
static AugmentationSchemaNode |
findSchemaForAugment(AugmentationTarget schema,
Set<QName> qnames) |
static AugmentationSchemaNode |
findSchemaForAugment(ChoiceSchemaNode schema,
Set<QName> qnames) |
static DataSchemaNode |
findSchemaForChild(ChoiceSchemaNode schema,
QName childPartialQName) |
static DataSchemaNode |
findSchemaForChild(DataNodeContainer schema,
QName qname)
Find child schema node identified by its QName within a provided schema node.
|
static @Nullable DataSchemaNode |
findSchemaForChild(DataNodeContainer schema,
QName qname,
boolean strictMode) |
static DataSchemaNode |
findSchemaForChild(DataNodeContainer schema,
QName qname,
Iterable<DataSchemaNode> childNodes) |
static Set<QName> |
getChildNodesRecursive(DataNodeContainer nodeContainer)
Recursively list all child nodes.
|
static YangInstanceIdentifier.AugmentationIdentifier |
getNodeIdentifierForAugmentation(AugmentationSchemaNode schema)
Deprecated.
|
static Set<DataSchemaNode> |
getRealSchemasForAugment(AugmentationTarget targetSchema,
AugmentationSchemaNode augmentSchema)
Retrieves real schemas for augmented child node.
|
static Set<DataSchemaNode> |
getRealSchemasForAugment(DataNodeContainer targetSchema,
AugmentationSchemaNode augmentSchema) |
static Map<QName,AugmentationSchemaNode> |
mapChildElementsFromAugments(AugmentationTarget schema)
Recursively find all child nodes that come from augmentations.
|
static Map<QName,ChoiceSchemaNode> |
mapChildElementsFromChoices(DataNodeContainer schema)
Recursively find all child nodes that come from choices.
|
public static Optional<DataSchemaNode> findFirstSchema(QName qname, Iterable<DataSchemaNode> dataSchemaNode)
qname
- schema node to finddataSchemaNode
- Iterable of schemaNodes to look throughpublic static DataSchemaNode findSchemaForChild(DataNodeContainer schema, QName qname)
schema
- schema for parent node - search rootqname
- qname(with or without a revision) of a child node to be found in the parent schemaIllegalStateException
- if the child was not found in parent schema nodepublic static @Nullable DataSchemaNode findSchemaForChild(DataNodeContainer schema, QName qname, boolean strictMode)
public static DataSchemaNode findSchemaForChild(DataNodeContainer schema, QName qname, Iterable<DataSchemaNode> childNodes)
public static DataSchemaNode findSchemaForChild(ChoiceSchemaNode schema, QName childPartialQName)
public static AugmentationSchemaNode findSchemaForAugment(AugmentationTarget schema, Set<QName> qnames)
public static AugmentationSchemaNode findSchemaForAugment(ChoiceSchemaNode schema, Set<QName> qnames)
public static Map<QName,ChoiceSchemaNode> mapChildElementsFromChoices(DataNodeContainer schema)
schema
- schemapublic static Map<QName,AugmentationSchemaNode> mapChildElementsFromAugments(AugmentationTarget schema)
schema
- schemapublic static Set<QName> getChildNodesRecursive(DataNodeContainer nodeContainer)
nodeContainer
- node containerpublic static Set<DataSchemaNode> getRealSchemasForAugment(AugmentationTarget targetSchema, AugmentationSchemaNode augmentSchema)
Schema of the same child node from augment, and directly from target is not the same. Schema of child node from augment is incomplete, therefore its useless for XML/NormalizedNode translation.
targetSchema
- target schemaaugmentSchema
- augment schemapublic static Set<DataSchemaNode> getRealSchemasForAugment(DataNodeContainer targetSchema, AugmentationSchemaNode augmentSchema)
public static Optional<CaseSchemaNode> detectCase(ChoiceSchemaNode schema, DataContainerChild<?,?> child)
public static boolean belongsToCaseAugment(CaseSchemaNode caseNode, YangInstanceIdentifier.AugmentationIdentifier childToProcess)
public static AugmentationSchemaNode findCorrespondingAugment(DataSchemaNode parent, DataSchemaNode child)
parent
which is dealed as augmentation target node with QName as child
. If such
node is found then it is returned, else null.parent
- parent nodechild
- child node@Deprecated public static YangInstanceIdentifier.AugmentationIdentifier getNodeIdentifierForAugmentation(AugmentationSchemaNode schema)
DataSchemaContextNode.augmentationIdentifierFrom(AugmentationSchemaNode)
instead.schema
- Augmentation schemaNullPointerException
- if schema
is nullpublic static SchemaNode findDataParentSchemaOnPath(SchemaContext schemaContext, SchemaPath path)
schemaContext
- schema contextpath
- pathpublic static @Nullable SchemaNode findDataChildSchemaByQName(SchemaNode node, QName qname)
node
- schema nodeqname
- QNameIllegalArgumentException
- if the schema node does not allow childrenpublic static Collection<SchemaNode> findParentSchemaNodesOnPath(SchemaContext schemaContext, SchemaPath path)
This method returns collection of SchemaNodes, because name conflicts can occur between the namespace of groupings and namespace of data nodes. This method finds and collects all schema nodes that matches supplied SchemaPath and returns them all as collection of schema nodes.
schemaContext
- schema contextpath
- pathpublic static Collection<SchemaNode> findChildSchemaNodesByQName(SchemaNode node, QName qname)
This method returns collection of SchemaNodes, because name conflicts can occur between the namespace of groupings and namespace of data nodes. This method finds and collects all schema nodes with supplied QName and returns them all as collection of schema nodes.
node
- schema nodeqname
- QNameIllegalArgumentException
- if the schema node does not allow childrenCopyright © 2019 OpenDaylight. All rights reserved.