@ConfigurableContext public abstract class BeanTraverseContext extends BeanContext
Modifier and Type | Field and Description |
---|---|
static String |
BEANTRAVERSE_detectRecursions
Configuration property: Automatically detect POJO recursions.
|
static String |
BEANTRAVERSE_ignoreRecursions
Configuration property: Ignore recursion errors.
|
static String |
BEANTRAVERSE_initialDepth
Configuration property: Initial depth.
|
static String |
BEANTRAVERSE_maxDepth
Configuration property: Max traversal depth.
|
BEAN_annotations, BEAN_beanClassVisibility, BEAN_beanConstructorVisibility, BEAN_beanDictionary, BEAN_beanDictionary_add, BEAN_beanDictionary_remove, BEAN_beanFieldVisibility, BEAN_beanFilters, BEAN_beanFilters_add, BEAN_beanFilters_remove, BEAN_beanMapPutReturnsOldValue, BEAN_beanMethodVisibility, BEAN_beansRequireDefaultConstructor, BEAN_beansRequireSerializable, BEAN_beansRequireSettersForGetters, BEAN_beansRequireSomeProperties, BEAN_bpi, BEAN_bpro, BEAN_bpwo, BEAN_bpx, BEAN_examples, BEAN_excludeProperties, BEAN_fluentSetters, BEAN_ignoreInvocationExceptionsOnGetters, BEAN_ignoreInvocationExceptionsOnSetters, BEAN_ignorePropertiesWithoutSetters, BEAN_ignoreTransientFields, BEAN_ignoreUnknownBeanProperties, BEAN_ignoreUnknownNullBeanProperties, BEAN_implClasses, BEAN_includeProperties, BEAN_notBeanClasses, BEAN_notBeanClasses_add, BEAN_notBeanClasses_remove, BEAN_notBeanPackages, BEAN_notBeanPackages_add, BEAN_notBeanPackages_remove, BEAN_pojoSwaps, BEAN_pojoSwaps_add, BEAN_pojoSwaps_remove, BEAN_propertyNamer, BEAN_sortProperties, BEAN_swaps, BEAN_swaps_add, BEAN_swaps_remove, BEAN_typePropertyName, BEAN_useEnumNames, BEAN_useInterfaceProxies, BEAN_useJavaBeanIntrospector, DEFAULT, DEFAULT_SORTED
CONTEXT_debug, CONTEXT_locale, CONTEXT_mediaType, CONTEXT_timeZone
Modifier | Constructor and Description |
---|---|
protected |
BeanTraverseContext(PropertyStore ps)
Constructor
|
Modifier and Type | Method and Description |
---|---|
BeanTraverseBuilder |
builder()
Creates a builder from this context object.
|
BeanTraverseSession |
createSession()
Create a new bean session based on the properties defined on this context.
|
BeanTraverseSession |
createSession(BeanSessionArgs args)
Create a new bean session based on the properties defined on this context combined with the specified
runtime args.
|
protected int |
getInitialDepth()
Initial depth.
|
protected int |
getMaxDepth()
Max traversal depth.
|
protected boolean |
isDetectRecursions()
Automatically detect POJO recursions.
|
protected boolean |
isIgnoreRecursions()
Ignore recursion errors.
|
OMap |
toMap()
Returns the properties defined on this bean context as a simple map for debugging purposes.
|
_class, create, createBeanSession, createBeanSession, createDefaultBeanSessionArgs, createDefaultSessionArgs, createSession, dumpCacheStats, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionaryClasses, getBeanFieldVisibility, getBeanFilters, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanToStringSerializer, getBeanTypePropertyName, getBpi, getBpi, getBpro, getBpro, getBpwo, getBpwo, getBpx, getBpx, getClassMeta, getClassMeta, getClassMetaForObject, getDeclaredAnnotations, getDeclaredAnnotations, getExamples, getImplClassConstructor, getImplClasses, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastDeclaredAnnotation, getLastDeclaredAnnotation, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPropertyNamer, getSwaps, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasSameCache, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnorePropertiesWithoutSetters, isIgnoreTransientFields, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isNotABean, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, object, resolveClassMeta, string
equals, getArrayProperty, getArrayProperty, getBooleanProperty, getCdlProperty, getClassArrayProperty, getClassArrayProperty, getClassArrayProperty, getClassListProperty, getClassListProperty, getClassMapProperty, getClassMapProperty, getClassProperty, getClassSetProperty, getClassSetProperty, getDefaultLocale, getDefaultMediaType, getDefaultTimeZone, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceProperty, getInstanceProperty, getInstanceProperty, getIntegerProperty, getListProperty, getListProperty, getLongProperty, getMapProperty, getProperty, getProperty, getPropertyKeys, getPropertyStore, getSetProperty, getSetProperty, getStringProperty, getStringPropertyWithNone, hashCode, identityCode, isDebug, toString
public static final String BEANTRAVERSE_detectRecursions
BEANTRAVERSE_detectRecursions
When enabled, specifies that recursions should be checked for during traversal.
Recursions can occur when traversing models that aren't true trees but rather contain loops.
In general, unchecked recursions cause stack-overflow-errors.
These show up as BeanRecursionException
with the message
public static final String BEANTRAVERSE_ignoreRecursions
BEANTRAVERSE_ignoreRecursions
When enabled, when we encounter the same object when traversing a tree, we set the value to
For example, if a model contains the links A->B->C->A, then the JSON generated will look like
the following when
{A:{B:{C:
public static final String BEANTRAVERSE_initialDepth
BEANTRAVERSE_initialDepth
The initial indentation level at the root.
Useful when constructing document fragments that need to be indented at a certain level when whitespace is enabled.
public static final String BEANTRAVERSE_maxDepth
BEANTRAVERSE_maxDepth
When enabled, abort traversal if specified depth is reached in the POJO tree.
If this depth is exceeded, an exception is thrown.
This prevents stack overflows from occurring when trying to traverse models with recursive references.
protected BeanTraverseContext(PropertyStore ps)
ps
- The property store containing all the settings for this object.public BeanTraverseBuilder builder()
Context
Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
builder
in class BeanContext
public BeanTraverseSession createSession()
BeanContext
Use this method for creating sessions if you don't need to override any properties or locale/timezone currently set on this context.
createSession
in class BeanContext
public BeanTraverseSession createSession(BeanSessionArgs args)
BeanContext
Use this method for creating sessions if you don't need to override any properties or locale/timezone currently set on this context.
createSession
in class BeanContext
args
- The session arguments.protected final boolean isDetectRecursions()
BEANTRAVERSE_detectRecursions
protected final boolean isIgnoreRecursions()
BEANTRAVERSE_ignoreRecursions
protected final int getInitialDepth()
BEANTRAVERSE_initialDepth
protected final int getMaxDepth()
BEANTRAVERSE_maxDepth
public OMap toMap()
Context
toMap
in class BeanContext
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.