• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DfTypeUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



DfTypeUtil类属于org.dbflute.util包,在下文中一共展示了DfTypeUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final StringBuilder sb = new StringBuilder();
    final String title = DfTypeUtil.toClassTitle(this);
    sb.append(title).append(":{");
    sb.append("application=");
    if (cachedAppMessageName != null) {
        sb.append(cachedAppMessageName);
    } else {
        sb.append("not initialized yet");
    }
    final Set<String> cachedSet = bundleCacheMap.keySet();
    sb.append(", cached=[");
    if (!cachedSet.isEmpty()) {
        buildCacheDisplay(sb);
    } else {
        sb.append("no cached bundle");
    }
    sb.append("]}");
    return sb.toString();
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:22,代码来源:ObjectiveMessageResources.java


示例2: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final StringBuilder sb = new StringBuilder();
    sb.append("runtime:{");
    sb.append(requestPath);
    sb.append(", ").append(execute.toSimpleMethodExp());
    sb.append(", ").append(pathParam); // e.g. pathParam:{{}}
    if (actionResponse != null) {
        sb.append(", ").append(actionResponse); // e.g. JsonResponse:{...}
    }
    if (failureCause != null) {
        sb.append(", *").append(DfTypeUtil.toClassTitle(failureCause)); // e.g. *SeaException
    }
    if (validationErrors != null) {
        sb.append(", errors=").append(validationErrors.toPropertySet());
    }
    if (displayDataMap != null) {
        sb.append(", display=").append(displayDataMap.keySet());
    }
    sb.append("}");
    return sb.toString();
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:23,代码来源:ActionRuntime.java


