|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.beans.BeanUtils
public class BeanUtils
Helper class for Java beans.
| Constructor Summary | |
|---|---|
BeanUtils()
|
|
| Method Summary | ||
|---|---|---|
static BeanMethodInformation |
beanMethodInformation(Method method)
Returns a BeanMethodInformation object determined for the given Method. |
|
static Set<BeanMethodInformation> |
beanMethodInformationSet(Class<?> clazz)
Returns a set of BeanMethodInformation instances for all methods of a given Class. |
|
static
|
beanPropertyAccessor(Class<B> beanClass,
Field field)
Returns a BeanPropertyAccessor object determined for the given Field. |
|
static
|
beanPropertyAccessor(Class<B> beanClass,
Method method)
Returns a BeanPropertyAccessor object determined for the given Method. |
|
static
|
beanPropertyAccessor(Class<B> beanClass,
String propertyName)
Returns a BeanPropertyAccessor object determined for the given property name |
|
static
|
beanPropertyAccessors(Class<B> beanClass)
Returns the BeanPropertyAccessors for a given Java Bean type |
|
static
|
beanPropertyAccessorSet(Class<B> beanClass)
Returns a set of BeanPropertyAccessor instances for all Java Bean properties of the given Class |
|
static
|
copyPropertyValues(S beanSource,
D beanDestination)
Copies the property values from one Java Bean to another. |
|
static
|
copyPropertyValues(S beanSource,
D beanDestination,
Collection<String> propertyNameCollection)
Copies the property values from one Java Bean to another but only for the given property names. |
|
static
|
copyPropertyValues(S beanSource,
D beanDestination,
String... propertyNames)
Copies the property values for the given property names from one Java Bean to another. |
|
static Map<String,BeanMethodInformation> |
methodNameToBeanMethodInformationMap(Class<?> clazz)
Determines a Map with the referenced Method.getName()s as keys and the respective
BeanMethodInformation name. |
|
static Map<String,BeanMethodInformation> |
methodNameToBeanMethodInformationMap(Method... methods)
Determines a Map with all Method.getName()s and the respective BeanMethodInformation instances. |
|
static int |
numberOfProperties(Class<?> beanClass)
Returns the number of available Java Bean properties for the given Java Bean type. |
|
static String[] |
propertyNamesForMethodAccess(Class<?> clazz)
Determines the property names of a given bean class which are addressed by getter or setter. |
|
static Map<String,Set<BeanMethodInformation>> |
propertyNameToBeanMethodInformationMap(Class<?> clazz)
Determines a Map with the referenced field names as keys and a Set of BeanMethodInformation for every
field name. |
|
static Map<String,Set<BeanMethodInformation>> |
propertyNameToBeanMethodInformationMap(Method... methods)
Determines a map with the referenced field names as keys and a Set of BeanMethodInformation for every field
name. |
|
static
|
propertyNameToBeanPropertyAccessorMap(Class<B> beanClass)
Returns a map of property names and BeanPropertyAccessor instances for all Java Bean properties of the given
Class. |
|
static
|
propertyNameToBeanPropertyAccessorMap(Class<B> beanClass,
Field... fields)
Returns a map of field names and BeanPropertyAccessor instances for all Java Bean properties related to at least one
of the given Fields. |
|
static
|
propertyNameToBeanPropertyAccessorMap(Class<B> beanClass,
Method... methods)
Returns a map of field names and BeanPropertyAccessor instances for all Java Bean properties related to at least one
of the given Methods. |
|
static
|
propertyNameToBeanPropertyValueMap(B bean)
Returns a map of property names and their current values for all Java Bean properties or the given Java Bean object. |
|
static
|
propertyNameToBeanPropertyValueMap(B bean,
Collection<String> propertyNameCollection)
Returns a map of property names and their current values for the Java Bean properties determined by the given property names for the given Java Bean object. |
|
static
|
propertyNameToBeanPropertyValueMap(B bean,
String... propertyNames)
Returns a Map of property names and their current values for the Java Bean properties determined by the given
property names for the given Java Bean object. |
|
static
|
propertyTypeToBeanPropertyAccessorSetMap(Class<B> beanClass)
Returns a map of property types for all Java Bean properties of the given Class and a Set of
BeanPropertyAccessor instances for each type. |
|
static
|
propertyValueList(B bean,
Collection<String> propertyNameCollection)
Returns an new ordered List of all property values for the given property names from the given Java Bean object |
|
static
|
propertyValueList(B bean,
String... propertyNames)
Returns an new ordered List of all property values for the given property names from the given Java Bean object |
|
static
|
transformBeanIntoMap(B bean)
Returns a new Map instance which contains the property names as keys and the values of the properties as map values. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeanUtils()
| Method Detail |
|---|
public static <B> Map<String,Object> transformBeanIntoMap(B bean)
Map instance which contains the property names as keys and the values of the properties as map values.
Modifications to the returned map will have no impact on the original Java Bean object.
B - bean -
MapToTypeAdapterpublic static int numberOfProperties(Class<?> beanClass)
beanClass -
public static <B> Set<BeanPropertyAccessor<B>> beanPropertyAccessorSet(Class<B> beanClass)
BeanPropertyAccessor instances for all Java Bean properties of the given Class
beanClass -
propertyNameToBeanPropertyAccessorMap(Class),
beanPropertyAccessor(Class, Field)public static <B> BeanPropertyAccessors<B> beanPropertyAccessors(Class<B> beanClass)
BeanPropertyAccessors for a given Java Bean type
B - beanClass -
public static <B> List<B> propertyValueList(B bean,
String... propertyNames)
List of all property values for the given property names from the given Java Bean object
bean - propertyNames -
public static <B> List<B> propertyValueList(B bean,
Collection<String> propertyNameCollection)
List of all property values for the given property names from the given Java Bean object
bean - propertyNameCollection -
public static <B,V> Map<String,V> propertyNameToBeanPropertyValueMap(B bean,
String... propertyNames)
Map of property names and their current values for the Java Bean properties determined by the given
property names for the given Java Bean object. The Map will be ordered in the same way than the given property names
B - : type of the beanV - : type of the valuesbean - propertyNames -
public static <B,V> Map<String,V> propertyNameToBeanPropertyValueMap(B bean,
Collection<String> propertyNameCollection)
Map keys and values will have the same order as the given property names.
B - : type of the beanV - : type of the valuesbean - propertyNameCollection -
public static <B,V> Map<String,V> propertyNameToBeanPropertyValueMap(B bean)
B - : type of the beanV - : type of the valuesbean -
public static <B> Map<String,BeanPropertyAccessor<B>> propertyNameToBeanPropertyAccessorMap(Class<B> beanClass,
Field... fields)
BeanPropertyAccessor instances for all Java Bean properties related to at least one
of the given Fields.
B - beanClass - fields -
public static <B> Map<String,BeanPropertyAccessor<B>> propertyNameToBeanPropertyAccessorMap(Class<B> beanClass,
Method... methods)
BeanPropertyAccessor instances for all Java Bean properties related to at least one
of the given Methods.
B - beanClass - methods -
public static <B> Map<Class<?>,Set<BeanPropertyAccessor<B>>> propertyTypeToBeanPropertyAccessorSetMap(Class<B> beanClass)
Class and a Set of
BeanPropertyAccessor instances for each type.
beanClass -
beanPropertyAccessorSet(Class),
propertyNameToBeanPropertyAccessorMap(Class)public static <B> Map<String,BeanPropertyAccessor<B>> propertyNameToBeanPropertyAccessorMap(Class<B> beanClass)
BeanPropertyAccessor instances for all Java Bean properties of the given
Class. The properties are in no order.
beanClass -
beanPropertyAccessorSet(Class)
public static <B> BeanPropertyAccessor<B> beanPropertyAccessor(Class<B> beanClass,
String propertyName)
BeanPropertyAccessor object determined for the given property name
beanClass - propertyName -
beanPropertyAccessor(Class, Field),
beanPropertyAccessorSet(Class),
propertyNameToBeanPropertyAccessorMap(Class)
public static <B> BeanPropertyAccessor<B> beanPropertyAccessor(Class<B> beanClass,
Field field)
BeanPropertyAccessor object determined for the given Field.
beanClass - field -
beanPropertyAccessor(Class, Method),
beanPropertyAccessor(Class, String),
beanPropertyAccessorSet(Class),
propertyNameToBeanPropertyAccessorMap(Class)
public static <B> BeanPropertyAccessor<B> beanPropertyAccessor(Class<B> beanClass,
Method method)
BeanPropertyAccessor object determined for the given Method.
beanClass - method -
beanPropertyAccessor(Class, Field),
beanPropertyAccessorSet(Class),
propertyNameToBeanPropertyAccessorMap(Class)public static Set<BeanMethodInformation> beanMethodInformationSet(Class<?> clazz)
BeanMethodInformation instances for all methods of a given Class.
clazz -
public static Map<String,Set<BeanMethodInformation>> propertyNameToBeanMethodInformationMap(Class<?> clazz)
Map with the referenced field names as keys and a Set of BeanMethodInformation for every
field name.
clazz -
public static Map<String,BeanMethodInformation> methodNameToBeanMethodInformationMap(Class<?> clazz)
Map with the referenced Method.getName()s as keys and the respective
BeanMethodInformation name.
clazz -
public static Map<String,Set<BeanMethodInformation>> propertyNameToBeanMethodInformationMap(Method... methods)
Set of BeanMethodInformation for every field
name. The map keys are in no order.
methods -
public static Map<String,BeanMethodInformation> methodNameToBeanMethodInformationMap(Method... methods)
Map with all Method.getName()s and the respective BeanMethodInformation instances.
methods -
public static BeanMethodInformation beanMethodInformation(Method method)
BeanMethodInformation object determined for the given Method.
public static <S,D> void copyPropertyValues(S beanSource,
D beanDestination)
S - D - beanSource - beanDestination -
public static <S,D> void copyPropertyValues(S beanSource,
D beanDestination,
String... propertyNames)
S - D - beanSource - beanDestination - propertyNames -
public static <S,D> void copyPropertyValues(S beanSource,
D beanDestination,
Collection<String> propertyNameCollection)
S - D - beanSource - beanDestination - propertyNameCollection - public static String[] propertyNamesForMethodAccess(Class<?> clazz)
clazz -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||