Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-44

Autoboxing support

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Low Low
    • 14.0.0
    • None
    • Binding codegen
    • Operating System: All
      Platform: All

      In situations where we have a containing element which has as its child a single container, we should make it easy to autobox it.

      Example: 

      choice ch {
        case foo-case {
          container foo {
            ...
          }
      
        }
      }
      

      foo-case contains a single container, foo. We should add an interface to Foo AutoBoxAble<FooCase>, and provide it a method

      class Foo {
        ...
      
        public FooCase autoBox() {
         // wraps Foo in FooCase and returns it
        }
      }
       
      

      The same can also be done for containers:

      container bar-container {
        container bar {
           ...
        }
      }
      
      public class Bar {
        public BarContainer autoBox();
      }
      

       and lists

      list baz-entry { container baz { ... } }
      
      public class Baz { public BazEntry autoBox(); }

      Note, this would be done only in the case where there was only where there is a single container child.

            SamoSchneider Samuel Schneider
            hagbard Ed Warnicke
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: