Package org.apache.juneau
Class BeanTraverseContext
java.lang.Object
org.apache.juneau.Context
org.apache.juneau.BeanContextable
org.apache.juneau.BeanTraverseContext
- All Implemented Interfaces:
AnnotationProvider
- Direct Known Subclasses:
JsonSchemaGenerator
,Serializer
Parent class for all classes that traverse POJOs.
Description
Base class that serves as the parent class for all serializers and other classes that traverse POJOs.
Notes:
- This class is thread safe and reusable.
See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.apache.juneau.Context
CONTEXT_APPLY_FILTER
Fields inherited from interface org.apache.juneau.AnnotationProvider
DEFAULT, DISABLE_ANNOTATION_CACHING
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor -
Method Summary
Modifier and TypeMethodDescriptionabstract BeanTraverseContext.Builder
copy()
Creates a builder from this context object.final int
Initial depth.final int
Max traversal depth.final boolean
Automatically detect POJO recursions.final boolean
Ignore recursion errors.protected JsonMap
Returns the properties on this bean as a map for debugging.Methods inherited from class org.apache.juneau.BeanContextable
getBeanContext
Methods inherited from class org.apache.juneau.Context
createBuilder, createSession, firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, getSession, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, init, isDebug, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation, toString
-
Constructor Details
-
BeanTraverseContext
Constructor- Parameters:
builder
- The builder for this object.
-
-
Method Details
-
copy
Description copied from class:Context
Creates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
-
isDetectRecursions
Automatically detect POJO recursions.- Returns:
true if recursions should be checked for during traversal.- See Also:
-
isIgnoreRecursions
Ignore recursion errors.- Returns:
true if when we encounter the same object when traversing a tree, we set the value tonull .
Otherwise, an exception is thrown with the message"Recursion occurred, stack=..." .- See Also:
-
getInitialDepth
Initial depth.- Returns:
- The initial indentation level at the root.
- See Also:
-
getMaxDepth
Max traversal depth.- Returns:
- The depth at which traversal is aborted if depth is reached in the POJO tree.
If this depth is exceeded, an exception is thrown. - See Also:
-
properties
Description copied from class:Context
Returns the properties on this bean as a map for debugging.- Overrides:
properties
in classBeanContextable
- Returns:
- The properties on this bean as a map for debugging.
-