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

Java Month类代码示例

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

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



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

示例1: bindCommonFields

import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
/**
 * binds the common fields to the form, such as periods and filters. Method to be called from the initDataBinder method
 * 
 * @param binder
 * @param settings
 */
protected static void bindCommonFields(final BeanBinder<? extends StatisticalQuery> binder, final LocalSettings settings) {
    binder.registerBinder("periodMain", DataBinderHelper.namedPeriodBinder(settings, "periodMain"));
    binder.registerBinder("periodComparedTo", DataBinderHelper.namedPeriodBinder(settings, "periodComparedTo"));
    binder.registerBinder("throughTimeRange", PropertyBinder.instance(ThroughTimeRange.class, "throughTimeRange"));
    binder.registerBinder("initialMonth", PropertyBinder.instance(Month.class, "initialMonth"));
    binder.registerBinder("finalMonth", PropertyBinder.instance(Month.class, "finalMonth"));
    binder.registerBinder("initialQuarter", PropertyBinder.instance(Quarter.class, "initialQuarter"));
    binder.registerBinder("finalQuarter", PropertyBinder.instance(Quarter.class, "finalQuarter"));
    binder.registerBinder("initialYear", PropertyBinder.instance(Integer.class, "initialYear"));
    binder.registerBinder("initialMonthYear", PropertyBinder.instance(Integer.class, "initialMonthYear"));
    binder.registerBinder("initialQuarterYear", PropertyBinder.instance(Integer.class, "initialQuarterYear"));
    binder.registerBinder("finalYear", PropertyBinder.instance(Integer.class, "finalYear"));
    binder.registerBinder("finalMonthYear", PropertyBinder.instance(Integer.class, "finalMonthYear"));
    binder.registerBinder("finalQuarterYear", PropertyBinder.instance(Integer.class, "finalQuarterYear"));
    binder.registerBinder("paymentFilter", PropertyBinder.instance(PaymentFilter.class, "paymentFilter", ReferenceConverter.instance(PaymentFilter.class)));
    binder.registerBinder("paymentFilters", SimpleCollectionBinder.instance(PaymentFilter.class, "paymentFilters", ReferenceConverter.instance(PaymentFilter.class)));
    binder.registerBinder("groupFilters", SimpleCollectionBinder.instance(GroupFilter.class, "groupFilters"));
    binder.registerBinder("groups", SimpleCollectionBinder.instance(Group.class, "groups"));
    binder.registerBinder("systemAccountFilter", PropertyBinder.instance(SystemAccountType.class, "systemAccountFilter"));
    binder.registerBinder("whatToShow", PropertyBinder.instance(StatisticsWhatToShow.class, "whatToShow"));
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:28,代码来源:StatisticsAction.java


示例2: getFinalMonth

import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public Month getFinalMonth() {
    return finalMonth;
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java


示例3: getInitialMonth

import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public Month getInitialMonth() {
    return initialMonth;
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java


示例4: setFinalMonth

import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public void setFinalMonth(final Month finalMonth) {
    this.finalMonth = finalMonth;
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java


示例5: setInitialMonth

import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public void setInitialMonth(final Month initialMonth) {
    this.initialMonth = initialMonth;
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java


示例6: prepareForm

import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
/**
 * This prepares the form. Some common fields are taken care of (Periods); all filters must be assigned by the descendant class prepareForm
 * method, which should call return super.prepareForm(context);
 */
@Override
protected QueryParameters prepareForm(final ActionContext context) {
    final StatisticsForm form = context.getForm();
    final StatisticalQuery query = getDataBinder().readFromString(form.getQuery());
    bindPeriods(query, form);

    // Send enums to JSP
    final HttpServletRequest request = context.getRequest();
    RequestHelper.storeEnum(request, StatisticsWhatToShow.class, "whatToShow");
    RequestHelper.storeEnum(request, ThroughTimeRange.class, "throughTimeRange");
    RequestHelper.storeEnum(request, Month.class, "months");
    RequestHelper.storeEnum(request, Quarter.class, "quarters");

    // Set default through time range
    if (form.getQuery("throughTimeRange") == null) {
        form.setQuery("throughTimeRange", ThroughTimeRange.MONTH);
    }

    // Set default initial and final months and years
    if (form.getQuery("initialMonth") == null) {
        final Map<String, Object> completedMonthAndYear = DateHelper.getLastCompletedMonthAndYear();
        final int lastCompletedMonth = (Integer) completedMonthAndYear.get("month");
        final int lastCompletedMonthYear = (Integer) completedMonthAndYear.get("year");
        form.setQuery("initialMonth", lastCompletedMonth);
        form.setQuery("initialMonthYear", lastCompletedMonthYear - 1);
        form.setQuery("finalMonth", lastCompletedMonth);
        form.setQuery("finalMonthYear", lastCompletedMonthYear);
    }

    // Set default initial and final quarters and years
    if (form.getQuery("initialQuarter") == null) {
        final Map<String, Object> completedQuarterAndYear = DateHelper.getLastCompletedQuarterAndYear();
        final Quarter lastCompletedQuarter = (Quarter) completedQuarterAndYear.get("quarter");
        final int lastCompletedQuarterYear = (Integer) completedQuarterAndYear.get("year");
        form.setQuery("initialQuarter", lastCompletedQuarter);
        form.setQuery("initialQuarterYear", lastCompletedQuarterYear - 1);
        form.setQuery("finalQuarter", lastCompletedQuarter);
        form.setQuery("finalQuarterYear", lastCompletedQuarterYear);
    }

    // Set default initial and final years
    if (form.getQuery("initialYear") == null) {
        final Calendar date = elementService.getFirstMemberActivationDate();
        int firstYear = 0;
        if (date != null) {
            firstYear = date.get(Calendar.YEAR);
        } else {
            firstYear = Calendar.getInstance().get(Calendar.YEAR);
        }
        final int currentYear = Calendar.getInstance().get(Calendar.YEAR);
        int lastYear = currentYear - 1;
        if (firstYear > lastYear) {
            // The systems started to run this year
            firstYear = currentYear;
            lastYear = currentYear;
        }
        form.setQuery("initialYear", firstYear);
        form.setQuery("finalYear", lastYear);
    }

    return query;
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:67,代码来源:StatisticsAction.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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