ConfD User Community

Is it possible to generate a skeleton CallBack Function


#1

Hi, is it possible for us to auto generate the Callback JAVA class(in JAVA) from the Yang model.
I know --emit-java creates a java file with Yang but that’s a generic one with the Java objects for the particular yang. But is it possible to generate a skeleton CallBack Function itself with all the GET_ELEM, GET_NEXT methods. So we can only fill in the logic for getting the information from backend application.


#2

I think what you can use pyang and write appropriate plugin that can generate callback source code. On the other hand, I think you will be able to generate only simple skeleton (unless you annotate your YANG files with additional information). It may be easier if you write skeleton code and keep it (e.g. in Wiki) for copy paste. You can adapt code from existing JAVA examples (avail. only in ConfD Premium).