本文整理汇总了Java中javax.xml.datatype.XMLGregorianCalendar类的典型用法代码示例。如果您正苦于以下问题:Java XMLGregorianCalendar类的具体用法?Java XMLGregorianCalendar怎么用?Java XMLGregorianCalendar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XMLGregorianCalendar类属于javax.xml.datatype包,在下文中一共展示了XMLGregorianCalendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Command line entry point.
*/
public static void main(String[] args) {
// Get a client connection.
// Make sure you've set the variables in FBAInboundServiceMWSSampleConfig.
FBAInboundServiceMWSClient client = FBAInboundServiceMWSSampleConfig.getClient();
// Create a request.
ListInboundShipmentItemsRequest request = new ListInboundShipmentItemsRequest();
String sellerId = "example";
request.setSellerId(sellerId);
String mwsAuthToken = "example";
request.setMWSAuthToken(mwsAuthToken);
String marketplace = "example";
request.setMarketplace(marketplace);
String shipmentId = "example";
request.setShipmentId(shipmentId);
XMLGregorianCalendar lastUpdatedBefore = MwsUtl.getDTF().newXMLGregorianCalendar();
request.setLastUpdatedBefore(lastUpdatedBefore);
XMLGregorianCalendar lastUpdatedAfter = MwsUtl.getDTF().newXMLGregorianCalendar();
request.setLastUpdatedAfter(lastUpdatedAfter);
// Make the call.
ListInboundShipmentItemsSample.invokeListInboundShipmentItems(client, request);
}
开发者ID:trifonnt,项目名称:ext-lib-amazon-mws-fulfillment-inbound-shipment,代码行数:29,代码来源:ListInboundShipmentItemsSample.java
示例2: deserialze
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
Object value = DateCodec.instance.deserialze(parser, type, fieldName);
if (value instanceof Calendar) {
return (T) value;
}
Date date = (Date) value;
if (date == null) {
return null;
}
JSONLexer lexer = parser.lexer;
Calendar calendar = Calendar.getInstance(lexer.getTimeZone(), lexer.getLocale());
calendar.setTime(date);
if (type == XMLGregorianCalendar.class) {
return (T) createXMLGregorianCalendar((GregorianCalendar) calendar);
}
return (T) calendar;
}
示例3: normalize
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* <p>Normalize this instance to UTC.</p>
*
* <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z</p>
* <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p>
*/
public XMLGregorianCalendar normalize() {
XMLGregorianCalendar normalized = normalizeToTimezone(timezone);
// if timezone was undefined, leave it undefined
if (getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
normalized.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
}
// if milliseconds was undefined, leave it undefined
if (getMillisecond() == DatatypeConstants.FIELD_UNDEFINED) {
normalized.setMillisecond(DatatypeConstants.FIELD_UNDEFINED);
}
return normalized;
}
示例4: isValidValue
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Methods check if the value is valid for the datatype
*/
@Override
public boolean isValidValue(String value) {
try {
XMLGregorianCalendar cal = datatypeFactory.newXMLGregorianCalendar(value);
String schema = cal.getXMLSchemaType().getNamespaceURI() + "#"
+ cal.getXMLSchemaType().getLocalPart();
return schema.equals(getXmlSchemaURIString());
}
catch(Exception e) {
return false;
}
}
示例5: getXMLGregorianCalendarNow
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
private XMLGregorianCalendar getXMLGregorianCalendarNow()
throws DatatypeConfigurationException {
GregorianCalendar gregorianCalendar = new GregorianCalendar();
DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
XMLGregorianCalendar now = datatypeFactory
.newXMLGregorianCalendar(gregorianCalendar);
return now;
}
示例6: getDTimPumpEnd
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Gets the value of the dTimPumpEnd property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDTimPumpEnd() {
return dTimPumpEnd;
}
示例7: setDTimToolRun
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Sets the value of the dTimToolRun property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDTimToolRun(XMLGregorianCalendar value) {
this.dTimToolRun = value;
}
示例8: getDod
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Gets the value of the dod property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDod() {
return dod;
}
示例9: getDTimEnd
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Gets the value of the dTimEnd property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDTimEnd() {
return dTimEnd;
}
示例10: getMinDateTimeIndex
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* Gets the value of the minDateTimeIndex property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getMinDateTimeIndex() {
return minDateTimeIndex;
}
示例11: getRunningProcesses
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
*
* @param since
* @return
* returns java.util.List<java.lang.Integer>
*/
@WebMethod
@WebResult(targetNamespace = "")
@RequestWrapper(localName = "getRunningProcesses", targetNamespace = "http://service.web.rapidanalytics.de/", className = "com.rapid_i.repository.wsimport.GetRunningProcesses")
@ResponseWrapper(localName = "getRunningProcessesResponse", targetNamespace = "http://service.web.rapidanalytics.de/", className = "com.rapid_i.repository.wsimport.GetRunningProcessesResponse")
public List<Integer> getRunningProcesses(
@WebParam(name = "since", targetNamespace = "")
XMLGregorianCalendar since);
示例12: toXMLCalendar
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
public XMLGregorianCalendar toXMLCalendar(Date d) throws Exception {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(d);
XMLGregorianCalendar xml = DatatypeFactory.newInstance()
.newXMLGregorianCalendar();
xml.setYear(gc.get(Calendar.YEAR));
xml.setMonth(gc.get(Calendar.MONTH) + 1);
xml.setDay(gc.get(Calendar.DAY_OF_MONTH));
xml.setHour(gc.get(Calendar.HOUR_OF_DAY));
xml.setMinute(gc.get(Calendar.MINUTE));
xml.setSecond(gc.get(Calendar.SECOND));
return xml;
}
示例13: newXMLGregorianCalendarSystemTime
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
*
* @return An object of type XMLGregorianCalendar containing the current
* system time and date
* @throws DatatypeConfigurationException
* If the instantiation of the DatatypeFactory fails
*/
public static XMLGregorianCalendar newXMLGregorianCalendarSystemTime()
throws DatatypeConfigurationException {
GregorianCalendar gregorianCalendar = new GregorianCalendar();
DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
XMLGregorianCalendar now = datatypeFactory
.newXMLGregorianCalendar(gregorianCalendar);
return now;
}
示例14: equals
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
/**
* <p>Indicates whether parameter <code>obj</code> is "equal to" this one.</p>
*
* @param obj to compare.
*
* @return <code>true</code> when <code>compare(this,(XMLGregorianCalendar)obj) == EQUAL.</code>.
*/
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof XMLGregorianCalendar)) {
return false;
}
if (obj == this) {
return true;
}
return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
}
示例15: withValue
import javax.xml.datatype.XMLGregorianCalendar; //导入依赖的package包/类
@Override
public AwardTimeType withValue(XMLGregorianCalendar value) {
setValue(value);
return this;
}