Interface ElementVisitor
public interface ElementVisitor
A visitor for elements. The visitor can for example be responsible to import all the visited elements into an
underlying implementation of a document type.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvisitArray(@NonNull ArrayElement entry) Starts the visit of an array element.voidvisitEnd()Called when the end of visit for this visitor is reached.voidvisitNull(@NonNull NullElement entry) Visits a null element.visitObject(@NonNull ObjectElement entry) Starts the visit of an object element.voidVisits a primitive element.
-
Method Details
-
visitEnd
void visitEnd()Called when the end of visit for this visitor is reached. That can for example be when all elements of an array element were processed. -
visitNull
Visits a null element.- Parameters:
entry- the null element to visit.- Throws:
NullPointerException- if the given entry is null.
-
visitPrimitive
Visits a primitive element.- Parameters:
entry- the primitive element to visit.- Throws:
NullPointerException- if the given entry is null.
-
visitArray
Starts the visit of an array element. The returned element visitor is used to visit each entry of the array.- Parameters:
entry- the array element to visit.- Returns:
- the visitor to apply to all array entries.
- Throws:
NullPointerException- if the given entry is null.
-
visitObject
Starts the visit of an object element. The returned element visitor is used to visit each key-value mapping of the object.- Parameters:
entry- the object element to visit.- Returns:
- the visitor to apply to all object key-value mappings.
- Throws:
NullPointerException- if the given entry is null.
-