AtomLink.parse constructor

AtomLink.parse(
  1. XmlElement element
)

Implementation

factory AtomLink.parse(XmlElement element) {
  final href = element.getAttribute('href');
  final rel = element.getAttribute('rel');
  final type = element.getAttribute('type');
  final title = element.getAttribute('title');
  final hreflang = element.getAttribute('hreflang');
  var length = 0;
  final lengthElement = element.getAttribute('length');
  if (lengthElement != null) {
    length = int.tryParse(lengthElement) ?? 0;
  }

  return AtomLink(href, rel, type, hreflang, title, length);
}