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
Nested Classes -
Field Summary
Fields inherited from class org.apache.juneau.Context
CONTEXT_APPLY_FILTERFields inherited from interface org.apache.juneau.AnnotationProvider
DEFAULT, DISABLE_ANNOTATION_CACHING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor -
Method Summary
Modifier and TypeMethodDescriptionabstract BeanTraverseContext.Buildercopy()Creates a builder from this context object.final intInitial depth.final intMax traversal depth.final booleanAutomatically detect POJO recursions.final booleanIgnore recursion errors.protected JsonMapReturns the properties on this bean as a map for debugging.Methods inherited from class org.apache.juneau.BeanContextable
getBeanContextMethods 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:ContextCreates 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:ContextReturns the properties on this bean as a map for debugging.- Overrides:
propertiesin classBeanContextable- Returns:
- The properties on this bean as a map for debugging.
-