Java Code Examples for io.micronaut.core.reflect.ClassUtils#isPresent()

The following examples show how to use io.micronaut.core.reflect.ClassUtils#isPresent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdbiFactory.java    From micronaut-sql with Apache License 2.0 4 votes vote down vote up
private boolean h2IsPresent() {
    return ClassUtils.isPresent("org.h2.Driver", this.getClass().getClassLoader());
}
 
Example 2
Source File: HibernatePresenceCondition.java    From micronaut-sql with Apache License 2.0 4 votes vote down vote up
@Override
public boolean matches(ConditionContext context) {
    BeanContext beanContext = context.getBeanContext();
    return !ClassUtils.isPresent("io.micronaut.configuration.hibernate.jpa.HibernateTransactionManagerFactory", beanContext.getClassLoader());
}
 
Example 3
Source File: CalculatedSettings.java    From micronaut-sql with Apache License 2.0 4 votes vote down vote up
private boolean driverClassIsPresent(String className) {
    return ClassUtils.isPresent(className, this.getClass().getClassLoader());
}
 
Example 4
Source File: AbstractMicronautExtension.java    From micronaut-test with Apache License 2.0 2 votes vote down vote up
/**
 * @param requiredTestClass The test class
 * @return true if the te given class has a bean definition class in the classpath (ie: the annotation processor has been run correctly)
 */
protected boolean isTestSuiteBeanPresent(Class<?> requiredTestClass) {
    return ClassUtils.isPresent(requiredTestClass.getPackage().getName() + ".$" + requiredTestClass.getSimpleName() + "Definition", requiredTestClass.getClassLoader());
}