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


Java ConverterUtil.convertToDate方法代码示例

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


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

示例1: getDate

import org.apache.axis2.databinding.utils.ConverterUtil; //导入方法依赖的package包/类
/**
 * Create a Date object from the given date string.
 */
public static Date getDate(String value) throws DataServiceFault {
    /* if something goes wrong with converting the value to a date,
       * try with dateTime and get the date out it, this is because,
       * some service clients send a full date-time string for a date */
    try {
        java.util.Date date = ConverterUtil.convertToDate(value);
        if (null == date) {
            throw new DataServiceFault("Empty string or null value was found as date.");
        } else {
            return new Date(date.getTime());
        }
    } catch (Exception e) {
        java.util.Calendar calendarDate = ConverterUtil.convertToDateTime(value);
        if (null == calendarDate) {
            throw new DataServiceFault("Empty string or null value was found as date.");
        } else {
            return new Date(calendarDate.getTimeInMillis());
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-data,代码行数:24,代码来源:DBUtils.java

示例2: testPopulate

import org.apache.axis2.databinding.utils.ConverterUtil; //导入方法依赖的package包/类
public void testPopulate() throws Exception {

        Date date = null;

        for (int i = 0; i < values.length; i++) {
            date = ConverterUtil.convertToDate(values[i]);
            checkValue(xmlString[i],ConverterUtil.convertToString(date));
        }
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:10,代码来源:SimpleTypeDatePopulateTest.java

示例3: makeDate

import org.apache.axis2.databinding.utils.ConverterUtil; //导入方法依赖的package包/类
public static Object makeDate(String source) {
    return ConverterUtil.convertToDate(source);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:4,代码来源:SimpleTypeMapper.java

示例4: convertToDate

import org.apache.axis2.databinding.utils.ConverterUtil; //导入方法依赖的package包/类
public Date convertToDate(String s) {
    return ConverterUtil.convertToDate(s);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:4,代码来源:SimpleTypeHandler.java


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