kerry
6 years ago
11 changed files with 82 additions and 10 deletions
@ -0,0 +1,40 @@
|
||||
package com.fr.third.org.hibernate.tuple.entity; |
||||
|
||||
import java.util.Map; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
|
||||
/** |
||||
* Created by Zed on 2018/11/1. |
||||
*/ |
||||
public class DefaultEntityRegister { |
||||
|
||||
private static volatile DefaultEntityRegister instance; |
||||
private static Map<Class, Class> MAP = new ConcurrentHashMap<Class, Class>(); |
||||
|
||||
public static DefaultEntityRegister getInstance() { |
||||
if (instance == null) { |
||||
synchronized (DefaultEntityRegister.class) { |
||||
if (instance == null) { |
||||
instance = new DefaultEntityRegister(); |
||||
} |
||||
} |
||||
} |
||||
return instance; |
||||
} |
||||
|
||||
private DefaultEntityRegister() { |
||||
|
||||
} |
||||
|
||||
public void registerDefaultClass(Class abstractEntityClass, Class defaultEntityClass) { |
||||
MAP.put(abstractEntityClass, defaultEntityClass); |
||||
} |
||||
|
||||
public void removeDefaultClass(Class abstractEntityClass) { |
||||
MAP.remove(abstractEntityClass); |
||||
} |
||||
|
||||
public Class getDefaultEntityClass(Class abstractEntityClass) { |
||||
return MAP.get(abstractEntityClass); |
||||
} |
||||
} |
@ -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) throws ClassNotFoundException; |
||||
|
||||
Class<?> classForName(String className, ClassLoader classLoader) throws ClassNotFoundException; |
||||
} |
Loading…
Reference in new issue