...
This is the kind of object (module) that gets created:
Generated Java Object Structures per Yang concept
Object Structure
The SchemaContext
object generated by the Yang Parser in java has the following possible structures (java collections)
Gliffy macroId 8eafa348-6609-4eae-a733-beb5a2766488 name Yang Parser Java Object View pagePin 45
SchemaTree
are is implemented as a Map <QNamea ImmutableMap<QName, SchemaTreeEffectiveStatement<?
extends LeafStatement>>>
The Class DataSchemaNode SchemaTree
can represent a tree of any Yang Leaf, List or ContainerThe interface LeafStatement provides . All leafs implement the LeafStatement
interface which provides methods for the many Yang Language features including
getType()
getUnits()
getMandatory()
getWhenStatement()
getMustStatments()
Main data types
The package orgpackage org.opendaylight.yangtools.yang.model.util.type
contains classes for all the possible data types including:
...
- BaseEmptyType
- BaseIdentityrefType
- BaseInstanceIdentifierType
- BaseLeafrefType
- BaseUnionType
And also 'restricted' versions of the base types such as:
- RestrictedStringType
- RestrictedUint64Type
Description | Yang | Java Object View | Notes | XML Validation | JSON | |
---|---|---|---|---|---|---|
Datatypes and basic constraints | ||||||
Basic String |
| TypeStatement TypeAwareDeclaredStatement.getType() | Yes | Yes | ||
Mandatory Basic String |
|
| No | No | ||
Limited String | leaf pnf-name { type string { length "0..256"; } |
| Yes | Yes | ||
typedef (String) with pattern |
| List<PatternConstraint> RestrictedStringType.getPatternConstraints() | Yes | Yes | ||
Limited uint64 | leaf cid {325px400 type uint64 { range "0..503"; } } | org.opendaylight.yangtools.yang.model.util.type.RestrictedUint64Type | Yes | Yes | ||
boolean with default value |
| org.opendaylight.yangtools.yang.model.util.type.DerivedBooleanType | N/A | N/A | ||
Unique | ||||||
Unique | list server { key "name"; unique "ip port"; leaf name { type string; } leaf ip { type dotted-quad; } leaf port { type uint32; } } | org.opendaylight.yangtools.yang.model.api.stmt.UniqueStatement | No | No | ||
Choice | ||||||
Choice | choice transfer-method { leaf transfer-interval { type uint64 { range "15..2880"; } units minutes; } leaf transfer-on-commit { type empty; } } | org.opendaylight.yangtools.yang.model.api.stmt.ChoiceStatement | N/A | N/A | ||
Must | ||||||
Must | leaf ifType { type enumeration { enum ethernet; enum atm; } } leaf ifMTU { type uint32; } must "ifType != 'ethernet' or " + "(ifType = 'ethernet' and ifMTU = 1500)" error-message 466px"An ethernet MTU must be 1500"; } | org.opendaylight.yangtools.yang.model.api.stmt.ErrorMessageStatement | No | No | ||
When | ||||||
When | leaf a { type boolean; } leaf b { type string; when "../a = 'true'"; } | org.opendaylight.yangtools.yang.model.api.stmt.WhenStatement | No | No | ||
Extension | ||||||
Extension declaration |
| N/A | ||||
Extension usage | leaf attribute-with-temporal-storage { type string; cm-notify-api:store-state-ext "3 d"; } | extension is stored as 'UnknownNode' and refers back to the extension declaration | N/A | |||
Augmentation | ||||||
augment "server" { when "port = '8787'"; leaf enable-debug { type boolean; } } | N/A | |||||
RPC | ||||||
rpc | rpc nbrlist-change-notification { | N/A | ||||
rpc input | input { in a neighbor list for this fap service"; } | N/A | ||||
rpc output | output { | N/A |
...