Class StructTreeBuilder


  • public class StructTreeBuilder
    extends Object
    Helper to create a DBus struct class. As Structs are regular classes (POJOs) in Java, this helper also takes care about recursion (Struct in Struct/Map/List).
    Since:
    v3.0.1 - 2018-12-21
    Author:
    hypfvieh
    • Constructor Detail

      • StructTreeBuilder

        public StructTreeBuilder()
    • Method Detail

      • buildStructClasses

        public String buildStructClasses​(String _dbusSig,
                                         String _structName,
                                         ClassBuilderInfo _clzBldr,
                                         List<ClassBuilderInfo> _generatedClasses)
                                  throws DBusException
        Builds the struct(s) found in _dbusSig. If the struct is wrapped in a Collection, it will be unwrapped.

        The resulting String will return the parent class name. This can be the Structs classname or e.g. List/Set class if the struct was wrapped in a Collection.

        Structs which are inside of another struct will get the appendix 'Struct' for each iteration. This may lead to classes with names like FooStructStructStruct (FooStruct->(InnerStruct->InnerInnerStruct)).
        Parameters:
        _dbusSig - dbus Type string
        _structName - name the struct should have
        _clzBldr - class builder with the class where the struct was first seen
        _generatedClasses - a list, this will contain additional struct classes created, if any. Should never be null!
        Returns:
        Struct class name or Collection type name
        Throws:
        DBusException - on DBus Error