Class NodeVisitor
java.lang.Object
com.northconcepts.datapipeline.core.NodeVisitor
- All Implemented Interfaces:
INodeVisitor
Base
INodeVisitor whose callbacks do nothing; override only the ones you need and walk a tree with visit(Node, INodeVisitor).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendArray(ArrayValue array) Called after all of the array's elements have been visited.voidendArrayValue(ArrayValue array, int index, ValueNode<?> value) Called after the element at the given 0-based index has been visited.voidCalled last for a field, afterINodeVisitor.endFieldValue(Field, ValueNode).voidendFieldValue(Field field, ValueNode<?> value) Called after the field's value node has been visited.voidCalled after all of the record's fields have been visited.voidsingleValue(SingleValue value) Called for each single (leaf) value; it has no matching end callback.voidstartArray(ArrayValue array) Called before the array's elements are visited.voidstartArrayValue(ArrayValue array, int index, ValueNode<?> value) Called before the element at the given 0-based index is visited.voidstartField(Field field) Called when a field is reached, beforeINodeVisitor.startFieldValue(Field, ValueNode).voidstartFieldValue(Field field, ValueNode<?> value) Called before the field's value node is visited.voidstartRecord(Record record) Called before the record's fields are visited.static voidvisit(Node node, INodeVisitor visitor) Walks the node and its descendants depth-first, calling the visitor's callbacks; does nothing for a null node and rethrows failures as aDataException.
-
Constructor Details
-
NodeVisitor
public NodeVisitor()
-
-
Method Details
-
startRecord
Description copied from interface:INodeVisitorCalled before the record's fields are visited.- Specified by:
startRecordin interfaceINodeVisitor- Throws:
Throwable
-
endRecord
Description copied from interface:INodeVisitorCalled after all of the record's fields have been visited.- Specified by:
endRecordin interfaceINodeVisitor- Throws:
Throwable
-
startField
Description copied from interface:INodeVisitorCalled when a field is reached, beforeINodeVisitor.startFieldValue(Field, ValueNode).- Specified by:
startFieldin interfaceINodeVisitor- Throws:
Throwable
-
endField
Description copied from interface:INodeVisitorCalled last for a field, afterINodeVisitor.endFieldValue(Field, ValueNode).- Specified by:
endFieldin interfaceINodeVisitor- Throws:
Throwable
-
startFieldValue
Description copied from interface:INodeVisitorCalled before the field's value node is visited.- Specified by:
startFieldValuein interfaceINodeVisitor- Throws:
Throwable
-
endFieldValue
Description copied from interface:INodeVisitorCalled after the field's value node has been visited.- Specified by:
endFieldValuein interfaceINodeVisitor- Throws:
Throwable
-
startArray
Description copied from interface:INodeVisitorCalled before the array's elements are visited.- Specified by:
startArrayin interfaceINodeVisitor- Throws:
Throwable
-
endArray
Description copied from interface:INodeVisitorCalled after all of the array's elements have been visited.- Specified by:
endArrayin interfaceINodeVisitor- Throws:
Throwable
-
startArrayValue
Description copied from interface:INodeVisitorCalled before the element at the given 0-based index is visited.- Specified by:
startArrayValuein interfaceINodeVisitor- Throws:
Throwable
-
endArrayValue
Description copied from interface:INodeVisitorCalled after the element at the given 0-based index has been visited.- Specified by:
endArrayValuein interfaceINodeVisitor- Throws:
Throwable
-
singleValue
Description copied from interface:INodeVisitorCalled for each single (leaf) value; it has no matching end callback.- Specified by:
singleValuein interfaceINodeVisitor- Throws:
Throwable
-
visit
Walks the node and its descendants depth-first, calling the visitor's callbacks; does nothing for a null node and rethrows failures as aDataException.
-