Class ObjectGraphScanner
java.lang.Object
de.xima.fc.helper.ObjectGraphScanner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalsoExcludeClasses(Predicate<Class<?>> additionalPredicate) disallowedModifiers(int disallowedModifiers) evaluationContext(Object context) Sets the context object that is made available via thecontextvariable when evaluating expressions such asApplicableIf.evaluator(IElEvaluator evaluator) Sets theElEvaluatorsto use for evaluating conditions such asApplicableIf.excludedClasses(Predicate<Class<?>> excludedClasses) By default, an exception is thrown when circular references are encountered.By default, conditions such asApplicableIfare evaluated.ignoreConditions(boolean ignoreConditions) By default, conditions such asApplicableIfare evaluated.By default,IObjectGraphVisitor.visitClassField(Object, Field, ObjectGraphValues)is called whenever a class field is encountered.By default,IObjectGraphVisitor.visitListItem(Object, int, List)is called whenever a list item is encountered.By default,IObjectGraphVisitor.visitMapItem(Object, Object, Map)is called whenever a map item is encountered.By default,IObjectGraphVisitor.visitSetItem(Object, Set)is called whenever a set item is encountered.voidvisit(Object value, IObjectGraphVisitor visitor) Visits each field, list item, and map item of the given object (excluding the object itself), according to the current configuration.By default,IObjectGraphVisitor.visitMapItem(Object, Object, Map)is not called when the map key isnull.By default, visitor methods are not called when the value isnull.
-
Constructor Details
-
ObjectGraphScanner
public ObjectGraphScanner()
-
-
Method Details
-
alsoExcludeClasses
@CanIgnoreReturnValue public ObjectGraphScanner alsoExcludeClasses(Predicate<Class<?>> additionalPredicate) - Parameters:
additionalPredicate- Additional classes in additional to the current ones that should be considered primitives. Traversal will never recurse into these classes. By default,java.*classes andIObjectReferenceare excluded.- Returns:
- This scanner for chaining configuration calls.
-
disallowedModifiers
- Parameters:
disallowedModifiers- Modifiers that when present on a class field, the field is skipped and neither the field nor its children are visited. Defaults toModifier.FINAL | Modifier.STATIC | Modifier.TRANSIENT.- Returns:
- This scanner for chaining configuration calls.
-
evaluationContext
Sets the context object that is made available via thecontextvariable when evaluating expressions such asApplicableIf.- Parameters:
context- The context object. If null, an empty object is used.- Returns:
- This scanner for chaining configuration calls.
-
evaluator
Sets theElEvaluatorsto use for evaluating conditions such asApplicableIf. If not set, a default evaluator is used.- Parameters:
evaluator- The evaluator to use.- Returns:
- This scanner for chaining configuration calls.
-
excludedClasses
@CanIgnoreReturnValue public ObjectGraphScanner excludedClasses(Predicate<Class<?>> excludedClasses) - Parameters:
excludedClasses- Classes that should be considered primitives. Traversal will never recurse into these classes. By default,java.*classes andIObjectReferenceare excluded.- Returns:
- This scanner for chaining configuration calls.
-
ignoreCircularReferences
By default, an exception is thrown when circular references are encountered. Call this method to silently ignore circular references as ifEObjectGraphVisitResult.REJECThad been returned.- Returns:
- This scanner for chaining configuration calls.
-
ignoreConditions
By default, conditions such asApplicableIfare evaluated. When this is set to true, such conditions are skipped.- Returns:
- This scanner for chaining configuration calls.
-
ignoreConditions
By default, conditions such asApplicableIfare evaluated. When this is set to true, such conditions are skipped.- Parameters:
ignoreConditions- If true, conditions are ignored and not evaluated.- Returns:
- This scanner for chaining configuration calls.
-
skipClassFields
By default,IObjectGraphVisitor.visitClassField(Object, Field, ObjectGraphValues)is called whenever a class field is encountered. When this is set, class fields are skipped.- Returns:
- This scanner for chaining configuration calls.
-
skipListItems
By default,IObjectGraphVisitor.visitListItem(Object, int, List)is called whenever a list item is encountered. When this is set, list items are skipped.- Returns:
- This scanner for chaining configuration calls.
-
skipMapItems
By default,IObjectGraphVisitor.visitMapItem(Object, Object, Map)is called whenever a map item is encountered. When this is set, map items are skipped.- Returns:
- This scanner for chaining configuration calls.
-
skipSetItems
By default,IObjectGraphVisitor.visitSetItem(Object, Set)is called whenever a set item is encountered. When this is set, set items are skipped.- Returns:
- This scanner for chaining configuration calls.
-
visit
Visits each field, list item, and map item of the given object (excluding the object itself), according to the current configuration.- Parameters:
value- Object to visit.visitor- Visitor that handles the object's fields.
-
visitNullKeys
By default,IObjectGraphVisitor.visitMapItem(Object, Object, Map)is not called when the map key isnull. When this is set, the visitor is called even fornullmap keys.- Returns:
- This scanner for chaining configuration calls.
-
visitNullValues
By default, visitor methods are not called when the value isnull. When this is set, the visitor is called even fornullvalues.- Returns:
- This scanner for chaining configuration calls.
-