类 ProjectionUtils
- 作者:
- Cody Lu
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidprojectProperties(Object source, Object target) Copy the property values of the given source bean into the target bean.static voidprojectProperties(Object source, Object target, Class<?> editable) Copy the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).static voidprojectProperties(Object source, Object target, String... ignoreProperties) project the property values of the given source bean into the given target bean, ignoring the given "ignoreProperties".static voidprojectPropertiesWithView(Object source, Object target, Class<?> activeView) project the property values of the given source bean into the target bean.static voidprojectPropertiesWithView(Object source, Object target, Class<?> editable, Class<?> activeView) project the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).static org.springframework.data.projection.ProjectionFactory获取 ProjectionFactory bean 实例
-
构造器详细资料
-
ProjectionUtils
public ProjectionUtils()
-
-
方法详细资料
-
resolveProjectionFactory
public static org.springframework.data.projection.ProjectionFactory resolveProjectionFactory()获取 ProjectionFactory bean 实例- 返回:
-
projectProperties
public static void projectProperties(Object source, Object target) throws org.springframework.beans.BeansException Copy the property values of the given source bean into the target bean.Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.
- 参数:
source- the source beantarget- the target bean- 抛出:
org.springframework.beans.BeansException- if the projecting failed- 另请参阅:
-
BeanWrapper
-
projectProperties
public static void projectProperties(Object source, Object target, Class<?> editable) throws org.springframework.beans.BeansException Copy the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.
- 参数:
source- the source beantarget- the target beaneditable- the class (or interface) to restrict property setting to- 抛出:
org.springframework.beans.BeansException- if the projecting failed- 另请参阅:
-
BeanWrapper
-
projectProperties
public static void projectProperties(Object source, Object target, String... ignoreProperties) throws org.springframework.beans.BeansException project the property values of the given source bean into the given target bean, ignoring the given "ignoreProperties".Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.
This is just a convenience method. For more complex transfer needs, consider using a full BeanWrapper.
- 参数:
source- the source beantarget- the target beanignoreProperties- array of property names to ignore- 抛出:
org.springframework.beans.BeansException- if the projecting failed- 另请参阅:
-
BeanWrapper
-
projectPropertiesWithView
public static void projectPropertiesWithView(Object source, Object target, @Nonnull Class<?> activeView) throws org.springframework.beans.BeansException project the property values of the given source bean into the target bean.Note: The property of source or target which not in json view (activeView) will silently be ignored.
Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.
- 参数:
source- the source beantarget- the target beanactiveView- the active json view- 抛出:
org.springframework.beans.BeansException- if the projecting failed- 另请参阅:
-
BeanWrapper
-
projectPropertiesWithView
public static void projectPropertiesWithView(Object source, Object target, @Nullable Class<?> editable, @Nonnull Class<?> activeView) throws org.springframework.beans.BeansException project the property values of the given source bean into the given target bean, only setting properties defined in the given "editable" class (or interface).Note: The property of source or editable which not in json view (activeView) will silently be ignored.
Note: The source and target classes do not have to match or even be derived from each other, as long as the properties match. Any bean properties that the source bean exposes but the target bean does not will silently be ignored.
- 参数:
source- the source beantarget- the target beaneditable- the class (or interface) to restrict property setting toactiveView- the active json view- 抛出:
org.springframework.beans.BeansException- if the projecting failed- 另请参阅:
-
BeanWrapper
-