what-the-bank/sources/org/simpleframework/xml/convert/RegistryBinder.java

27 lines
750 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.simpleframework.xml.convert;
import org.simpleframework.xml.util.Cache;
import org.simpleframework.xml.util.ConcurrentCache;
/* loaded from: classes6.dex */
class RegistryBinder {
private final Cache<Class> cache = new ConcurrentCache();
private final ConverterFactory factory = new ConverterFactory();
public Converter lookup(Class cls) throws Exception {
Class fetch = this.cache.fetch(cls);
if (fetch != null) {
return create(fetch);
}
return null;
}
private Converter create(Class cls) throws Exception {
return this.factory.getInstance(cls);
}
public void bind(Class cls, Class cls2) throws Exception {
this.cache.cache(cls, cls2);
}
}