build method

T? build(
  1. DOMElement? domParent,
  2. T? parent,
  3. DOMNode domNode,
  4. DOMTreeMap<T> treeMap,
  5. DOMContext<T>? context,
)

Implementation

T? build(DOMElement? domParent, T? parent, DOMNode domNode,
    DOMTreeMap<T> treeMap, DOMContext<T>? context) {
  if (domParent != null) {
    domNode.parent = domParent;
  }

  if (domNode.isCommented) return null;

  if (domNode is DOMElement) {
    return buildElement(domParent, parent, domNode, treeMap, context);
  } else if (domNode is TextNode) {
    return buildText(domParent, parent, domNode, treeMap);
  } else if (domNode is TemplateNode) {
    return buildTemplate(domParent, parent, domNode, treeMap, context);
  } else if (domNode is ExternalElementNode) {
    return buildExternalElement(domParent, parent, domNode, treeMap, context);
  } else if (domNode is DOMAsync) {
    return buildDOMAsyncElement(domParent, parent, domNode, treeMap, context);
  } else {
    throw StateError("Can't build node of type: ${domNode.runtimeType}");
  }
}