Class DBusTypeStringToJava

java.lang.Object
org.freedesktop.dbus.utils.translator.DBusTypeStringToJava

public final class DBusTypeStringToJava extends 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 Details

  • Constructor Details

    • DBusTypeStringToJava

      private DBusTypeStringToJava()
  • Method Details

    • main

      public static void main(String[] _args) throws DBusException
      Throws:
      DBusException
    • recursive

      private static void recursive(Type _t, int _indent)
    • repeat

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