DBusIntrospectMethod.fromXml constructor

DBusIntrospectMethod.fromXml(
  1. XmlNode node
)

Implementation

factory DBusIntrospectMethod.fromXml(XmlNode node) {
  var name = node.getAttribute('name');
  if (name == null) {
    throw FormatException('D-Bus Introspection XML missing method name');
  }
  var args = node
      .findElements('arg')
      .map(
          (n) => DBusIntrospectArgument.fromXml(n, DBusArgumentDirection.in_))
      .toList();
  var annotations = node
      .findElements('annotation')
      .map((n) => DBusIntrospectAnnotation.fromXml(n))
      .toList();
  return DBusIntrospectMethod(name, args: args, annotations: annotations);
}