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


Java DfReflectionUtil.getPublicMethod方法代码示例

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


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

示例1: digUpDbmsNativeProcessIdOf

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected Object digUpDbmsNativeProcessIdOf(Connection physicalConn) {
    final Class<?> connType = physicalConn.getClass();
    if (getMySQLConnectionClassFQCN().equals(connType.getName())) {
        final Method method = DfReflectionUtil.getPublicMethod(connType, "getId", (Class<?>[]) null);
        return DfReflectionUtil.invoke(method, physicalConn, (Object[]) null);
    }
    return null;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:9,代码来源:TransactionRomanticSnapshotBuilder.java

示例2: createDefaultSqlStringFilter

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected SqlStringFilter createDefaultSqlStringFilter(ConcurrentAsyncCall call) {
    final Method entryMethod = ThreadCacheContext.findEntryMethod();
    if (entryMethod != null) {
        return newDefaultSqlStringFilter(call, entryMethod, "(via " + DfTypeUtil.toClassTitle(call) + ")");
    }
    try {
        final Method callbackMethod = DfReflectionUtil.getPublicMethod(call.getClass(), "callback", null);
        if (callbackMethod != null) {
            return newDefaultSqlStringFilter(call, callbackMethod, null);
        }
    } catch (RuntimeException ignored) {}
    return null;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:14,代码来源:SimpleAsyncManager.java

示例3: invokeMethod

import org.dbflute.util.DfReflectionUtil; //导入方法依赖的package包/类
protected HandyDate invokeMethod(String relativeDate, HandyDate handyDate, String methodCall) {
    if (!methodCall.contains("(") || !methodCall.endsWith(")")) {
        throwRelativeDateMethodArgPartNotFoundException(relativeDate);
    }
    final String methodName = Srl.substringFirstFront(methodCall, "(");
    final String methodArgsPart = Srl.substringFirstFront(Srl.substringFirstRear(methodCall, "("), ")");
    final List<String> argElementList;
    if (Srl.is_NotNull_and_NotTrimmedEmpty(methodArgsPart)) {
        argElementList = Srl.splitListTrimmed(methodArgsPart, ",");
    } else {
        argElementList = DfCollectionUtil.emptyList();
    }
    final List<Object> argValueList = DfCollectionUtil.newArrayList();
    for (String arg : argElementList) {
        if (isNumber(arg)) {
            argValueList.add(DfTypeUtil.toInteger(arg)); // int only supported (cannot use long)
        } else {
            argValueList.add(arg);
        }
    }
    final List<Class<?>> argTypeList = DfCollectionUtil.newArrayList();
    for (Object argValue : argValueList) {
        final Class<? extends Object> argType = argValue.getClass();
        if (Integer.class.equals(argType)) {
            // even if the argument value is int type, getClass() returns Integer type
            argTypeList.add(int.class);
        } else {
            argTypeList.add(argType);
        }
    }
    final Class<?>[] argTypes = argTypeList.toArray(new Class<?>[argTypeList.size()]);
    final Class<HandyDate> handyDateType = HandyDate.class;
    final Method method = DfReflectionUtil.getPublicMethod(handyDateType, methodName, argTypes);
    if (method == null) {
        throwRelativeDateMethodNotFoundException(relativeDate, handyDateType, methodName, argTypes);
    }
    try {
        handyDate = (HandyDate) DfReflectionUtil.invoke(method, handyDate, argValueList.toArray());
    } catch (ReflectionFailureException e) {
        throwRelativeDateInvokeFailureException(relativeDate, handyDateType, methodName, e);
    }
    return handyDate;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:44,代码来源:RelativeDateScript.java


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