DOMTreeMap<T> class

Represents a mapping tree. Can be used to map a DOMNode to a generated node T, or a node T to a DOMNode.

Constructors

DOMTreeMap(DOMGenerator<T> domGenerator)

Properties

domGenerator DOMGenerator<T>
final
hashCode int
The hash code for this object.
no setterinherited
mappedDOMNodes Iterable<DOMNode>
no setter
mappedElements Iterable<T>
no setter
rootDOMNode DOMNode?
The root DOMNode of this tree.
no setter
rootElement → T?
The root element T of this tree.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asMappedDOMNode(DOMNode? domNode) DOMNode?
Returns domNode or recursively a domNode.parent that is mapped.
asMappedElement(T? element) → T?
Returns element or recursively a element.parent that is mapped.
duplicateByDOMNode(DOMNode? domNode) DOMNodeMapping<T>?
Duplicates domNode in the parent children list. Also performs on mapped element.
duplicateByElement(T? element) DOMNodeMapping<T>?
Duplicates element in the parent children list. Also performs on mapped DOMNode.
emptyByDOMNode(DOMNode? domNode) bool
Empties domNode children nodes. Also performs on mapped element.
emptyByElement(T? element) bool
Empties element children nodes. Also performs on mapped DOMNode.
generate(DOMGenerator<T> domGenerator, DOMNode root, {T? parent, DOMContext<T>? context}) → T?
getMappedDOMNode(T? element, {bool checkParents = false}) DOMNode?
Returns the mapped DOMNode associated with element.
getMappedElement(DOMNode? domNode, {bool checkParents = false}) → T?
Returns the mapped element T associated with domNode.
getRuntimeNode(DOMNode? domNode) DOMNodeRuntime<T>?
Returns a DOMNodeRuntime of domNode.
isMappedDOMNode(DOMNode? domNode) bool
Returns true if domNode is mapped by this instance.
isMappedElement(T? element) bool
Returns true if element is mapped by this instance.
map(DOMNode domNode, T element, {DOMContext<T>? context, bool allowOverwrite = false}) → void
Maps in this instance the pair domNode and element.
mapTree(DOMNode domRoot, T root) bool
matchesMapping(DOMNode domNode, T node) bool
Returns true if the mapping for domNode matches node.
mergeNearNodes(DOMNode domNode1, DOMNode domNode2, {bool onlyCompatibles = false}) DOMNodeMapping<T>?
mergeNearStringNodes(DOMNode domNode1, DOMNode domNode2, {bool onlyCompatibles = false}) DOMNodeMapping<T>?
moveDownByDOMNode(DOMNode? domNode) bool
Moves domNode down in the parent children list. Also performs on mapped element.
moveDownByElement(T? element) bool
Moves element down in the parent children list. Also performs on mapped DOMNode.
moveUpByDOMNode(DOMNode? domNode) bool
Moves domNode up in the parent children list. Also performs on mapped element.
moveUpByElement(T? element) bool
Moves element up in the parent children list. Also performs on mapped DOMNode.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queryElement(String query, {DOMContext? domContext, bool buildTemplates = false}) String?
removeByDOMNode(DOMNode? domNode) DOMNodeMapping<T>?
Removes domNode from parent. Also performs on mapped element.
removeByElement(T? element) DOMNodeMapping<T>?
Removes element from parent. Also performs on mapped DOMNode.
setRoot(DOMNode rootDOMNode, T? rootElement) → void
toString() String
A string representation of this object.
inherited
unmap(DOMNode domNode, T element) bool
Unmap from this instance the pair domNode and element.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

regexpTagClose RegExp
final
regexpTagOpen RegExp
final
regexpTagRef RegExp
final

Static Methods

getElementDOMTreeMap<T>(T? element) DOMTreeMap<T>?
Returns the DOMTreeMap of the element, if it's associated with some DOMElement.