Package com.vaadin.data
Class BeanPropertySet<T>
- java.lang.Object
-
- com.vaadin.data.BeanPropertySet<T>
-
- Type Parameters:
T
- the type of the bean
- All Implemented Interfaces:
PropertySet<T>
,Serializable
public class BeanPropertySet<T> extends Object implements PropertySet<T>
APropertySet
that uses reflection to find bean properties.- Since:
- 8.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BeanPropertySet.NestedBeanPropertyDefinition<T,V>
Contains properties for a bean type which is nested in another definition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> PropertySet<T>
get(Class<? extends T> beanType)
Gets aBeanPropertySet
for the given bean type.static <T> PropertySet<T>
get(Class<? extends T> beanType, boolean checkNestedDefinitions, PropertyFilterDefinition filterDefinition)
Gets aBeanPropertySet
for the given bean type.Class<T>
getBeanType()
Gets the bean type of this bean property set.Stream<PropertyDefinition<T,?>>
getProperties()
Gets all known properties as a stream.Optional<PropertyDefinition<T,?>>
getProperty(String name)
Gets the definition for the named property, or an empty optional if there is no property with the given name.String
toString()
-
-
-
Method Detail
-
get
public static <T> PropertySet<T> get(Class<? extends T> beanType)
Gets aBeanPropertySet
for the given bean type.- Type Parameters:
T
- bean type- Parameters:
beanType
- the bean type to get a property set for, notnull
- Returns:
- the bean property set, not
null
-
get
public static <T> PropertySet<T> get(Class<? extends T> beanType, boolean checkNestedDefinitions, PropertyFilterDefinition filterDefinition)
Gets aBeanPropertySet
for the given bean type.- Type Parameters:
T
- bean type- Parameters:
beanType
- the bean type to get a property set for, notnull
checkNestedDefinitions
- whether to scan for nested definitions in beanTypefilterDefinition
- filtering conditions for nested properties- Returns:
- the bean property set, not
null
- Since:
- 8.2
-
getProperties
public Stream<PropertyDefinition<T,?>> getProperties()
Description copied from interface:PropertySet
Gets all known properties as a stream.- Specified by:
getProperties
in interfacePropertySet<T>
- Returns:
- a stream of property names, not
null
-
getProperty
public Optional<PropertyDefinition<T,?>> getProperty(String name) throws IllegalArgumentException
Description copied from interface:PropertySet
Gets the definition for the named property, or an empty optional if there is no property with the given name.- Specified by:
getProperty
in interfacePropertySet<T>
- Parameters:
name
- the property name to look for, notnull
- Returns:
- the property definition, or empty optional if property doesn't exist
- Throws:
IllegalArgumentException
-
getBeanType
public Class<T> getBeanType()
Gets the bean type of this bean property set.- Returns:
- the bean type of this bean property set
- Since:
- 8.2
-
-