DOMTraversal Class Reference
List of all members.Detailed Description
Encapsulates the logic of walking the DOM tree. The traversal sends messages to a delegate for each node in the tree.
See the documentation for setDelegate: for more info on how the delegate should be set up.
Public Member Functions |
|
| (id) | initWithContextNode: |
| (void) | setDelegate: |
| (void) | setUserInfo: |
| (void) | start |
Static Public Member Functions |
|
| (void) | startTraversalForContextNode:delegate:userInfo: |
Protected Attributes |
|
| id< DOMNode > | contextNode |
| id | delegate |
| id | userInfo |
Member Function Documentation
|
|
|
|
|
Set the delegate that will recieve messages during the traversal. The delgate should respond to any combination of these messages:
The first argument is a node (id < DOMNode >), the user info argument is a generic object pointer (id). The return type is void. Don't implement both visitNode:userInfo: and preorderVisitNode:userInfo:, that would be bad and confusing. You can see visitNode:userInfo: as an alias for preorderVisitNode:userInfo: that can be used when you only want to recieve messages before children are traversed, and would like a shorter and slightly more appropriate name for the delegate method. visitNode:userInfo: will NOT be called if the delegate responds to preorderVisitNode:userInfo:. |
|
|
The user info pointer will be sent to the delegate for each visited node. |
|
|
Starts the traversal. |
|
||||||||||||||||
|
Convenience method for creating the traversal object, setting context node, delegate and user info object and starting the traversal. |
Member Data Documentation
|
|
|
|
|
|
|
|
|