org.jtwig.reflection.model.java.JavaClassManager Maven / Gradle / Ivy
package org.jtwig.reflection.model.java;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public class JavaClassManager {
private static JavaClassManager INSTANCE = new JavaClassManager(new JavaClassFactory(), new ConcurrentHashMap());
public static JavaClassManager classManager () {
return INSTANCE;
}
private final JavaClassFactory javaClassFactory;
private final ConcurrentMap javaClassMap;
public JavaClassManager(JavaClassFactory javaClassFactory, ConcurrentMap javaClassMap) {
this.javaClassFactory = javaClassFactory;
this.javaClassMap = javaClassMap;
}
public JavaClass metadata (Class type) {
if (!javaClassMap.containsKey(type)) {
javaClassMap.put(type, javaClassFactory.create(type));
}
return javaClassMap.get(type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy