当前位置: 首页>>代码示例>>Java>>正文


Java DfReflectionUtil.getValueForcedly方法代码示例

本文整理汇总了Java中org.dbflute.util.DfReflectionUtil.getValueForcedly方法的典型用法代码示例。如果您正苦于以下问题:Java DfReflectionUtil.getValueForcedly方法的具体用法?Java DfReflectionUtil.getValueForcedly怎么用?Java DfReflectionUtil.getValueForcedly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dbflute.util.DfReflectionUtil的用法示例。


在下文中一共展示了DfReflectionUtil.getValueForcedly方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupTransactionViewListByReflection

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected void setupTransactionViewListByReflection(ConnectionPool pool, List<String> txViewList) {
    final Field field = DfReflectionUtil.getWholeField(pool.getClass(), "txActivePool");
    @SuppressWarnings("unchecked")
    final Map<Transaction, ConnectionWrapper> txActivePool =
            (Map<Transaction, ConnectionWrapper>) DfReflectionUtil.getValueForcedly(field, pool);
    synchronized (pool) { // just in case
        for (Entry<Transaction, ConnectionWrapper> entry : txActivePool.entrySet()) {
            final Transaction tx = entry.getKey();
            final ConnectionWrapper wrapper = entry.getValue();
            final String romantic;
            if (tx instanceof RomanticTransaction) {
                romantic = ((RomanticTransaction) tx).toRomanticSnapshot(wrapper);
            } else {
                romantic = tx.toString();
            }
            txViewList.add(romantic);
        }
    }
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:20,代码来源:ConnectionPoolViewBuilder.java

示例2: switchFactories

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected void switchFactories(Gson newGson) {
    final Field factoriesField = DfReflectionUtil.getWholeField(newGson.getClass(), "factories");
    @SuppressWarnings("unchecked")
    final List<Object> factories = (List<Object>) DfReflectionUtil.getValueForcedly(factoriesField, newGson);
    final List<Object> filtered = new ArrayList<Object>();
    for (Object factory : factories) {
        if (factory instanceof ReflectiveTypeAdapterFactory) { // switched, only one time
            filtered.add(createReflectiveTypeAdapterFactory(newGson, factory));
        } else {
            filtered.add(factory);
        }
    }
    DfReflectionUtil.setValueForcedly(factoriesField, newGson, Collections.unmodifiableList(filtered));
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:15,代码来源:GsonJsonEngine.java

示例3: getConstructorConstructor

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected ConstructorConstructor getConstructorConstructor(Object factory) {
    final Field field = DfReflectionUtil.getWholeField(factory.getClass(), "constructorConstructor");
    return (ConstructorConstructor) DfReflectionUtil.getValueForcedly(field, factory);
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:5,代码来源:GsonJsonEngine.java

示例4: getJsonAdapterFactory

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected JsonAdapterAnnotationTypeAdapterFactory getJsonAdapterFactory(Object factory) {
    final Field field = DfReflectionUtil.getWholeField(factory.getClass(), "jsonAdapterFactory");
    return (JsonAdapterAnnotationTypeAdapterFactory) DfReflectionUtil.getValueForcedly(field, factory);
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:5,代码来源:GsonJsonEngine.java

示例5: getFieldConnection

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected Connection getFieldConnection(Connection conn, String fieldName) {
    Field field = DfReflectionUtil.getWholeField(conn.getClass(), fieldName);
    return (Connection)DfReflectionUtil.getValueForcedly(field, conn);
}
 
开发者ID:lastaflute,项目名称:lastaflute-example-harbor,代码行数:5,代码来源:DBFluteConfig.java


注:本文中的org.dbflute.util.DfReflectionUtil.getValueForcedly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。