Utility methods for Java beans (classes with getters and setters).
More...
|
static List< PropertyDescriptor > | getProperties (Class<?> beanType) |
| Lists all properties on a bean type. More...
|
|
static< TAnnotation extends Annotation > List< PropertyDescriptor > | getPropertiesWithAnnotation (Class<?> beanType, Class< TAnnotation > annotationType) |
| Lists all properties on a bean type that have a specific annotation on their getter or backing field. More...
|
|
static< TAnnotation extends Annotation > List< PropertyDescriptor > | getPropertiesWithoutAnnotation (Class<?> beanType, Class< TAnnotation > annotationType) |
| Lists all readable and writable properties on a bean type that do not have a specific annotation on their getter or backing field. More...
|
|
static< TAnnotation extends Annotation > Optional< TAnnotation > | getAnnotation (Class<?> beanType, PropertyDescriptor property, Class< TAnnotation > annotationType) |
| Returns an annotation of a specific type on a property's getter or its backing field. More...
|
|
Utility methods for Java beans (classes with getters and setters).
◆ getAnnotation()
static <TAnnotation extends Annotation> Optional<TAnnotation> net.typedrest.BeanUtils.getAnnotation |
( |
Class<?> |
beanType, |
|
|
PropertyDescriptor |
property, |
|
|
Class< TAnnotation > |
annotationType |
|
) |
| |
|
static |
Returns an annotation of a specific type on a property's getter or its backing field.
- Parameters
-
<TAnnotation> | The type of annotation to look for. |
beanType | The type of bean the property is declared on. |
property | The property to check for the annotation. |
annotationType | The type of annotation to look for. |
- Returns
- The annotation if present.
◆ getProperties()
static List<PropertyDescriptor> net.typedrest.BeanUtils.getProperties |
( |
Class<?> |
beanType | ) |
|
|
static |
Lists all properties on a bean type.
Ensures properties annotated with Id or called "name" are always listed first.
- Parameters
-
beanType | The type of bean to check for properties. |
- Returns
- A list of properties.
◆ getPropertiesWithAnnotation()
static <TAnnotation extends Annotation> List<PropertyDescriptor> net.typedrest.BeanUtils.getPropertiesWithAnnotation |
( |
Class<?> |
beanType, |
|
|
Class< TAnnotation > |
annotationType |
|
) |
| |
|
static |
Lists all properties on a bean type that have a specific annotation on their getter or backing field.
- Parameters
-
<TAnnotation> | The annotation type to look for. |
beanType | The type of bean to check for properties. |
annotationType | The annotation type to look for. |
- Returns
- A list of matching properties.
◆ getPropertiesWithoutAnnotation()
static <TAnnotation extends Annotation> List<PropertyDescriptor> net.typedrest.BeanUtils.getPropertiesWithoutAnnotation |
( |
Class<?> |
beanType, |
|
|
Class< TAnnotation > |
annotationType |
|
) |
| |
|
static |
Lists all readable and writable properties on a bean type that do not have a specific annotation on their getter or backing field.
- Parameters
-
<TAnnotation> | The annotation type to look for. |
beanType | The type of bean to check for properties. |
annotationType | The annotation type to look for. |
- Returns
- A list of matching properties.
The documentation for this class was generated from the following file:
- /home/travis/build/TypedRest/TypedRest-Java/core/src/main/java/net/typedrest/BeanUtils.java