StringConditional.fromXMLNode constructor

  1. @override
StringConditional.fromXMLNode(
  1. XMLNode node
)

Implementation

@override
StringConditional.fromXMLNode(XMLNode node)
    : value = node.attributes.entries
          .map((entry) {
            switch (entry.key) {
              case 'equals':
                return StringEquals(entry.value);
              case 'startswith':
                return StringStartsWith(entry.value);
              case 'endswith':
                return StringEndsWith(entry.value);
              default:
                return null;
            }
          })
          .whereType<StringConditionalValue>()
          .toSet(),
      condition = Condition.fromChildrenMap(node.childrenToMap());