Package org.apache.juneau
Class BeanTraverseContext
java.lang.Object
org.apache.juneau.Context
org.apache.juneau.BeanContextable
org.apache.juneau.BeanTraverseContext
- 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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.apache.juneau.BeanContextable
beanContextFields inherited from class org.apache.juneau.Context
CONTEXT_APPLY_FILTER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor -
Method Summary
Modifier and TypeMethodDescriptionabstract BeanTraverseContext.Buildercopy()Creates a builder from this context object.protected final booleanDetect recursions flag (raw value).protected final booleanIgnore recursions flag (raw value).final intInitial depth.final intMax traversal depth.final booleanAutomatically detect POJO recursions.final booleanIgnore recursion errors.Returns 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, getAnnotationProvider, getSession, init, isDebug, 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.
-
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:
-
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:
-
getDetectRecursions
Detect recursions flag (raw value).- Returns:
- The detect recursions flag.
-
getIgnoreRecursions
Ignore recursions flag (raw value).- Returns:
- The ignore recursions flag.
-
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.
-