- added examples
Change-Id: I3ab803f2cf7a53e20edcda601ed6bcc9c0a69ed2
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
=== `container` Statement
=== `container` Statement
+Builders will be located in package "dto"
+
+
+[source,yang]
+----
+container foo {
+}
+
+container foo-builder {
+}
+----
+
+[uml, file="container-builder.png"]
+--
+set namespaceSeparator none
+
+interface data.Foo {
+}
+
+interface data.FooBuilder {
+}
+--
+
+In situations where we have a containing element which has as its child a single container, we should make it easy to autobox it. This should not be implemented in the interfaces themselves, but rather should be a method in the associated builder.
+
+[source,yang]
+----
+container example-outter {
+ container example-inner {
+ leaf example {
+ type string;
+ }
+ }
+}
+----
+
=== `list` Statement
==== Keyed List
=== `list` Statement
==== Keyed List
+[source,yang]
+----
+list foo {
+ key identifier;
+ leaf identifier {
+ type union {
+ type string;
+ }
+ }
+}
+----
+
+[uml, file="list-Keyed.png"]
+--
+set namespaceSeparator none
+
+interface data.Foo {
+}
+
+interface key.foo.FooIdentifier {
+}
+
+interface type.foo.identifier.IdentifierUnion {
+}
+
+data.Foo o- key.foo.FooIdentifier
+key.foo.FooIdentifier o- type.foo.identifier.IdentifierUnion
+--
+
==== List without Key
=== `choice` Statement
==== List without Key
=== `choice` Statement
+[uml, file="case.png"]
+--
set namespaceSeparator none
package spec {
set namespaceSeparator none
package spec {
data.Top o- data.top.Base
data.top.base.Foo o- data.top.base.foo.Foo
data.Top o- data.top.Base
data.top.base.Foo o- data.top.base.foo.Foo
with signature `public grp.simple.FooData getFoo();`
<3> Is represented by getter in `grp.SimpleGrouping` with signature `public String getBar()`
with signature `public grp.simple.FooData getFoo();`
<3> Is represented by getter in `grp.SimpleGrouping` with signature `public String getBar()`
+[uml, file="grouping1.png"]
+--
interface grp.SimpleGrouping {
+ getBar() : String
+ getFoo() : grp.simple.FooData
}
interface grp.simple.FooData
grp.SimpleGrouping o- grp.simple.FooData
interface grp.SimpleGrouping {
+ getBar() : String
+ getFoo() : grp.simple.FooData
}
interface grp.simple.FooData
grp.SimpleGrouping o- grp.simple.FooData
====
==== Data Node substatements
====
==== Data Node substatements
+[uml, file="grouping2.png"]
+--
set namespaceSeparator none
interface grp.SimpleGrouping {
set namespaceSeparator none
interface grp.SimpleGrouping {
data.Top o-- data.top.Foo
data.Top -|> grp.SimpleGrouping
data.top.Foo -|> grp.simple.FooData
data.Top o-- data.top.Foo
data.Top -|> grp.SimpleGrouping
data.top.Foo -|> grp.simple.FooData
-NOTE: Diagram does not show all details for `data.Top` and `data.top.Foo`, which
+NOTE: Diagram does not show all details for `data.Top` and `data.top.Foo`, which
are based on <<instantiated-data-tree-rules>>
====
are based on <<instantiated-data-tree-rules>>
====
+[uml, file="grouping3.png"]
+--
set namespaceSeparator none
interface grp.withinner.inner.ContData
set namespaceSeparator none
interface grp.withinner.inner.ContData
grp.withinner.ContData -|> grp.withinner.inner.ContData : is concretization of (implements)
grp.withinner.ContData -|> grp.withinner.inner.ContData : is concretization of (implements)
NOTE: Diagram does not show all details for `data.Top` and `data.top.Cont`, which
are based on <<instantiated-data-tree-rules>>
NOTE: Diagram does not show all details for `data.Top` and `data.top.Cont`, which
are based on <<instantiated-data-tree-rules>>
+[uml, file="grouping4.png"]
+--
set namespaceSeparator none
interface data.Top
set namespaceSeparator none
interface data.Top
data.Top -|> grp.ExampleGrouping
data.top.Nested -|> grp.example.NestedData
data.Top -|> grp.ExampleGrouping
data.top.Nested -|> grp.example.NestedData
NOTE: Diagram does not show all details for `data.Top`, `data.top.Nested` and
`data.top.nested.Bar`, which are based on <<instantiated-data-tree-rules>>
NOTE: Diagram does not show all details for `data.Top`, `data.top.Nested` and
`data.top.nested.Bar`, which are based on <<instantiated-data-tree-rules>>
+[uml, file="grouping5.png"]
+--
set namespaceSeparator none
interface grp.TopGrouping
set namespaceSeparator none
interface grp.TopGrouping
grp.TopGrouping -|> grp.ExampleGrouping
grp.top.NestedData -|> grp.example.NestedData
grp.TopGrouping -|> grp.ExampleGrouping
grp.top.NestedData -|> grp.example.NestedData
-.Java representation for both variants
+.Same module written with grouping
+----
+grouping a {
+ container foo {
+ }
+}
+
+container top {
+ uses a;
+}
+
+----
+Java representation for all variants
+[uml, file="augment1.png"]
+--
set namespaceSeparator none
interface data.Top
interface data.top.Foo
data.Top o- data.top.Foo
set namespaceSeparator none
interface data.Top
interface data.top.Foo
data.Top o- data.top.Foo
+[uml,file="augment2.png"]
+--
set namespaceSeparator none
interface Augmentable<T>
set namespaceSeparator none
interface Augmentable<T>
foo.data.FooTop -u-|> Augmentation : T = top.data.Top
top.data.Top o-- foo.data.FooTop
foo.data.FooTop o-- foo.data.top.Bar
foo.data.FooTop -u-|> Augmentation : T = top.data.Top
top.data.Top o-- foo.data.FooTop
foo.data.FooTop o-- foo.data.top.Bar
+[uml,file="augment3.png"]
+--
set namespaceSeparator none
interface Augmentable<T>
set namespaceSeparator none
interface Augmentable<T>
top.data.Top o-- foo.data.FooTop
foo.data.FooTop o-- foo.data.top.Bar
foo.data.FooTop o-- foo.data.top.Baz
top.data.Top o-- foo.data.FooTop
foo.data.FooTop o-- foo.data.top.Bar
foo.data.FooTop o-- foo.data.top.Baz
+[uml, file="augment4.png"]
+--
set namespaceSeparator none
interface Augmentable<T>
set namespaceSeparator none
interface Augmentable<T>
foo.data.FooFirst o-- foo.data.first.Bar
foo.data.FooSecond o-- foo.data.second.Baz
foo.data.FooFirst o-- foo.data.first.Bar
foo.data.FooSecond o-- foo.data.second.Baz
+[source,yang]
+----
+grouping nodes {
+ list node {
+ key id;
+ leaf id {
+ type string;
+ }
+ }
+}
+
+----
+grouping key.grp.nodes.node.nodeidentifier
+
+instantiated key.data.nodes.node.nodeidentifier
\ No newline at end of file