java.lang.Object
org.freedesktop.dbus.Marshalling
Contains static methods for marshalling values.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic String
convertJavaClassesToSignature
(Class<?>... _javaType) Will return the DBus type corresponding to the given Java type.static Object[]
convertParameters
(Object[] _parameters, Type[] _types, String[] _customSignatures, AbstractConnectionBase _conn) Recursively converts types for serialization onto DBus.
When _customSignature is not empty or null, it will be used to wrap the given parameters to aVariant
of the type defined in the _customSignature array.
It is required that everyVariant
passed has a signature definition in _customSignature.
E.g. 3 Objects are given in _parameters: String, Variant, Variant.
Then it is expected that _customSignature (if used) contains 2 entries one for eachVariant
.
If the _customSignature is smaller than the count ofVariant
s in _parameters, all remainingVariant
s
are created without a explicit signature (Variant constructor will try to determine type automatically).
If more entries are given thenVariant
s found in _parameters, the additional signatures are ignored.static Object[]
convertParameters
(Object[] _parameters, Type[] _types, AbstractConnectionBase _conn) Recursively converts types for serialization onto DBus.static Object[]
deSerializeParameters
(Object[] _parameters, Type[] _types, AbstractConnectionBase _conn) static String[]
getDBusType
(Type _javaType) Will return the DBus type corresponding to the given Java type.static String
getDBusType
(Type[] _javaType) Will return the DBus type corresponding to the given Java type.static String[]
getDBusType
(Type _dataType, boolean _basic) Will return the DBus type corresponding to the given Java type.static int
getJavaType
(String _dbusType, List<Type> _resultValue, int _limit) Converts a dbus type string into Java Type objects,
-
Methodendetails
-
getDBusType
Will return the DBus type corresponding to the given Java type. Note, container type should have their ParameterizedType not their Class passed in here.- Parameter:
_javaType
- The Java types.- Gibt zurück:
- The DBus types.
- Löst aus:
DBusException
-
convertJavaClassesToSignature
public static String convertJavaClassesToSignature(Class<?>... _javaType) throws DBusTypeConversationRuntimeException Will return the DBus type corresponding to the given Java type. Note, container type should have their ParameterizedType not their Class passed in here.- Parameter:
_javaType
- The Java types.- Gibt zurück:
- The DBus types
- Löst aus:
DBusTypeConversationRuntimeException
- when conversation fails- Seit:
- 5.1.0 - 2024-05-19
-
getDBusType
Will return the DBus type corresponding to the given Java type. Note, container type should have their ParameterizedType not their Class passed in here.- Parameter:
_javaType
- The Java type.- Gibt zurück:
- The DBus type.
- Löst aus:
DBusException
- If the given type cannot be converted to a DBus type.
-
getDBusType
Will return the DBus type corresponding to the given Java type. Note, container type should have their ParameterizedType not their Class passed in here.- Parameter:
_dataType
- The Java type._basic
- If true enforces this to be a non-compound type. (compound types are Maps, Structs and Lists/arrays).- Gibt zurück:
- The DBus type.
- Löst aus:
DBusException
- If the given type cannot be converted to a DBus type.
-
getJavaType
public static int getJavaType(String _dbusType, List<Type> _resultValue, int _limit) throws DBusException Converts a dbus type string into Java Type objects,- Parameter:
_dbusType
- The DBus type or types._resultValue
- List to return the types in._limit
- Maximum number of types to parse (-1 == nolimit).- Gibt zurück:
- number of characters parsed from the type string.
- Löst aus:
DBusException
- on error
-
convertParameters
public static Object[] convertParameters(Object[] _parameters, Type[] _types, String[] _customSignatures, AbstractConnectionBase _conn) throws DBusException Recursively converts types for serialization onto DBus.
When _customSignature is not empty or null, it will be used to wrap the given parameters to aVariant
of the type defined in the _customSignature array.
It is required that everyVariant
passed has a signature definition in _customSignature.
E.g. 3 Objects are given in _parameters: String, Variant, Variant.
Then it is expected that _customSignature (if used) contains 2 entries one for eachVariant
.
If the _customSignature is smaller than the count ofVariant
s in _parameters, all remainingVariant
s
are created without a explicit signature (Variant constructor will try to determine type automatically).
If more entries are given thenVariant
s found in _parameters, the additional signatures are ignored.- Parameter:
_parameters
- The parameters to convert._types
- The (possibly generic) types of the parameters._customSignatures
- custom signatures used for variants found in _types, each found variant must have one matching custom signature_conn
- the connection- Gibt zurück:
- The converted parameters.
- Löst aus:
DBusException
- Thrown if there is an error in converting the objects.
-
convertParameters
public static Object[] convertParameters(Object[] _parameters, Type[] _types, AbstractConnectionBase _conn) throws DBusException Recursively converts types for serialization onto DBus.- Parameter:
_parameters
- The parameters to convert._types
- The (possibly generic) types of the parameters._conn
- the connection- Gibt zurück:
- The converted parameters.
- Löst aus:
DBusException
- Thrown if there is an error in converting the objects.
-
deSerializeParameters
public static Object[] deSerializeParameters(Object[] _parameters, Type[] _types, AbstractConnectionBase _conn) throws Exception - Löst aus:
Exception
-