本文整理了Java中org.apache.axis2.databinding.utils.ConverterUtil.convertToDate()
方法的一些代码示例,展示了ConverterUtil.convertToDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConverterUtil.convertToDate()
方法的具体详情如下:
包路径:org.apache.axis2.databinding.utils.ConverterUtil
类名称:ConverterUtil
方法名:convertToDate
[英]Converts a given string into a date. Code from Axis1 DateDeserializer.
[中]将给定字符串转换为日期。来自Axis1 DateDeserializer的代码。
代码示例来源:origin: org.apache.axis2/axis2-adb
public static Object makeDate(String source) {
return ConverterUtil.convertToDate(source);
}
代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core
/**
* 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());
}
}
}
代码示例来源:origin: org.apache.axis2/axis2-adb
if (o != null) {
if (o instanceof String) {
array[i] = ConverterUtil.convertToDate(o.toString());
} else if (o instanceof Date) {
array[i] = (Date) o;
代码示例来源:origin: apache/axis2-java
public static Object makeDate(String source) {
return ConverterUtil.convertToDate(source);
}
代码示例来源:origin: apache/axis2-java
if (o != null) {
if (o instanceof String) {
array[i] = ConverterUtil.convertToDate(o.toString());
} else if (o instanceof Date) {
array[i] = (Date) o;
代码示例来源:origin: org.apache.axis2/axis2-adb
public static long compare(Date date, String value) {
Date newDate = convertToDate(value);
return date.getTime() - newDate.getTime();
}
代码示例来源:origin: org.apache.axis2/axis2-adb
setObject(new URI(value));
} else if ("date".equals(type)) {
setObject(ConverterUtil.convertToDate(value));
} else if ("QName".equals(type)) {
if (value.indexOf(":") > 0) {
代码示例来源:origin: apache/axis2-java
public static long compare(Date date, String value) {
Date newDate = convertToDate(value);
return date.getTime() - newDate.getTime();
}
代码示例来源:origin: apache/axis2-java
setObject(new URI(value));
} else if ("date".equals(type)) {
setObject(ConverterUtil.convertToDate(value));
} else if ("QName".equals(type)) {
if (value.indexOf(":") > 0) {
代码示例来源:origin: org.apache.axis2/axis2-adb
public static Date fromString(java.lang.String value,
java.lang.String namespaceURI){
Date returnValue = new Date();
returnValue.setDate(
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(value));
return returnValue;
}
代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core
} else if (colType.equals(XSDDatatype.XSDdate.getURI())) {
return ConverterUtil.convertToString(ConverterUtil
.convertToDate(soln.getLiteral(colName).getString()));
} else if (colType.equals(XSDDatatype.XSDdateTime.getURI())) {
return ConverterUtil
代码示例来源:origin: org.apache.axis2/axis2-adb
public static Date fromString(java.lang.String value,
java.lang.String namespaceURI){
Date returnValue = new Date();
returnValue.setDate(
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(value));
return returnValue;
}
代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core
} else if (colType.equals(XSDDatatype.XSDdate.getURI())) {
return ConverterUtil.convertToString(ConverterUtil
.convertToDate(soln.getLiteral(colName).getString()));
} else if (colType.equals(XSDDatatype.XSDdateTime.getURI())) {
return ConverterUtil
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.rulecep.adapters
/**
* Extracts data from the payload using the provided XPath and converts into a Date
*
* @param xpath xpath to be used to extract the data
* @return <code>Date</code> if it is possible to create a date,
* otherwise throws an exception
*/
public Date selectDate(String xpath) {
Object o = select(xpath);
if (o instanceof Date) {
return (Date) o;
} else if (o instanceof String) {
return ConverterUtil.convertToDate((String) o);
} else {
throw new LoggedRuntimeException("Invalid XPath : " + xpath + " Can not select" +
" a date from the value : " + o, log);
}
}
代码示例来源:origin: org.apache.axis2/axis2-adb
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(content));
代码示例来源:origin: org.apache.axis2/axis2-adb
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(content));
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.event.stub
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(content));
代码示例来源:origin: org.wso2.dss/dataservice-client-samples
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(tempAttribPaymentDate));
代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.keymgt.stub
org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(content));
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.event.core
subscriptionDetails.setId(subscription.getProperty("Name"));
subscriptionDetails.setOwner(subscription.getProperty("Owner"));
subscriptionDetails.setCreatedTime(ConverterUtil.convertToDate(subscription.getProperty("createdTime")));
内容来源于网络,如有侵权,请联系作者删除!