@ConfigurableContext public class BeanContext extends Context
This class servers multiple purposes:
Map
interfaces.
BeanFilters
,
PropertyNamers
, etc... which are used to tailor how POJOs are serialized and parsed.
All serializers and parsers extend from this context so that they can handle POJOs using a common framework.
BeanContext.create()
and BeanContextBuilder.build()
methods.
Each bean context maintains a cache of ClassMeta
objects that describe information about classes encountered.
These BeanContext
that share the same BeanContext
class cannot be overridden on the session.
BeanSession
objects are ephemeral and not thread-safe.
They are meant to be used as quickly-constructed scratchpads for creating bean maps.
BeanMap
objects can only be created through the session.
Some settings (e.g. BEAN_beansRequireDefaultConstructor
) are used to differentiate between bean
and non-bean classes.
Attempting to create a bean map around one of these objects will throw a BeanRuntimeException
.
The purpose for this behavior is so that the serializers can identify these non-bean classes and convert them to
plain strings using the Object.toString()
method.
Some settings (e.g. BEAN_beanFieldVisibility
) are used to determine what kinds of properties are
detected on beans.
Some settings (e.g. BEAN_beanMapPutReturnsOldValue
) change the runtime behavior of bean maps.
Settings are specified using the BeanContextBuilder.set(String, Object)
method and related convenience
methods.
BeanMaps
are wrappers around Java beans that allow properties to be retrieved and
set using the common Map.put(Object,Object)
and Map.get(Object)
methods.
Bean maps are created in two ways...
BeanSession.toBeanMap()
- Wraps an existing bean inside a Map
wrapper.
BeanSession.newBeanMap()
- Create a new bean instance wrapped in a
Map
wrapper.
Modifier and Type | Field and Description |
---|---|
static String |
BEAN_beanClassVisibility
Configuration property: Minimum bean class visibility.
|
static String |
BEAN_beanConstructorVisibility
Configuration property: Minimum bean constructor visibility.
|
static String |
BEAN_beanDictionary
Configuration property: Bean dictionary.
|
static String |
BEAN_beanDictionary_add
Configuration property: Add to bean dictionary.
|
static String |
BEAN_beanDictionary_remove
Configuration property: Remove from bean dictionary.
|
static String |
BEAN_beanFieldVisibility
Configuration property: Minimum bean field visibility.
|
static String |
BEAN_beanFilters
Configuration property: Bean filters.
|
static String |
BEAN_beanFilters_add
Configuration property: Add to bean filters.
|
static String |
BEAN_beanFilters_remove
Configuration property: Remove from bean filters.
|
static String |
BEAN_beanMapPutReturnsOldValue
Configuration property: BeanMap.put() returns old property value.
|
static String |
BEAN_beanMethodVisibility
Configuration property: Minimum bean method visibility.
|
static String |
BEAN_beansRequireDefaultConstructor
Configuration property: Beans require no-arg constructors.
|
static String |
BEAN_beansRequireSerializable
Configuration property: Beans require Serializable interface.
|
static String |
BEAN_beansRequireSettersForGetters
Configuration property: Beans require setters for getters.
|
static String |
BEAN_beansRequireSomeProperties
Configuration property: Beans require at least one property.
|
static String |
BEAN_beanTypePropertyName
Configuration property: Bean type property name.
|
static String |
BEAN_debug
Configuration property: Debug mode.
|
static String |
BEAN_examples
Configuration property: POJO examples.
|
static String |
BEAN_excludeProperties
Configuration property: Bean property excludes.
|
static String |
BEAN_fluentSetters
Configuration property: Find fluent setters.
|
static String |
BEAN_ignoreInvocationExceptionsOnGetters
Configuration property: Ignore invocation errors on getters.
|
static String |
BEAN_ignoreInvocationExceptionsOnSetters
Configuration property: Ignore invocation errors on setters.
|
static String |
BEAN_ignorePropertiesWithoutSetters
Configuration property: Ignore properties without setters.
|
static String |
BEAN_ignoreUnknownBeanProperties
Configuration property: Ignore unknown properties.
|
static String |
BEAN_ignoreUnknownNullBeanProperties
Configuration property: Ignore unknown properties with null values.
|
static String |
BEAN_implClasses
Configuration property: Implementation classes.
|
static String |
BEAN_includeProperties
Configuration property: Bean property includes.
|
static String |
BEAN_locale
Configuration property: Locale.
|
static String |
BEAN_mediaType
Configuration property: Media type.
|
static String |
BEAN_notBeanClasses
Configuration property: Bean class exclusions.
|
static String |
BEAN_notBeanClasses_add
Configuration property: Add to classes that should not be considered beans.
|
static String |
BEAN_notBeanClasses_remove
Configuration property: Remove from classes that should not be considered beans.
|
static String |
BEAN_notBeanPackages
Configuration property: Bean package exclusions.
|
static String |
BEAN_notBeanPackages_add
Configuration property: Add to packages whose classes should not be considered beans.
|
static String |
BEAN_notBeanPackages_remove
Configuration property: Remove from packages whose classes should not be considered beans.
|
static String |
BEAN_pojoSwaps
Configuration property: POJO swaps.
|
static String |
BEAN_pojoSwaps_add
Configuration property: Add to POJO swap classes.
|
static String |
BEAN_pojoSwaps_remove
Configuration property: Remove from POJO swap classes.
|
static String |
BEAN_propertyNamer
Configuration property: Bean property namer.
|
static String |
BEAN_sortProperties
Configuration property: Sort bean properties.
|
static String |
BEAN_timeZone
Configuration property: Time zone.
|
static String |
BEAN_useEnumNames
Configuration property: Use enum names.
|
static String |
BEAN_useInterfaceProxies
Configuration property: Use interface proxies.
|
static String |
BEAN_useJavaBeanIntrospector
Configuration property: Use Java Introspector.
|
static BeanContext |
DEFAULT
Default config.
|
static BeanContext |
DEFAULT_SORTED
Default config.
|
Constructor and Description |
---|
BeanContext(PropertyStore ps)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected ClassMeta<Class> |
_class()
Returns a reusable
ClassMeta representation for the class |
BeanContextBuilder |
builder()
Creates a builder from this context object.
|
static BeanContextBuilder |
create()
Instantiates a new clean-slate
BeanContextBuilder object. |
BeanSession |
createBeanSession()
Same as
createSession() except always returns a BeanSession object unlike createSession()
which is meant to be overridden by subclasses. |
BeanSession |
createBeanSession(BeanSessionArgs args)
Same as
createSession(BeanSessionArgs) except always returns a BeanSession object unlike createSession(BeanSessionArgs)
which is meant to be overridden by subclasses. |
BeanSessionArgs |
createDefaultBeanSessionArgs()
Same as
createDefaultSessionArgs() except always returns a BeanSessionArgs unlike
createDefaultBeanSessionArgs() which is meant to be overridden by subclasses. |
BeanSessionArgs |
createDefaultSessionArgs()
Defines default session arguments used when calling the
Context.createSession() method. |
BeanSession |
createSession()
Create a new bean session based on the properties defined on this context.
|
BeanSession |
createSession(BeanSessionArgs args)
Create a new bean session based on the properties defined on this context combined with the specified
runtime args.
|
Session |
createSession(SessionArgs args)
Create a new session based on the properties defined on this context combined with the specified
runtime args.
|
protected static void |
dumpCacheStats()
Prints meta cache statistics to
|
protected Visibility |
getBeanClassVisibility()
Configuration property: Minimum bean class visibility.
|
protected Visibility |
getBeanConstructorVisibility()
Configuration property: Minimum bean constructor visibility.
|
protected List<Class<?>> |
getBeanDictionaryClasses()
Configuration property: Bean dictionary.
|
protected Visibility |
getBeanFieldVisibility()
Configuration property: Minimum bean field visibility.
|
protected BeanFilter[] |
getBeanFilters()
Configuration property: Bean filters.
|
<T> BeanMeta<T> |
getBeanMeta(Class<T> c)
Returns the
BeanMeta class for the specified class. |
protected Visibility |
getBeanMethodVisibility()
Configuration property: Minimum bean method visibility.
|
protected BeanRegistry |
getBeanRegistry()
Returns the lookup table for resolving bean types by name.
|
protected String |
getBeanTypePropertyName()
Configuration property: Bean type property name.
|
<T> ClassMeta<T> |
getClassMeta(Class<T> type)
Construct a
ClassMeta wrapper around a Class object. |
<T> ClassMeta<T> |
getClassMeta(Type type,
Type... args)
Used to resolve
|
<T> ClassMeta<T> |
getClassMetaForObject(T o)
Shortcut for calling
getClassMeta(o.getClass()) . |
protected Map<String,?> |
getExamples()
Configuration property: POJO examples.
|
protected Map<String,String[]> |
getExcludeProperties()
Configuration property: Bean property excludes.
|
protected String[] |
getExcludeProperties(Class<?> c)
Returns the
BEAN_excludeProperties setting for the specified class. |
protected <T> ConstructorInfo |
getImplClassConstructor(Class<T> c,
Visibility v)
Gets the no-arg constructor for the specified class.
|
protected Map<String,ClassInfo> |
getImplClasses()
Configuration property: Implementation classes.
|
protected Map<String,String[]> |
getIncludeProperties()
Configuration property: Bean property includes.
|
protected String[] |
getIncludeProperties(Class<?> c)
Returns the
BEAN_includeProperties setting for the specified class. |
protected Locale |
getLocale()
Configuration property: Locale.
|
protected MediaType |
getMediaType()
Configuration property: Media type.
|
protected Class<?>[] |
getNotBeanClasses()
Configuration property: Bean class exclusions.
|
protected String[] |
getNotBeanPackagesNames()
Configuration property: Bean package exclusions.
|
protected String[] |
getNotBeanPackagesPrefixes()
Configuration property: Bean package exclusions.
|
protected PojoSwap<?,?>[] |
getPojoSwaps()
Configuration property: POJO swaps.
|
protected PropertyNamer |
getPropertyNamer()
Configuration property: Bean property namer.
|
protected TimeZone |
getTimeZone()
Configuration property: Time zone.
|
boolean |
hasSameCache(BeanContext bc)
Returns
|
boolean |
isBean(Object o)
Returns
|
protected boolean |
isBeanMapPutReturnsOldValue()
Configuration property: BeanMap.put() returns old property value.
|
protected boolean |
isBeansRequireDefaultConstructor()
Configuration property: Beans require no-arg constructors.
|
protected boolean |
isBeansRequireSerializable()
Configuration property: Beans require Serializable interface.
|
protected boolean |
isBeansRequireSettersForGetters()
Configuration property: Beans require setters for getters.
|
protected boolean |
isBeansRequireSomeProperties()
Configuration property: Beans require at least one property.
|
protected boolean |
isDebug()
Configuration property: Debug mode.
|
protected boolean |
isFluentSetters()
Configuration property: Find fluent setters.
|
protected boolean |
isIgnoreInvocationExceptionsOnGetters()
Configuration property: Ignore invocation errors on getters.
|
protected boolean |
isIgnoreInvocationExceptionsOnSetters()
Configuration property: Ignore invocation errors on setters.
|
protected boolean |
isIgnorePropertiesWithoutSetters()
Configuration property: Ignore properties without setters.
|
protected boolean |
isIgnoreUnknownBeanProperties()
Configuration property: Ignore unknown properties.
|
protected boolean |
isIgnoreUnknownNullBeanProperties()
Configuration property: Ignore unknown properties with null values.
|
protected boolean |
isNotABean(Class<?> c)
Determines whether the specified class is ignored as a bean class based on the various exclusion parameters
specified on this context class.
|
protected boolean |
isSortProperties()
Configuration property: Sort bean properties.
|
protected boolean |
isUseEnumNames()
Configuration property: Use enum names.
|
protected boolean |
isUseInterfaceProxies()
Configuration property: Use interface proxies.
|
protected boolean |
isUseJavaBeanIntrospector()
Configuration property: Use Java Introspector.
|
protected ClassMeta<Object> |
object()
Returns a reusable
ClassMeta representation for the class |
protected <T> ClassMeta<T> |
resolveClassMeta(BeanProperty p,
Type t,
Map<Class<?>,Class<?>[]> typeVarImpls)
Used for determining the class type on a method or field where a
@BeanProperty annotation may be present. |
protected ClassMeta<String> |
string()
Returns a reusable
ClassMeta representation for the class |
ObjectMap |
toMap()
Returns the properties defined on this bean context as a simple map for debugging purposes.
|
equals, 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, toString
public static final String BEAN_beanClassVisibility
Visibility
)
Classes are not considered beans unless they meet the minimum visibility requirements.
For example, if the visibility is
Use this setting to reduce the visibility requirement.
public static final String BEAN_beanConstructorVisibility
Visibility
)
Only look for constructors with the specified minimum visibility.
This setting affects the logic for finding no-arg constructors for bean.
Normally, only
Use this setting if you want to reduce the visibility requirement.
public static final String BEAN_beanDictionary
BeanContextBuilder.beanDictionary(Object...)
BeanContextBuilder.beanDictionary(Class...)
BeanContextBuilder.beanDictionaryReplace(Object...)
BeanContextBuilder.beanDictionaryReplace(Class...)
BeanContextBuilder.beanDictionaryRemove(Object...)
BeanContextBuilder.beanDictionaryRemove(Class...)
BeanFilterBuilder.beanDictionary(Class...)
The list of classes that make up the bean dictionary in this bean context.
A dictionary is a name/class mapping used to find class types during parsing when they cannot be inferred
through reflection.
The names are defined through the @Bean(typeName)
annotation defined on the bean class.
For example, if a class
This setting tells the parsers which classes to look for when resolving
Values can consist of any of the following types:
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public static final String BEAN_beanDictionary_add
public static final String BEAN_beanDictionary_remove
public static final String BEAN_beanFieldVisibility
Visibility
)
Only look for bean fields with the specified minimum visibility.
This affects which fields on a bean class are considered bean properties.
Normally only
Use this setting if you want to reduce the visibility requirement.
public static final String BEAN_beanFilters
This is a programmatic equivalent to the @Bean
annotation.
It's useful when you want to use the
Values can consist of any of the following types:
BeanFilterBuilder
.
InterfaceBeanFilterBuilder
.
public static final String BEAN_beanFilters_add
public static final String BEAN_beanFilters_remove
public static final String BEAN_beanMapPutReturnsOldValue
If BeanMap.put()
method will return old property
values.
Otherwise, it returns
Disabled by default because it introduces a slight performance penalty during serialization.
public static final String BEAN_beanMethodVisibility
Visibility
)
Only look for bean methods with the specified minimum visibility.
This affects which methods are detected as getters and setters on a bean class.
Normally only
Use this setting if you want to reduce the visibility requirement.
public static final String BEAN_beansRequireDefaultConstructor
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
The @Bean
annotation can be used on a class to override this setting when
public static final String BEAN_beansRequireSerializable
If Serializable
interface to be considered a bean.
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
The @Bean
annotation can be used on a class to override this setting when
public static final String BEAN_beansRequireSettersForGetters
If
Otherwise, they will be ignored.
public static final String BEAN_beansRequireSomeProperties
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
The @Bean
annotation can be used on a class to override this setting when
public static final String BEAN_beanTypePropertyName
This specifies the name of the bean property used to store the dictionary name of a bean type so that the parser knows the data type to reconstruct.
public static final String BEAN_debug
Enables the following additional information during serialization:
BeanTraverseContext.BEANTRAVERSE_detectRecursions
.
Enables the following additional information during parsing:
public static final String BEAN_examples
Specifies an example of the specified class.
Examples are used in cases such as POJO examples in Swagger documents.
Setting applies to specified class and all subclasses.
POJO examples can also be defined on classes via the following:
@Example
.
@Example
with zero arguments or one BeanSession
argument.
BeanSession
argument.
public static final String BEAN_excludeProperties
Specifies to exclude the specified list of properties for the specified bean class.
The keys are either fully-qualified or simple class names, and the values are comma-delimited lists of property
names.
The key
For example, {Bean1:
means don't serialize the
Setting applies to specified class and all subclasses.
public static final String BEAN_fluentSetters
When enabled, fluent setters are detected on beans.
Fluent setters must have the following attributes:
public static final String BEAN_ignoreInvocationExceptionsOnGetters
If
Otherwise, a BeanRuntimeException
is thrown.
public static final String BEAN_ignoreInvocationExceptionsOnSetters
If
Otherwise, a BeanRuntimeException
is thrown.
public static final String BEAN_ignorePropertiesWithoutSetters
If
Otherwise, a RuntimeException
is thrown.
public static final String BEAN_ignoreUnknownBeanProperties
If
Otherwise, a RuntimeException
is thrown.
public static final String BEAN_ignoreUnknownNullBeanProperties
If
Otherwise, a RuntimeException
is thrown.
public static final String BEAN_implClasses
For interfaces and abstract classes this method can be used to specify an implementation class for the interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a parse).
public static final String BEAN_includeProperties
Specifies the set and order of names of properties associated with the bean class.
The keys are either fully-qualified or simple class names, and the values are comma-delimited lists of property
names.
The key
For example, {Bean1:
means only serialize the
Setting applies to specified class and all subclasses.
public static final String BEAN_locale
Locale
)
Locale.getDefault()
)
Specifies the default locale for serializer and parser sessions.
public static final String BEAN_mediaType
MediaType
)
Specifies the default media type value for serializer and parser sessions.
public static final String BEAN_notBeanClasses
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
Values can consist of any of the following types:
public static final String BEAN_notBeanClasses_add
public static final String BEAN_notBeanClasses_remove
public static final String BEAN_notBeanPackages
BeanContextBuilder.notBeanPackages(Object...)
BeanContextBuilder.notBeanPackages(String...)
BeanContextBuilder.notBeanPackagesReplace(Object...)
BeanContextBuilder.notBeanPackagesReplace(String...)
BeanContextBuilder.notBeanPackagesRemove(Object...)
BeanContextBuilder.notBeanPackagesRemove(String...)
When specified, the current list of ignore packages are appended to.
Any classes within these packages will be serialized to strings using Object.toString()
.
Note that you can specify suffix patterns to include all subpackages.
Values can consist of any of the following types:
public static final String BEAN_notBeanPackages_add
public static final String BEAN_notBeanPackages_remove
public static final String BEAN_pojoSwaps
POJO swaps are used to "swap out" non-serializable classes with serializable equivalents during serialization, and "swap in" the non-serializable class during parsing.
An example of a POJO swap would be a
Multiple POJO swaps can be associated with a single class.
When multiple swaps are applicable to the same class, the media type pattern defined by
PojoSwap.forMediaTypes()
or @Swap(mediaTypes)
are used to come up with the best match.
Values can consist of any of the following types:
PojoSwap
.
PojoSwap
.
SurrogateSwap
.
public static final String BEAN_pojoSwaps_add
public static final String BEAN_pojoSwaps_remove
public static final String BEAN_propertyNamer
Class<? implements PropertyNamer
>
PropertyNamerDefault
The class to use for calculating bean property names.
Predefined classes:
PropertyNamerDefault
- Default.
PropertyNamerDLC
- Dashed-lower-case names.
PropertyNamerULC
- Dashed-upper-case names.
public static final String BEAN_sortProperties
When
Otherwise, the natural order of the bean properties is used which is dependent on the JVM vendor.
On IBM JVMs, the bean properties are ordered based on their ordering in the Java file.
On Oracle JVMs, the bean properties are not ordered (which follows the official JVM specs).
This property is disabled by default so that IBM JVM users don't have to use @Bean
annotations
to force bean properties to be in a particular order and can just alter the order of the fields/methods
in the Java file.
public static final String BEAN_timeZone
TimeZone
)
Specifies the default timezone for serializer and parser sessions.
public static final String BEAN_useEnumNames
When enabled, enums are always serialized by name, not using Object.toString()
.
public static final String BEAN_useInterfaceProxies
If InvocationHandler
if there is no other way of instantiating them.
Otherwise, throws a BeanRuntimeException
.
public static final String BEAN_useJavaBeanIntrospector
Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
Most @Bean
annotations will be ignored.
public static final BeanContext DEFAULT
public static final BeanContext DEFAULT_SORTED
public BeanContext(PropertyStore ps)
Typically only called from ContextBuilder.build(Class)
method.
ps
- The property store containing the unmodifiable configuration for this bean context.public BeanContextBuilder builder()
Context
Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
public static BeanContextBuilder create()
BeanContextBuilder
object.
This is equivalent to simply calling
.
JsonSerializerBuilder
object.public BeanSession createSession()
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 Context
public BeanSession createSession(BeanSessionArgs args)
Use this method for creating sessions if you don't need to override any properties or locale/timezone currently set on this context.
args
- The session arguments.public final Session createSession(SessionArgs args)
Context
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 Context
args
- The session arguments.public final BeanSession createBeanSession(BeanSessionArgs args)
createSession(BeanSessionArgs)
except always returns a BeanSession
object unlike createSession(BeanSessionArgs)
which is meant to be overridden by subclasses.args
- The session arguments.public final BeanSession createBeanSession()
createSession()
except always returns a BeanSession
object unlike createSession()
which is meant to be overridden by subclasses.public BeanSessionArgs createDefaultSessionArgs()
Context
Context.createSession()
method.createDefaultSessionArgs
in class Context
public final BeanSessionArgs createDefaultBeanSessionArgs()
createDefaultSessionArgs()
except always returns a BeanSessionArgs
unlike
createDefaultBeanSessionArgs()
which is meant to be overridden by subclasses.public final boolean hasSameCache(BeanContext bc)
Useful for testing purposes.
bc
- The bean context to compare to.protected final boolean isNotABean(Class<?> c)
c
- The class type being tested.public boolean isBean(Object o)
o
- The object to test.protected static void dumpCacheStats()
public final <T> BeanMeta<T> getBeanMeta(Class<T> c)
BeanMeta
class for the specified class.T
- The class type to get the meta-data on.c
- The class to get the meta-data on.BeanMeta
for the specified class, or public final <T> ClassMeta<T> getClassMeta(Class<T> type)
ClassMeta
wrapper around a Class
object.public final <T> ClassMeta<T> getClassMeta(Type type, Type... args)
The array can be arbitrarily long to indicate arbitrarily complex data structures.
getClassMeta(String.class );
- A normal type.
getClassMeta(List.class );
- A list containing objects.
getClassMeta(List.class , String.class );
- A list containing strings.
getClassMeta(LinkedList.class , String.class );
- A linked-list containing
strings.
getClassMeta(LinkedList.class , LinkedList.class , String.class );
-
A linked-list containing linked-lists of strings.
getClassMeta(Map.class );
- A map containing object keys/values.
getClassMeta(Map.class , String.class , String.class );
- A map
containing string keys/values.
getClassMeta(Map.class , String.class , List.class , MyBean.class );
-
A map containing string keys and values of lists containing beans.
type
- The class to resolve.
ClassMeta
, Class
, ParameterizedType
, GenericArrayType
args
- The type arguments of the class if it's a collection or map.
ClassMeta
, Class
, ParameterizedType
, GenericArrayType
public final <T> ClassMeta<T> getClassMetaForObject(T o)
getClassMeta(o.getClass())
.T
- The class of the object being passed in.o
- The class to find the class type for.o
is protected final <T> ClassMeta<T> resolveClassMeta(BeanProperty p, Type t, Map<Class<?>,Class<?>[]> typeVarImpls)
@BeanProperty
annotation may be present.T
- The class type we're wrapping.p
- The property annotation on the type if there is one.t
- The type.typeVarImpls
- Contains known resolved type parameters on the specified class so that we can result
ParameterizedTypes
and TypeVariables
.
Can be ClassMeta
object wrapped around the Type
object.protected final <T> ConstructorInfo getImplClassConstructor(Class<T> c, Visibility v)
T
- The class to check.c
- The class to check.v
- The minimum visibility for the constructor.protected String[] getIncludeProperties(Class<?> c)
BEAN_includeProperties
setting for the specified class.c
- The class.protected String[] getExcludeProperties(Class<?> c)
BEAN_excludeProperties
setting for the specified class.c
- The class.protected final ClassMeta<Object> object()
ClassMeta
representation for the class
This
This method is identical to calling getClassMeta(Object.
but uses a cached copy to
avoid a hashmap lookup.
ClassMeta
object associated with the protected final ClassMeta<String> string()
ClassMeta
representation for the class
This
This method is identical to calling getClassMeta(String.
but uses a cached copy to
avoid a hashmap lookup.
ClassMeta
object associated with the protected final ClassMeta<Class> _class()
ClassMeta
representation for the class
This
This method is identical to calling getClassMeta(Class.
but uses a cached copy to
avoid a hashmap lookup.
ClassMeta
object associated with the protected final BeanRegistry getBeanRegistry()
protected final Visibility getBeanClassVisibility()
BEAN_beanClassVisibility
protected final Visibility getBeanConstructorVisibility()
BEAN_beanConstructorVisibility
protected final List<Class<?>> getBeanDictionaryClasses()
BEAN_beanDictionary
protected final Visibility getBeanFieldVisibility()
BEAN_beanFieldVisibility
protected final BeanFilter[] getBeanFilters()
BEAN_beanFilters
protected final boolean isBeanMapPutReturnsOldValue()
BeanMap.put()
method will return old property values.
BEAN_beanMapPutReturnsOldValue
protected final Visibility getBeanMethodVisibility()
BEAN_beanMethodVisibility
protected final boolean isBeansRequireDefaultConstructor()
Object.toString()
method.BEAN_beansRequireDefaultConstructor
protected final boolean isBeansRequireSerializable()
Serializable
interface to be considered a bean.
Object.toString()
method.BEAN_beansRequireSerializable
protected final boolean isBeansRequireSettersForGetters()
BEAN_beansRequireSettersForGetters
protected final boolean isBeansRequireSomeProperties()
Object.toString()
method.BEAN_beansRequireSomeProperties
protected final String getBeanTypePropertyName()
BEAN_beanTypePropertyName
protected boolean isDebug()
BEAN_debug
protected final Map<String,?> getExamples()
BEAN_examples
protected final Map<String,String[]> getExcludeProperties()
BEAN_excludeProperties
protected final boolean isFluentSetters()
BEAN_fluentSetters
protected final boolean isIgnoreInvocationExceptionsOnGetters()
BEAN_ignoreInvocationExceptionsOnGetters
protected final boolean isIgnoreInvocationExceptionsOnSetters()
BEAN_ignoreInvocationExceptionsOnSetters
protected final boolean isIgnorePropertiesWithoutSetters()
RuntimeException
is thrown.BEAN_ignorePropertiesWithoutSetters
protected final boolean isIgnoreUnknownBeanProperties()
RuntimeException
is thrown.BEAN_ignoreUnknownBeanProperties
protected final boolean isIgnoreUnknownNullBeanProperties()
BEAN_ignoreUnknownNullBeanProperties
protected final Map<String,ClassInfo> getImplClasses()
BEAN_implClasses
protected final Map<String,String[]> getIncludeProperties()
BEAN_includeProperties
protected final Locale getLocale()
BEAN_locale
protected final MediaType getMediaType()
BEAN_mediaType
protected final Class<?>[] getNotBeanClasses()
BEAN_notBeanClasses
protected final String[] getNotBeanPackagesNames()
BEAN_notBeanPackages
protected final String[] getNotBeanPackagesPrefixes()
BEAN_notBeanPackages
protected final PojoSwap<?,?>[] getPojoSwaps()
BEAN_pojoSwaps
protected final PropertyNamer getPropertyNamer()
BEAN_propertyNamer
protected final boolean isSortProperties()
BEAN_sortProperties
protected final TimeZone getTimeZone()
BEAN_timeZone
protected final boolean isUseEnumNames()
Object.toString()
.BEAN_useEnumNames
protected final boolean isUseInterfaceProxies()
InvocationHandler
if there is no other way of instantiating them.BEAN_useInterfaceProxies
protected final boolean isUseJavaBeanIntrospector()
BEAN_useJavaBeanIntrospector
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.