public abstract class BeanCopier<S> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
FIELD_PREFIX_CLASS |
static String |
FIELD_PREFIX_TYPE |
protected Map<String,BeanPropertyInfo> |
properties |
protected Class<S> |
sourceType |
| 限定符 | 构造器和说明 |
|---|---|
protected |
BeanCopier() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Object |
convert(Type type,
Object value,
BiFunction<Type,Object,Object> converter) |
<T> void |
copyBeanToBean(S source,
Class<T> type,
T target) |
<T> void |
copyBeanToBean(S source,
Class<T> targetType,
T target,
CopyOptions options) |
<T> void |
copyBeanToBean(S source,
T target) |
<T> void |
copyBeanToBean(S source,
T target,
CopyOptions options) |
protected abstract void |
copyBeanToBeanBySameType(S source,
S target) |
protected <T> void |
copyBeanToBeanWithDynamicKeyMapping(BeanAccess<T> targetBeanAccess,
T target,
String sourceKey,
String targetKey,
Supplier<Object> valueSupplier,
CopyOptions options,
Set<String> targetKeys) |
protected <T> void |
copyBeanToBeanWithDynamicKeyMappings(BeanAccess<S> sourceBeanAccess,
S source,
BeanAccess<T> targetBeanAccess,
T target,
CopyOptions options,
Set<String> targetKeys,
List<Tuple2<BeanPropertyInfo,BeanPropertyInfo>> mapping) |
abstract void |
copyBeanToMap(S source,
Map<String,Object> target) |
void |
copyBeanToMap(S source,
Map<String,Object> target,
CopyOptions options) |
<K,V> void |
copyBeanToMap(S source,
Type targetType,
Map<K,V> target,
BiFunction<Type,Object,Object> converter) |
<K,V> void |
copyBeanToMap(S source,
Type targetType,
Map<K,V> target,
CopyOptions options) |
protected abstract void |
copyBeanToMapByConverter(Object source,
Map target,
BiFunction<Type,Object,Object> converter,
JavaType keyType,
JavaType valueType) |
protected abstract <K,V> void |
copyBeanToMapByOptions(S source,
Map<K,V> target,
CopyOptions options,
JavaType keyType,
JavaType valueType) |
protected void |
copyBeanToMapWithKeyByOptions(Map target,
CopyOptions options,
JavaType keyType,
JavaType valueType,
String sourceKey,
Object sourceValue) |
abstract void |
copyMapToBean(Map<String,Object> source,
S target) |
abstract void |
copyMapToBean(Map<String,Object> source,
S target,
BiFunction<Type,Object,Object> converter) |
void |
copyMapToBean(Map<String,Object> source,
S target,
CopyOptions options) |
protected abstract void |
copyMapToBeanWithCamelToUnderlineKeys(Map<String,Object> source,
Object target,
CopyOptions options,
Set<String> targetKeys) |
protected abstract void |
copyMapToBeanWithCapitalizeKeys(Map<String,Object> source,
Object target,
CopyOptions options,
Set<String> targetKeys) |
protected abstract void |
copyMapToBeanWithCustomKeys(Map<String,Object> source,
Object target,
CopyOptions options,
Set<String> targetKeys,
Map<String,String> keyMapping) |
protected abstract void |
copyMapToBeanWithSameKeys(Map<String,Object> source,
Object target,
CopyOptions options,
Set<String> targetKeys) |
protected abstract void |
copyMapToBeanWithUnderlineToCamelKeys(Map<String,Object> source,
Object target,
CopyOptions options,
Set<String> targetKeys) |
static <T> BeanCopier<T> |
create(Class<T> type) |
static <T> BeanCopier<T> |
get(Class<T> type) |
protected Type |
getPropertyGenericType(String propertyName) |
protected Class<?> |
getPropertyType(String propertyName) |
protected abstract void |
initTypeFields() |
protected void |
resolveCopyError(String propertyName,
Throwable e) |
protected void |
resolveCopyError(String propertyName,
Throwable e,
CopyOptions options) |
protected Map<String,BeanPropertyInfo> properties
protected abstract void initTypeFields()
public abstract void copyBeanToMap(@Nonnull S source, @Nonnull Map<String,Object> target)
public final <K,V> void copyBeanToMap(@Nonnull S source, @Nonnull Type targetType, @Nonnull Map<K,V> target, BiFunction<Type,Object,Object> converter)
protected abstract void copyBeanToMapByConverter(@Nonnull Object source, @Nonnull Map target, BiFunction<Type,Object,Object> converter, @Nonnull JavaType keyType, @Nonnull JavaType valueType)
public abstract void copyMapToBean(@Nonnull Map<String,Object> source, @Nonnull S target)
public abstract void copyMapToBean(@Nonnull Map<String,Object> source, @Nonnull S target, BiFunction<Type,Object,Object> converter)
public final <T> void copyBeanToBean(@Nonnull S source, Class<T> type, @Nonnull T target)
protected abstract void copyBeanToBeanBySameType(@Nonnull S source, @Nonnull S target)
public final void copyBeanToMap(@Nonnull S source, @Nonnull Map<String,Object> target, @Nonnull CopyOptions options)
public final <K,V> void copyBeanToMap(@Nonnull S source, @Nonnull Type targetType, @Nonnull Map<K,V> target, @Nonnull CopyOptions options)
protected abstract <K,V> void copyBeanToMapByOptions(@Nonnull S source, @Nonnull Map<K,V> target, @Nonnull CopyOptions options, @Nonnull JavaType keyType, @Nonnull JavaType valueType)
protected final void copyBeanToMapWithKeyByOptions(@Nonnull Map target, @Nonnull CopyOptions options, @Nonnull JavaType keyType, @Nonnull JavaType valueType, String sourceKey, Object sourceValue)
public final void copyMapToBean(@Nonnull Map<String,Object> source, @Nonnull S target, @Nonnull CopyOptions options)
protected abstract void copyMapToBeanWithCustomKeys(@Nonnull Map<String,Object> source, @Nonnull Object target, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys, @Nonnull Map<String,String> keyMapping)
protected abstract void copyMapToBeanWithSameKeys(@Nonnull Map<String,Object> source, @Nonnull Object target, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys)
protected abstract void copyMapToBeanWithCapitalizeKeys(@Nonnull Map<String,Object> source, @Nonnull Object target, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys)
protected abstract void copyMapToBeanWithUnderlineToCamelKeys(@Nonnull Map<String,Object> source, @Nonnull Object target, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys)
protected abstract void copyMapToBeanWithCamelToUnderlineKeys(@Nonnull Map<String,Object> source, @Nonnull Object target, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys)
public final <T> void copyBeanToBean(@Nonnull S source, @Nonnull T target, @Nonnull CopyOptions options)
public final <T> void copyBeanToBean(@Nonnull S source, @Nonnull Class<T> targetType, @Nonnull T target, @Nonnull CopyOptions options)
protected final <T> void copyBeanToBeanWithDynamicKeyMappings(@Nonnull BeanAccess<S> sourceBeanAccess, @Nonnull S source, @Nonnull BeanAccess<T> targetBeanAccess, @Nonnull T target, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys, @Nonnull List<Tuple2<BeanPropertyInfo,BeanPropertyInfo>> mapping)
protected final <T> void copyBeanToBeanWithDynamicKeyMapping(@Nonnull BeanAccess<T> targetBeanAccess, @Nonnull T target, @Nonnull String sourceKey, @Nonnull String targetKey, @Nonnull Supplier<Object> valueSupplier, @Nonnull CopyOptions options, @Nonnull Set<String> targetKeys)
protected final void resolveCopyError(@Nonnull String propertyName, @Nonnull Throwable e, @Nonnull CopyOptions options)
protected final Object convert(@Nonnull Type type, Object value, BiFunction<Type,Object,Object> converter)
public static <T> BeanCopier<T> get(@Nonnull Class<T> type)
public static <T> BeanCopier<T> create(@Nonnull Class<T> type)
Copyright © 2024 fossc. All rights reserved.