Package org.apache.juneau.marshall
Class MarshallingTraverseContext
java.lang.Object
org.apache.juneau.marshall.Context
org.apache.juneau.marshall.MarshallingContextable
org.apache.juneau.marshall.MarshallingTraverseContext
- 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 ClassesModifier and TypeClassDescriptionstatic classBuilder class. -
Field Summary
Fields inherited from class org.apache.juneau.marshall.MarshallingContextable
marshallingContextFields inherited from class org.apache.juneau.marshall.Context
CONTEXT_APPLY_FILTER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor -
Method Summary
Modifier and TypeMethodDescriptionabstract MarshallingTraverseContext.Builder<?>copy()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.protected final booleanWhether recursion detection is effectively enabled during traversal.Methods inherited from class org.apache.juneau.marshall.MarshallingContextable
getDurationFormat, getMarshallingContext, getPeriodFormatMethods inherited from class org.apache.juneau.marshall.Context
createBuilder, createSession, getAnnotationProvider, getSession, init, isDebug, toString
-
Constructor Details
-
MarshallingTraverseContext
Constructor- Parameters:
builder- The builder for this object. Cannot benull .
-
-
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 beyond which nodes in the POJO tree are dropped (truncated) from the output.
Values deeper than this limit are silently omitted rather than causing an exception to be thrown.
This is a size guard, not a cycle detector. - See Also:
-
isDetectRecursions
Automatically detect POJO recursions.- Returns:
true if recursions should be checked for during traversal.- See Also:
-
shouldDetectRecursions
Whether recursion detection is effectively enabled during traversal. This isisDetectRecursions()ORisIgnoreRecursions()ORContext.isDebug(). -
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 classMarshallingContextable- Returns:
- The properties on this bean as a map for debugging.
-