Example usage for org.apache.ibatis.reflection MetaClass forClass

List of usage examples for org.apache.ibatis.reflection MetaClass forClass

Introduction

In this page you can find the example usage for org.apache.ibatis.reflection MetaClass forClass.

Prototype

public static MetaClass forClass(Class<?> type, ReflectorFactory reflectorFactory) 

Source Link

Usage

From source file:com.baomidou.mybatisplus.MybatisXMLConfigBuilder.java

License:Apache License

private Properties settingsAsProperties(XNode context) {
    if (context == null) {
        return new Properties();
    }/*from  w w  w .j av a 2  s  .co  m*/
    Properties props = context.getChildrenAsProperties();
    // Check that all settings are known to the configuration class
    MetaClass metaConfig = MetaClass.forClass(Configuration.class, localReflectorFactory);
    for (Object key : props.keySet()) {
        if (!metaConfig.hasSetter(String.valueOf(key))) {
            throw new BuilderException("The setting " + key
                    + " is not known.  Make sure you spelled it correctly (case sensitive).");
        }
    }
    return props;
}

From source file:com.mybatisX.core.MybatisXMLConfigBuilder.java

License:Apache License

private Properties settingsAsPropertiess(XNode context) {
    if (context == null) {
        return new Properties();
    }/*from ww  w  .j a  v  a 2  s  . com*/
    Properties props = context.getChildrenAsProperties();
    // Check that all settings are known to the configuration class
    MetaClass metaConfig = MetaClass.forClass(Configuration.class, localReflectorFactory);
    for (Object key : props.keySet()) {
        if (!metaConfig.hasSetter(String.valueOf(key))) {
            throw new BuilderException("The setting " + key
                    + " is not known.  Make sure you spelled it correctly (case sensitive).");
        }
    }
    return props;
}