public class BeanDescriptionFactoryImpl extends Object implements BeanDescriptionFactory
BeanPropertyDescription objects for a given class.
This description factory returns property descriptions for all properties on a class for which a getter and setter is associated. Inherited properties are considered.
This implementation supports ExportName and transient properties, declared either
with the transient keyword or by adding the Transient annotation.
| Constructor and Description |
|---|
BeanDescriptionFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected @NotNull List<BeanPropertyDescription> |
collectAllProperties(@NotNull Class<?> clazz)
Collects all properties available on the given class.
|
protected @NotNull List<Class<?>> |
collectClassAndAllParents(@NotNull Class<?> clazz)
Returns a list of the class's parents, including the given class itself, with the top-most parent
coming first.
|
protected @Nullable BeanPropertyDescription |
convert(@NotNull PropertyDescriptor descriptor)
Converts a
PropertyDescriptor to a BeanPropertyDescription object. |
protected @NotNull Map<String,Integer> |
createFieldNameOrderMap(@NotNull Class<?> clazz)
Creates a map of index (encounter number) by field name for all fields of the given class,
including its superclasses.
|
protected @NotNull TypeInformation |
createTypeInfo(@NotNull PropertyDescriptor descriptor) |
@NotNull Collection<BeanPropertyDescription> |
getAllProperties(@NotNull Class<?> clazz)
Returns all properties of the given bean class for which there exists a getter and setter.
|
protected @NotNull BeanPropertyComments |
getComments(@Nullable Field field)
Returns the comments that are defined on the property.
|
protected @NotNull String |
getPropertyName(@NotNull PropertyDescriptor descriptor,
@Nullable Field field)
Returns the name which is used in the export files for the given property descriptor.
|
protected @NotNull List<PropertyDescriptor> |
getWritableProperties(@NotNull Class<?> clazz)
Returns all properties of the given class that are writable
(all bean properties with an associated read and write method).
|
protected @NotNull List<PropertyDescriptor> |
sortPropertiesList(@NotNull Class<?> clazz,
@NotNull List<PropertyDescriptor> properties)
Returns a sorted list of the given properties which will be used for further processing and whose
order will be maintained.
|
protected @Nullable Field |
tryGetField(@NotNull Class<?> clazz,
@NotNull String name)
Returns the field with the given name on the provided class, or null if it doesn't exist.
|
protected void |
validateProperties(@NotNull Class<?> clazz,
@NotNull Collection<BeanPropertyDescription> properties)
Validates the class's properties.
|
@NotNull public @NotNull Collection<BeanPropertyDescription> getAllProperties(@NotNull @NotNull Class<?> clazz)
getAllProperties in interface BeanDescriptionFactoryclazz - the bean property to process@NotNull protected @NotNull List<BeanPropertyDescription> collectAllProperties(@NotNull @NotNull Class<?> clazz)
clazz - the class to process@Nullable protected @Nullable BeanPropertyDescription convert(@NotNull @NotNull PropertyDescriptor descriptor)
PropertyDescriptor to a BeanPropertyDescription object.descriptor - the descriptor to convert@NotNull protected @NotNull BeanPropertyComments getComments(@Nullable @Nullable Field field)
Comment
annotation on a field with the same name as the property.field - the field associated with the property (may be null)@Nullable protected @Nullable Field tryGetField(@NotNull @NotNull Class<?> clazz, @NotNull @NotNull String name)
clazz - the class to search inname - the field name to look forprotected void validateProperties(@NotNull
@NotNull Class<?> clazz,
@NotNull
@NotNull Collection<BeanPropertyDescription> properties)
clazz - the class to which the properties belongproperties - the properties that will be used on the class@NotNull protected @NotNull String getPropertyName(@NotNull @NotNull PropertyDescriptor descriptor, @Nullable @Nullable Field field)
descriptor - the descriptor to get the name forfield - the field associated with the property (may be null)@NotNull protected @NotNull TypeInformation createTypeInfo(@NotNull @NotNull PropertyDescriptor descriptor)
@NotNull protected @NotNull List<PropertyDescriptor> getWritableProperties(@NotNull @NotNull Class<?> clazz)
clazz - the class to process@NotNull protected @NotNull List<PropertyDescriptor> sortPropertiesList(@NotNull @NotNull Class<?> clazz, @NotNull @NotNull List<PropertyDescriptor> properties)
clazz - the class from which the properties come fromproperties - the properties to sort@NotNull protected @NotNull Map<String,Integer> createFieldNameOrderMap(@NotNull @NotNull Class<?> clazz)
clazz - the class to create the field index map for@NotNull protected @NotNull List<Class<?>> collectClassAndAllParents(@NotNull @NotNull Class<?> clazz)
clazz - the class whose parents should be collectedCopyright © 2016–2023 The AuthMe Team. All rights reserved.