Class DBusTypeStringToJava


  • public final class DBusTypeStringToJava
    extends java.lang.Object
    Reads a DBus signature string and converts it to java classes tree.
    Uses a DBus signature string like "a(ia{sv})" and converts it something like:
     java.util.List
        org.freedesktop.dbus.Struct
              java.lang.Integer
              java.util.Map
                    java.lang.String
                    org.freedesktop.dbus.types.Variant
     
    Each indent step represents another step in the hierarchy.
    Classes listed in the same indent level are part of the same structure (e.g. Map, Struct).

    In the example above, the signature was translated to a List of Struct where the Struct has an Integer and a Map member. The Map consists of a CharSequence/String as key and a Variant as value.

    Call the static main of this class with the signature which should be translated as first argument.

    Since:
    v3.3.0 - 2020-12-28
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String INDENT  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] _args)  
      private static void recursive​(java.lang.reflect.Type _t, int _indent)  
      private static java.lang.String repeat​(java.lang.String _string, int _cnt)
      Repeat the given String given count times.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DBusTypeStringToJava

        private DBusTypeStringToJava()
    • Method Detail

      • recursive

        private static void recursive​(java.lang.reflect.Type _t,
                                      int _indent)
      • repeat

        private static java.lang.String repeat​(java.lang.String _string,
                                               int _cnt)
        Repeat the given String given count times.
        Parameters:
        _string - string to repeat
        _cnt - count
        Returns:
        repeated string