示例3: read

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public NUM read(JsonReader in) throws IOException { // not use real adapter for options
    if (in.peek() == JsonToken.NULL) {
        in.nextNull();
        return null;
    }
    final String str = filterReading(in.nextString());
    if (isEmptyToNullReading() && "".equals(str)) {
        return null;
    }
    try {
        if (str != null && str.trim().isEmpty()) { // e.g. "" or " "
            // toNumber() treats empty as null so throw to keep Gson behavior 
            throw new NumberFormatException("because of empty string: [" + str + "]");
        }
        @SuppressWarnings("unchecked")
        final NUM num = (NUM) DfTypeUtil.toNumber(str, getNumberType());
        return num;
    } catch (RuntimeException e) {
        throwJsonPropertyNumberParseFailureException(in, e);
        return null; // unreachable
    }
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:24,代码来源:NumberGsonAdaptable.java


示例4: deriveExpression

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected static String deriveExpression(Object obj, Map<Object, String> alreadyAppearedSet, Supplier<String> beanResolver) {
    final String exp;
    if (obj == null) {
        exp = "null";
    } else if (obj instanceof String) {
        exp = (String) obj;
    } else if (obj instanceof Number) {
        exp = obj.toString();
    } else if (DfTypeUtil.isAnyLocalDate(obj)) {
        exp = obj.toString();
    } else if (obj instanceof Classification) {
        exp = ((Classification) obj).code();
    } else if (obj instanceof List) {
        @SuppressWarnings("unchecked")
        final List<? extends Object> list = (List<? extends Object>) obj;
        exp = buildListString(list, alreadyAppearedSet);
    } else if (obj instanceof Object[]) {
        exp = buildListString(Arrays.asList(((Object[]) obj)), alreadyAppearedSet);
    } else {
        exp = beanResolver.get();
    }
    return exp;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:24,代码来源:Lato.java


示例5: convertToResultBeans

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected List<MemberSearchRowBean> convertToResultBeans(PagingResultBean<Member> page) {
    List<MemberSearchRowBean> beanList = page.stream().map(member -> {
        MemberSearchRowBean bean = new MemberSearchRowBean();
        bean.setMemberId(member.getMemberId());
        bean.memberName = member.getMemberName();
        member.getMemberStatus().alwaysPresent(status -> {
            bean.memberStatusName = status.getMemberStatusName();
        });
        bean.formalizedDate = DfTypeUtil.toStringDate(member.getFormalizedDatetime(), "yyyy/MM/dd");
        bean.updateDatetime = DfTypeUtil.toStringDate(member.getUpdateDatetime(), "yyyy/MM/dd");
        bean.withdrawalMember = member.isMemberStatusCodeWithdrawal();
        bean.purchaseCount = member.getPurchaseCount();
        return bean;
    }).collect(Collectors.toList());
    return beanList;
}
 
开发者ID:dbflute-example,项目名称:dbflute-example-on-springboot,代码行数:17,代码来源:MemberController.java


示例6: cannotBeValidatable

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
public static boolean cannotBeValidatable(Object value) { // called by e.g. ResponseBeanValidator
    return value instanceof String // yes-yes-yes 
            || value instanceof Number // e.g. Integer
            || DfTypeUtil.isAnyLocalDate(value) // e.g. LocalDate
            || value instanceof Boolean // of course
            || value instanceof Classification // e.g. CDef
            || value.getClass().isPrimitive() // probably no way, just in case
    ;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:10,代码来源:ActionValidator.java


示例7: determineValid

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected boolean determineValid(String value) {
    if (value != null && !value.isEmpty()) {
        try {
            DfTypeUtil.toBoolean(value);
            return true;
        } catch (ParseBooleanException ignored) {
            return false;
        }
    } else {
        return true;
    }
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:13,代码来源:BooleanTypeValidator.java


示例8: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String classTitle = DfTypeUtil.toClassTitle(this);
    final String emptyExp = returnAsEmptyBody ? ", emptyBody" : "";
    final String undefinedExp = undefined ? ", undefined" : "";
    return classTitle + ":{" + fileName + ", " + contentType + ", " + headerMap + emptyExp + undefinedExp + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:StreamResponse.java


示例9: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String classTitle = DfTypeUtil.toClassTitle(this);
    final String emptyExp = returnAsEmptyBody ? ", emptyBody" : "";
    final String undefinedExp = undefined ? ", undefined" : "";
    final String directExp = returnAsHtmlDirectly ? ", directly" : "";
    return classTitle + ":{" + nextRouting + emptyExp + directExp + undefinedExp + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:9,代码来源:HtmlResponse.java


示例10: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String classTitle = DfTypeUtil.toClassTitle(this);
    final String jsonExp = jsonResult != null ? DfTypeUtil.toClassTitle(jsonResult) : null;
    final String callbackExp = callback != null ? ", callback=" + callback : "";
    final String forcedlyJSExp = forcedlyJavaScript ? ", JavaScript" : "";
    final String emptyExp = returnAsEmptyBody ? ", emptyBody" : "";
    final String directExp = returnAsJsonDirectly ? ", directly" : "";
    final String undefinedExp = undefined ? ", undefined" : "";
    return classTitle + ":{" + jsonExp + callbackExp + forcedlyJSExp + emptyExp + directExp + undefinedExp + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:12,代码来源:JsonResponse.java


示例11: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String classTitle = DfTypeUtil.toClassTitle(this);
    final String emptyExp = returnAsEmptyBody ? ", emptyBody" : "";
    final String undefinedExp = undefined ? ", undefined" : "";
    return classTitle + ":{" + encoding + emptyExp + undefinedExp + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:XmlResponse.java


示例12: setupPerformance

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected void setupPerformance(StringBuilder sb, RequestManager requestManager, InOutLogKeeper keeper) {
    final String performanceCost = keeper.getBeginDateTime().map(begin -> {
        final long before = DfTypeUtil.toDate(begin).getTime();
        final long after = DfTypeUtil.toDate(flashDateTime(requestManager)).getTime();
        return DfTraceViewUtil.convertToPerformanceView(after - before);
    }).orElse("no ended");
    sb.append(" [").append(performanceCost).append("]");
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:9,代码来源:InOutLogger.java


示例13: doFilterPathParam

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected Object doFilterPathParam(ActionExecute execute, int index, Class<?> paramType, Map<Integer, Class<?>> optGenTypeMap,
        String exp) {
    final Object filtered;
    if (paramType.isPrimitive()) {
        filtered = DfTypeUtil.toWrapper(exp, paramType);
    } else if (Number.class.isAssignableFrom(paramType)) {
        filtered = DfTypeUtil.toNumber(exp, paramType);
        // old date types are unsupported for LocalDate invitation
        //} else if (Timestamp.class.isAssignableFrom(paramType)) {
        //    filtered = DfTypeUtil.toTimestamp(exp);
        //} else if (Time.class.isAssignableFrom(paramType)) {
        //    filtered = DfTypeUtil.toTime(exp);
        //} else if (java.util.Date.class.isAssignableFrom(paramType)) {
        //    filtered = DfTypeUtil.toDate(exp);
    } else if (LocalDate.class.isAssignableFrom(paramType)) { // #date_parade
        filtered = DfTypeUtil.toLocalDate(exp);
    } else if (LocalDateTime.class.isAssignableFrom(paramType)) {
        filtered = DfTypeUtil.toLocalDateTime(exp);
    } else if (LocalTime.class.isAssignableFrom(paramType)) {
        filtered = DfTypeUtil.toLocalTime(exp);
    } else if (Boolean.class.isAssignableFrom(paramType)) {
        filtered = DfTypeUtil.toBoolean(exp);
    } else if (LaClassificationUtil.isCls(paramType)) {
        filtered = toVerifiedClassification(execute, paramType, exp);
    } else if (isOptionalParameterType(paramType)) {
        final Class<?> optGenType = optGenTypeMap.get(index);
        if (optGenType != null) {
            final Object paramValue = doFilterPathParam(execute, index, optGenType, optGenTypeMap, exp);
            filtered = createPresentOptional(paramType, paramValue);
        } else { // basically no way
            throwOptionalGenericTypeNotFoundException(execute, index, paramType, optGenTypeMap, exp);
            return null; // unreachable
        }
    } else {
        filtered = exp;
    }
    return filtered;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:39,代码来源:RequestPathParamAnalyzer.java


示例14: toBoolean

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected Object toBoolean(Object exp, FormMappingOption option) {
    final Object converted;
    if (isCheckboxOn(exp)) {
        converted = true;
    } else {
        if (exp instanceof String && ((String) exp).isEmpty()) { // pinpoint patch
            converted = null; // toBoolean("") before DBFlute-1.1.3 throws exception so avoid it
        } else {
            converted = DfTypeUtil.toBoolean(exp);
        }
    }
    return converted;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:14,代码来源:ActionFormMapper.java


示例15: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String title = DfTypeUtil.toClassTitle(this);
    return title + ":{" + htmlBeanValidationErrorWarned + ", " + htmlBeanValidatorSuppressed // html
            + ", " + jsonBeanValidationErrorWarned + ", " + jsonBeanValidatorSuppressed // json
            + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:ResponseReflectingOption.java


示例16: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String title = DfTypeUtil.toClassTitle(this);
    return title + ":{" + keepEmptyStringParameter + ", " + simpleTextParameterFilter + ", " + undefinedParameterError + ", "
            + indefinableParameterSet + ", " + yourCollectionResourceList + ", " + zonedDateTimeFormatter + ", "
            + requestParameterMapFilter + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:FormMappingOption.java


示例17: createMemoriesProvider

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
public static TransactionMemoriesProvider createMemoriesProvider(RomanticTransaction tx, String ending) {
    final String title = DfTypeUtil.toClassTitle(tx);
    final int hash = tx.hashCode();
    final long beginMillis = tx.getTransactionBeginMillis();
    final Map<String, Set<String>> tableCommandMap = tx.getReadOnlyTableCommandMap();
    final List<TransactionSavedRecentResult> recentResultList = tx.getReadOnlyRecentResultList();
    final TransactionRomanticMemoriesBuilder builder =
            new TransactionRomanticMemoriesBuilder(title, hash, beginMillis, tableCommandMap, recentResultList);
    return () -> builder.buildRomanticMemories(ending);
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:11,代码来源:TransactionRomanticMemoriesBuilder.java


示例18: doResolveRelativeDate

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected String doResolveRelativeDate(String relativeDate, Date date) {
    final String calcPart = relativeDate.trim();
    if (calcPart.trim().length() == 0 || date.after(LIMIT_DATE)) {
        return DfTypeUtil.toString(date, RESOLVED_PATTERN);
    }
    final List<String> methodList = Srl.splitListTrimmed(Srl.trim(calcPart, "."), ".");
    HandyDate handyDate = new HandyDate(date);
    for (String methodCall : methodList) {
        handyDate = invokeMethod(relativeDate, handyDate, methodCall);
    }
    return DfTypeUtil.toString(handyDate.getDate(), RESOLVED_PATTERN);
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:13,代码来源:RelativeDateScript.java


示例19: toString

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
@Override
public String toString() {
    final String classTitle = DfTypeUtil.toClassTitle(this);
    final String currentTimeExp = DfTypeUtil.toClassTitle(currentTimeProvider);
    final String finalZoneExp = DfTypeUtil.toClassTitle(finalTimeZoneProvider);
    return classTitle + ":{" + currentTimeExp + ", " + finalZoneExp + "}";
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:8,代码来源:TypicalBusinessTimeHandler.java


示例20: showBootLogging

import org.dbflute.util.DfTypeUtil; //导入依赖的package包/类
protected void showBootLogging() {
    if (logger.isInfoEnabled()) {
        logger.info("[JSON Manager]");
        logger.info(" realJsonParser: " + DfTypeUtil.toClassTitle(realJsonParser));
        final String adjustment = buildAdjustmentExp();
        if (!adjustment.isEmpty()) {
            logger.info(" adjustment: " + adjustment);
        }
        if (jsonMappingOption.isPresent()) { // not use lambda to keep log indent
            logger.info(" option: " + jsonMappingOption.get());
        }
    }
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:14,代码来源:SimpleJsonManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SnapshotOffer类代码示例发布时间:2022-05-23
下一篇:
Java JsonGenerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap