jimu-decompiled/sources/com/thoughtworks/xstream/mapper/MapperWrapper.java
2025-05-13 19:24:51 +02:00

251 lines
12 KiB
Java

package com.thoughtworks.xstream.mapper;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.mapper.Mapper;
import java.lang.reflect.Method;
import java.util.HashMap;
/* loaded from: classes.dex */
public abstract class MapperWrapper implements Mapper {
static /* synthetic */ Class class$com$thoughtworks$xstream$mapper$MapperWrapper;
private final Mapper aliasForAttributeMapper;
private final Mapper aliasForSystemAttributeMapper;
private final Mapper attributeForAliasMapper;
private final Mapper defaultImplementationOfMapper;
private final Mapper getConverterFromAttributeMapper;
private final Mapper getConverterFromItemTypeMapper;
private final Mapper getFieldNameForItemTypeAndNameMapper;
private final Mapper getImplicitCollectionDefForFieldNameMapper;
private final Mapper getItemTypeForItemFieldNameMapper;
private final Mapper getLocalConverterMapper;
private final Mapper isIgnoredElementMapper;
private final Mapper isImmutableValueTypeMapper;
private final Mapper isReferenceableMapper;
private final Mapper realClassMapper;
private final Mapper realMemberMapper;
private final Mapper serializedClassMapper;
private final Mapper serializedMemberMapper;
private final Mapper shouldSerializeMemberMapper;
private final Mapper wrapped;
public MapperWrapper(Mapper mapper) {
this.wrapped = mapper;
if (!(mapper instanceof MapperWrapper)) {
this.aliasForAttributeMapper = mapper;
this.aliasForSystemAttributeMapper = mapper;
this.attributeForAliasMapper = mapper;
this.defaultImplementationOfMapper = mapper;
this.getConverterFromAttributeMapper = mapper;
this.getConverterFromItemTypeMapper = mapper;
this.getFieldNameForItemTypeAndNameMapper = mapper;
this.getImplicitCollectionDefForFieldNameMapper = mapper;
this.getItemTypeForItemFieldNameMapper = mapper;
this.getLocalConverterMapper = mapper;
this.isIgnoredElementMapper = mapper;
this.isImmutableValueTypeMapper = mapper;
this.isReferenceableMapper = mapper;
this.realClassMapper = mapper;
this.realMemberMapper = mapper;
this.serializedClassMapper = mapper;
this.serializedMemberMapper = mapper;
this.shouldSerializeMemberMapper = mapper;
return;
}
MapperWrapper mapperWrapper = (MapperWrapper) mapper;
HashMap hashMap = new HashMap();
hashMap.put("aliasForAttribute", mapperWrapper.aliasForAttributeMapper);
hashMap.put("aliasForSystemAttribute", mapperWrapper.aliasForSystemAttributeMapper);
hashMap.put("attributeForAlias", mapperWrapper.attributeForAliasMapper);
hashMap.put("defaultImplementationOf", mapperWrapper.defaultImplementationOfMapper);
hashMap.put("getConverterFromAttribute", mapperWrapper.getConverterFromAttributeMapper);
hashMap.put("getConverterFromItemType", mapperWrapper.getConverterFromItemTypeMapper);
hashMap.put("getFieldNameForItemTypeAndName", mapperWrapper.getFieldNameForItemTypeAndNameMapper);
hashMap.put("getImplicitCollectionDefForFieldName", mapperWrapper.getImplicitCollectionDefForFieldNameMapper);
hashMap.put("getItemTypeForItemFieldName", mapperWrapper.getItemTypeForItemFieldNameMapper);
String str = "getLocalConverter";
hashMap.put("getLocalConverter", mapperWrapper.getLocalConverterMapper);
hashMap.put("isIgnoredElement", mapperWrapper.isIgnoredElementMapper);
hashMap.put("isImmutableValueType", mapperWrapper.isImmutableValueTypeMapper);
hashMap.put("isReferenceable", mapperWrapper.isReferenceableMapper);
hashMap.put("realClass", mapperWrapper.realClassMapper);
hashMap.put("realMember", mapperWrapper.realMemberMapper);
hashMap.put("serializedClass", mapperWrapper.serializedClassMapper);
hashMap.put("serializedMember", mapperWrapper.serializedMemberMapper);
hashMap.put("shouldSerializeMember", mapperWrapper.shouldSerializeMemberMapper);
Method[] methods = mapper.getClass().getMethods();
int i = 0;
while (i < methods.length) {
Method method = methods[i];
Method[] methodArr = methods;
Class<?> declaringClass = method.getDeclaringClass();
Class<?> cls = class$com$thoughtworks$xstream$mapper$MapperWrapper;
if (cls == null) {
cls = class$("com.thoughtworks.xstream.mapper.MapperWrapper");
class$com$thoughtworks$xstream$mapper$MapperWrapper = cls;
}
String str2 = str;
if (declaringClass != cls) {
String name = method.getName();
if (hashMap.containsKey(name)) {
hashMap.put(name, mapper);
}
}
i++;
methods = methodArr;
str = str2;
}
this.aliasForAttributeMapper = (Mapper) hashMap.get("aliasForAttribute");
this.aliasForSystemAttributeMapper = (Mapper) hashMap.get("aliasForSystemAttribute");
this.attributeForAliasMapper = (Mapper) hashMap.get("attributeForAlias");
this.defaultImplementationOfMapper = (Mapper) hashMap.get("defaultImplementationOf");
this.getConverterFromAttributeMapper = (Mapper) hashMap.get("getConverterFromAttribute");
this.getConverterFromItemTypeMapper = (Mapper) hashMap.get("getConverterFromItemType");
this.getFieldNameForItemTypeAndNameMapper = (Mapper) hashMap.get("getFieldNameForItemTypeAndName");
this.getImplicitCollectionDefForFieldNameMapper = (Mapper) hashMap.get("getImplicitCollectionDefForFieldName");
this.getItemTypeForItemFieldNameMapper = (Mapper) hashMap.get("getItemTypeForItemFieldName");
this.getLocalConverterMapper = (Mapper) hashMap.get(str);
this.isIgnoredElementMapper = (Mapper) hashMap.get("isIgnoredElement");
this.isImmutableValueTypeMapper = (Mapper) hashMap.get("isImmutableValueType");
this.isReferenceableMapper = (Mapper) hashMap.get("isReferenceable");
this.realClassMapper = (Mapper) hashMap.get("realClass");
this.realMemberMapper = (Mapper) hashMap.get("realMember");
this.serializedClassMapper = (Mapper) hashMap.get("serializedClass");
this.serializedMemberMapper = (Mapper) hashMap.get("serializedMember");
this.shouldSerializeMemberMapper = (Mapper) hashMap.get("shouldSerializeMember");
}
static /* synthetic */ Class class$(String str) {
try {
return Class.forName(str);
} catch (ClassNotFoundException e) {
throw new NoClassDefFoundError().initCause(e);
}
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String aliasForAttribute(String str) {
return this.aliasForAttributeMapper.aliasForAttribute(str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String aliasForSystemAttribute(String str) {
return this.aliasForSystemAttributeMapper.aliasForSystemAttribute(str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String attributeForAlias(String str) {
return this.attributeForAliasMapper.attributeForAlias(str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public Class defaultImplementationOf(Class cls) {
return this.defaultImplementationOfMapper.defaultImplementationOf(cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public SingleValueConverter getConverterFromAttribute(String str) {
return this.getConverterFromAttributeMapper.getConverterFromAttribute(str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public SingleValueConverter getConverterFromItemType(String str, Class cls) {
return this.getConverterFromItemTypeMapper.getConverterFromItemType(str, cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String getFieldNameForItemTypeAndName(Class cls, Class cls2, String str) {
return this.getFieldNameForItemTypeAndNameMapper.getFieldNameForItemTypeAndName(cls, cls2, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class cls, String str) {
return this.getImplicitCollectionDefForFieldNameMapper.getImplicitCollectionDefForFieldName(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public Class getItemTypeForItemFieldName(Class cls, String str) {
return this.getItemTypeForItemFieldNameMapper.getItemTypeForItemFieldName(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public Converter getLocalConverter(Class cls, String str) {
return this.getLocalConverterMapper.getLocalConverter(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public boolean isIgnoredElement(String str) {
return this.isIgnoredElementMapper.isIgnoredElement(str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public boolean isImmutableValueType(Class cls) {
return this.isImmutableValueTypeMapper.isImmutableValueType(cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public boolean isReferenceable(Class cls) {
return this.isReferenceableMapper.isReferenceable(cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public Mapper lookupMapperOfType(Class cls) {
return cls.isAssignableFrom(getClass()) ? this : this.wrapped.lookupMapperOfType(cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public Class realClass(String str) {
return this.realClassMapper.realClass(str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String realMember(Class cls, String str) {
return this.realMemberMapper.realMember(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String serializedClass(Class cls) {
return this.serializedClassMapper.serializedClass(cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String serializedMember(Class cls, String str) {
return this.serializedMemberMapper.serializedMember(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public boolean shouldSerializeMember(Class cls, String str) {
return this.shouldSerializeMemberMapper.shouldSerializeMember(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String aliasForAttribute(Class cls, String str) {
return this.aliasForAttributeMapper.aliasForAttribute(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public String attributeForAlias(Class cls, String str) {
return this.attributeForAliasMapper.attributeForAlias(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public SingleValueConverter getConverterFromAttribute(Class cls, String str) {
return this.getConverterFromAttributeMapper.getConverterFromAttribute(cls, str);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public SingleValueConverter getConverterFromItemType(Class cls) {
return this.getConverterFromItemTypeMapper.getConverterFromItemType(cls);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public SingleValueConverter getConverterFromAttribute(Class cls, String str, Class cls2) {
return this.getConverterFromAttributeMapper.getConverterFromAttribute(cls, str, cls2);
}
@Override // com.thoughtworks.xstream.mapper.Mapper
public SingleValueConverter getConverterFromItemType(String str, Class cls, Class cls2) {
return this.getConverterFromItemTypeMapper.getConverterFromItemType(str, cls, cls2);
}
}