Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-5u16'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
mseko committed Apr 1, 2020
2 parents 9d9571d + b6f7a08 commit 7fe8198
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.nablarch.framework</groupId>
<artifactId>nablarch-core-beans</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>

<scm>
<connection>scm:git:git://github.com/nablarch/${project.artifactId}.git</connection>
Expand All @@ -16,7 +16,8 @@
<parent>
<groupId>com.nablarch</groupId>
<artifactId>nablarch-parent</artifactId>
<version>5u13</version>
<version>5u16</version>
<relativePath/>
</parent>

<dependencies>
Expand Down
18 changes: 17 additions & 1 deletion src/main/java/nablarch/core/beans/BeanUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,24 @@ public static <T> T createAndCopy(final Class<T> beanClass, final Map<String, ?>
if (map == null) {
return bean;
}
copy(beanClass, bean, map, copyOptions);
return bean;
}

/**
* {@link Map}からBeanインスタンスへコピーを行う。
* 生成済みのインスタンスにコピーを行う点以外は、{@link #createAndCopy(Class, Map, CopyOptions)}と同じ動作である。
*
* @param beanClass 移送先BeanのClass
* @param bean 移送先Beanインスタンス
* @param map 移送元のMap
* JavaBeansのプロパティ名をエントリーのキー
* プロパティの値をエントリーの値とするMap
* @param copyOptions コピーの設定
* @param <T> 型引数
*/
public static <T> void copy(Class<? extends T> beanClass, final T bean, final Map<String, ?> map,
final CopyOptions copyOptions) {
final CopyOptions mergedCopyOptions = copyOptions
.merge(CopyOptions.fromAnnotation(beanClass));
final Map<String, PropertyDescriptor> pdMap = PropertyDescriptors.get(beanClass).map;
Expand All @@ -478,7 +495,6 @@ public static <T> T createAndCopy(final Class<T> beanClass, final Map<String, ?>
"An error occurred while writing to the property :" + entry.getKey());
}
}
return bean;
}

/**
Expand Down

0 comments on commit 7fe8198

Please sign in to comment.