[YANGTOOLS-36] Add util support for Identity Created: 04/Oct/13  Updated: 10/Apr/22  Resolved: 14/Oct/13

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Christopher Hartley Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC



 Description   

(1) It would be good to have in org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition
to have a method that returns the IdentitySchemaNode, not just the name

(2) it would be good to have in IdentitySchemaNode a method that lets me get all the derived identities.
I need this since the identityRef references the base but I have no links down the identity tree.

for example in this Yang, I would be able to start at hashFunctionLeaf and
getIdentityNode() to get the IdentitySchemaNode.
From the base IdentitySchemaNode I can then recursively call getDerivedIdentities() to get BOB, IPSX and CRC and then from CRC to get CRC-Big and CRC_Small.

leaf hashFunctionLeaf {
type identityref

{ base "hashFunction"; }

identity hashFunction {
}
identity BOB

{ base "hashFunction"; }
identity IPSX { base "hashFunction"; }

identity CRC

{ base "hashFunction"; }

identity CRC_big

{ base "CRC"; }
identity CRC_small { base "CRC"; }

If this is already possible then please let me know how to do it



 Comments   
Comment by Martin Vitez [ 09/Oct/13 ]

Fixed for binding-generator 0.6.0-SNAPSHOT, yang 0.5.9-SNAPSHOT.

https://git.opendaylight.org/gerrit/#/c/1747/

Comment by Martin Vitez [ 09/Oct/13 ]

Marked as RESOLVED by mistake, moving back to CONFIRMED state.

Comment by Martin Vitez [ 10/Oct/13 ]

Implemented in binding-generator 0.6.0-SNAPSHOT, yang 0.5.9-SNAPSHOT.

https://git.opendaylight.org/gerrit/#/c/1778/

Feel free to reopen if you have any thoughts on this issue.

Comment by Christopher Hartley [ 11/Oct/13 ]

Thanks very much for this. Works really well.

Comment by Martin Vitez [ 11/Oct/13 ]

Unfortunatelly, we have to temporary revert some code because of problem in build. This also include this enhancement. It will be available back again during today.

Comment by Martin Vitez [ 14/Oct/13 ]

Fixed in yang parser version 0.5.9-SNAPSHOT.

https://git.opendaylight.org/gerrit/#/c/1865/

Generated at Wed Feb 07 20:52:05 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.