@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_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_beanTypePropertyName, BEAN_bpi, BEAN_bpro, BEAN_bpwo, BEAN_bpx, BEAN_debug, BEAN_examples, BEAN_excludeProperties, BEAN_fluentSetters, BEAN_ignoreInvocationExceptionsOnGetters, BEAN_ignoreInvocationExceptionsOnSetters, BEAN_ignorePropertiesWithoutSetters, BEAN_ignoreUnknownBeanProperties, BEAN_ignoreUnknownNullBeanProperties, BEAN_implClasses, BEAN_includeProperties, BEAN_locale, BEAN_mediaType, 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_timeZone, BEAN_useEnumNames, BEAN_useInterfaceProxies, BEAN_useJavaBeanIntrospector, DEFAULT, DEFAULT_SORTED| 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()
Configuration property: Initial depth.
|
protected int |
getMaxDepth()
Configuration property: Max traversal depth.
|
protected boolean |
isDetectRecursions()
Configuration property: Automatically detect POJO recursions.
|
protected boolean |
isIgnoreRecursions()
Configuration property: Ignore recursion errors.
|
ObjectMap |
toMap()
Returns the properties defined on this bean context as a simple map for debugging purposes.
|
_class, create, createBeanSession, createBeanSession, createDefaultBeanSessionArgs, createDefaultSessionArgs, createSession, dumpCacheStats, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionaryClasses, getBeanFieldVisibility, getBeanFilters, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBpi, getBpi, getBpro, getBpro, getBpwo, getBpwo, getBpx, getBpx, getClassMeta, getClassMeta, getClassMetaForObject, getExamples, getImplClassConstructor, getImplClasses, getLocale, getMediaType, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPojoSwaps, getPropertyNamer, getTimeZone, hasSameCache, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isDebug, isFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnorePropertiesWithoutSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isNotABean, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, object, resolveClassMeta, stringequals, getArrayProperty, getArrayProperty, getBooleanProperty, getCdlProperty, getClassArrayProperty, getClassArrayProperty, getClassArrayProperty, getClassListProperty, getClassListProperty, getClassMapProperty, getClassMapProperty, getClassProperty, getClassSetProperty, getClassSetProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceProperty, getInstanceProperty, getInstanceProperty, getIntegerProperty, getListProperty, getListProperty, getLongProperty, getMapProperty, getProperty, getProperty, getPropertyKeys, getPropertyStore, getSetProperty, getSetProperty, getStringProperty, getStringPropertyWithNone, hashCode, identityCode, toStringpublic static final String BEANTRAVERSE_detectRecursions
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 ParseExceptions with the message
The behavior when recursions are detected depends on the value for BEANTRAVERSE_ignoreRecursions.
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_ignoreRecursions
Used in conjunction with BEANTRAVERSE_detectRecursions.
Setting is ignored if
If
Otherwise, a BeanRecursionException is thrown with the message
public static final String BEANTRAVERSE_initialDepth
The initial indentation level at the root.
Useful when constructing document fragments that need to be indented at a certain level.
public static final String BEANTRAVERSE_maxDepth
Abort traversal if specified depth is reached in the POJO tree.
If this depth is exceeded, an exception is thrown.
protected BeanTraverseContext(PropertyStore ps)
ps - The property store containing all the settings for this object.public BeanTraverseBuilder builder()
ContextBuilders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
builder in class BeanContextpublic BeanTraverseSession createSession()
BeanContextUse 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 BeanContextpublic BeanTraverseSession createSession(BeanSessionArgs args)
BeanContextUse 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 BeanContextargs - The session arguments.protected final boolean isDetectRecursions()
BEANTRAVERSE_detectRecursionsprotected final boolean isIgnoreRecursions()
BEANTRAVERSE_ignoreRecursionsprotected final int getInitialDepth()
BEANTRAVERSE_initialDepthprotected final int getMaxDepth()
BEANTRAVERSE_maxDepthpublic ObjectMap toMap()
ContexttoMap in class BeanContextCopyright © 2016–2019 The Apache Software Foundation. All rights reserved.