Package org.freedesktop.dbus
Class Marshalling
java.lang.Object
org.freedesktop.dbus.Marshalling
Contains static methods for marshalling values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]convertParameters(Object[] _parameters, Type[] _types, AbstractConnection _conn) Recursively converts types for serialization onto DBus.(package private) static ObjectdeSerializeParameter(Object _parameter, Type _type, AbstractConnection _conn) static Object[]deSerializeParameters(Object[] _parameters, Type[] _types, AbstractConnection _conn) deSerializeParameters(List<Object> _parameters, Type _type, AbstractConnection _conn) static String[]getDBusType(Type _javaType) Will return the DBus type corresponding to the given Java type.static StringgetDBusType(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 intgetJavaType(String _dbusType, List<Type> _resultValue, int _limit) Converts a dbus type string into Java Type objects,private static String[]recursiveGetDBusType(StringBuffer[] _out, Type _dataType, boolean _basic, int _level)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TYPE_CACHE
-
CLASS_TO_ARGUMENTTYPE
-
-
Constructor Details
-
Marshalling
private Marshalling()
-
-
Method Details
-
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.- Parameters:
_javaType- The Java types.- Returns:
- The DBus types.
- Throws:
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.- Parameters:
_javaType- The Java type.- Returns:
- The DBus type.
- Throws:
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.- Parameters:
_dataType- The Java type._basic- If true enforces this to be a non-compound type. (compound types are Maps, Structs and Lists/arrays).- Returns:
- The DBus type.
- Throws:
DBusException- If the given type cannot be converted to a DBus type.
-
recursiveGetDBusType
private static String[] recursiveGetDBusType(StringBuffer[] _out, Type _dataType, boolean _basic, int _level) throws DBusException - Throws:
DBusException
-
getJavaType
public static int getJavaType(String _dbusType, List<Type> _resultValue, int _limit) throws DBusException Converts a dbus type string into Java Type objects,- Parameters:
_dbusType- The DBus type or types._resultValue- List to return the types in._limit- Maximum number of types to parse (-1 == nolimit).- Returns:
- number of characters parsed from the type string.
- Throws:
DBusException- on error
-
convertParameters
public static Object[] convertParameters(Object[] _parameters, Type[] _types, AbstractConnection _conn) throws DBusException Recursively converts types for serialization onto DBus.- Parameters:
_parameters- The parameters to convert._types- The (possibly generic) types of the parameters._conn- the connection- Returns:
- The converted parameters.
- Throws:
DBusException- Thrown if there is an error in converting the objects.
-
deSerializeParameter
static Object deSerializeParameter(Object _parameter, Type _type, AbstractConnection _conn) throws Exception - Throws:
Exception
-
deSerializeParameters
static List<Object> deSerializeParameters(List<Object> _parameters, Type _type, AbstractConnection _conn) throws Exception - Throws:
Exception
-
deSerializeParameters
public static Object[] deSerializeParameters(Object[] _parameters, Type[] _types, AbstractConnection _conn) throws Exception - Throws:
Exception
-