Browse Source

Merge pull request #143 in CORE/base-third from ~JU/base-third:release/10.0 to release/10.0

* commit '1bca05da286dec0b27448b6af1eb36926bbd4385':
  fix
final/10.0.3
ju 6 years ago
parent
commit
50f2af2f39
  1. 11
      fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/ClassFactory.java
  2. 16
      fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/TypeFactory.java

11
fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/ClassFactory.java

@ -0,0 +1,11 @@
package com.fr.third.fasterxml.jackson.databind.type;
/**
* Created by juhaoyu on 2018/11/5.
*/
public interface ClassFactory {
Class<?> classForName(String className);
Class<?> classForName(String className, ClassLoader classLoader);
}

16
fine-jackson/src/com/fr/third/fasterxml/jackson/databind/type/TypeFactory.java

@ -104,12 +104,20 @@ public final class TypeFactory
*/
protected final ClassLoader _classLoader;
private ClassFactory classFactory;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public void setClassFactory(ClassFactory classFactory) {
this.classFactory = classFactory;
}
private TypeFactory() {
_parser = new TypeParser(this);
_modifiers = null;
@ -247,10 +255,18 @@ public final class TypeFactory
protected Class<?> classForName(String name, boolean initialize,
ClassLoader loader) throws ClassNotFoundException {
if (classFactory != null) {
return classFactory.classForName(name, loader);
}
return Class.forName(name, true, loader);
}
protected Class<?> classForName(String name) throws ClassNotFoundException {
if (classFactory != null) {
return classFactory.classForName(name);
}
return Class.forName(name);
}

Loading…
Cancel
Save