- java.lang.Object
-
- io.ebean.config.ClassLoadConfig
-
public class ClassLoadConfig extends Object
Helper to find classes taking into account the context class loader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classClassLoadConfig.ClassLoaderContextWraps the preferred, caller and context class loaders.
-
Field Summary
Fields Modifier and Type Field Description protected ClassLoadConfig.ClassLoaderContextcontext
-
Constructor Summary
Constructors Constructor Description ClassLoadConfig()Construct with the default classLoader search with context classLoader first.ClassLoadConfig(ClassLoader classLoader)Specify the classLoader to use for class detection and new instance creation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>forName(String name)Load a class taking into account a context class loader (if present).ClassLoadergetClassLoader()Return the classLoader to use for service loading etc.booleanisJacksonAnnotationsPresent()Return true if Jackson annotations like JsonIgnore are present.booleanisJacksonCorePresent()booleanisJacksonObjectMapperPresent()Return true if Jackson ObjectMapper is present.booleanisJakartaValidationAnnotationsPresent()Return true if jakarta validation annotations like Size and NotNull are present.booleanisJavaxPostConstructPresent()Return true if javax PostConstruct annotation is present (maybe not in java9).booleanisJavaxValidationAnnotationsPresent()Return true if javax validation annotations like Size and NotNull are present.booleanisJodaTimePresent()Return true if the Joda types are available and should be supported.booleanisPresent(String className)Return true if the given class is present.ObjectnewInstance(String className)Return a new instance of the class using the default constructor.
-
-
-
Field Detail
-
context
protected final ClassLoadConfig.ClassLoaderContext context
-
-
Constructor Detail
-
ClassLoadConfig
public ClassLoadConfig()
Construct with the default classLoader search with context classLoader first.
-
ClassLoadConfig
public ClassLoadConfig(ClassLoader classLoader)
Specify the classLoader to use for class detection and new instance creation.
-
-
Method Detail
-
isJodaTimePresent
public boolean isJodaTimePresent()
Return true if the Joda types are available and should be supported.
-
isJavaxValidationAnnotationsPresent
public boolean isJavaxValidationAnnotationsPresent()
Return true if javax validation annotations like Size and NotNull are present.
-
isJakartaValidationAnnotationsPresent
public boolean isJakartaValidationAnnotationsPresent()
Return true if jakarta validation annotations like Size and NotNull are present.
-
isJavaxPostConstructPresent
public boolean isJavaxPostConstructPresent()
Return true if javax PostConstruct annotation is present (maybe not in java9). If not we don't support PostConstruct lifecycle events.
-
isJacksonAnnotationsPresent
public boolean isJacksonAnnotationsPresent()
Return true if Jackson annotations like JsonIgnore are present.
-
isJacksonCorePresent
public boolean isJacksonCorePresent()
-
isJacksonObjectMapperPresent
public boolean isJacksonObjectMapperPresent()
Return true if Jackson ObjectMapper is present.
-
newInstance
public Object newInstance(String className)
Return a new instance of the class using the default constructor.
-
isPresent
public boolean isPresent(String className)
Return true if the given class is present.
-
forName
protected Class<?> forName(String name) throws ClassNotFoundException
Load a class taking into account a context class loader (if present).- Throws:
ClassNotFoundException
-
getClassLoader
public ClassLoader getClassLoader()
Return the classLoader to use for service loading etc.
-
-