Java Code Examples for javax.xml.datatype.XMLGregorianCalendar

The following are top voted examples for showing how to use javax.xml.datatype.XMLGregorianCalendar. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: ext-lib-amazon-mws-fulfillment-inbound-shipment   File: ListInboundShipmentItemsSample.java   Source Code and License 16 votes vote down vote up
/**
 *  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);

}
 
Example 2
Project: jsf-sdk   File: CalendarCodec.java   Source Code and License 11 votes vote down vote up
@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;
}
 
Example 3
Project: OpenJSharp   File: XMLGregorianCalendarImpl.java   Source Code and License 8 votes vote down vote up
/**
 * <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;
}
 
Example 4
Project: gate-core   File: DataType.java   Source Code and License 7 votes vote down vote up
/**
 * 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;
  }
}
 
Example 5
Project: FHIR-CQL-ODM-service   File: FhirService.java   Source Code and License 7 votes vote down vote up
private XMLGregorianCalendar getXMLGregorianCalendarNow()
		throws DatatypeConfigurationException {
	GregorianCalendar gregorianCalendar = new GregorianCalendar();
	DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
	XMLGregorianCalendar now = datatypeFactory
			.newXMLGregorianCalendar(gregorianCalendar);
	return now;
}
 
Example 6
Project: GitHub   File: CalendarCodec.java   Source Code and License 6 votes vote down vote up
@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;
}
 
Example 7
Project: WitsmlObjectsLibrary   File: CsCementStage.java   Source Code and License 6 votes vote down vote up
/**
 * Gets the value of the dTimPumpEnd property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimPumpEnd() {
    return dTimPumpEnd;
}
 
Example 8
Project: WitsmlObjectsLibrary   File: ObjSidewallCore.java   Source Code and License 6 votes vote down vote up
/**
 * Sets the value of the dTimToolRun property.
 * 
 * @param value
 *     allowed object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public void setDTimToolRun(XMLGregorianCalendar value) {
    this.dTimToolRun = value;
}
 
Example 9
Project: kares   File: Organ.java   Source Code and License 6 votes vote down vote up
/**
 * Gets the value of the dod property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDod() {
    return dod;
}
 
Example 10
Project: WitsmlObjectsLibrary   File: CsActivity.java   Source Code and License 6 votes vote down vote up
/**
 * Gets the value of the dTimEnd property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimEnd() {
    return dTimEnd;
}
 
Example 11
Project: WitsmlObjectsLibrary   File: CsLogCurveInfo.java   Source Code and License 6 votes vote down vote up
/**
 * Gets the value of the minDateTimeIndex property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getMinDateTimeIndex() {
    return minDateTimeIndex;
}
 
Example 12
Project: rapidminer   File: ProcessService.java   Source Code and License 6 votes vote down vote up
/**
 * 
 * @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);
 
Example 13
Project: docx4j-template   File: Docx4j_创建批注_S3_Test.java   Source Code and License 6 votes vote down vote up
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;  
}
 
Example 14
Project: oscm   File: GregorianCalendars.java   Source Code and License 6 votes vote down vote up
/**
 * 
 * @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;
}
 
Example 15
Project: openjdk-jdk10   File: XMLGregorianCalendarImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <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;
}
 
Example 16
Project: eSaskaita   File: AwardTimeType.java   Source Code and License 5 votes vote down vote up
@Override
public AwardTimeType withValue(XMLGregorianCalendar value) {
    setValue(value);
    return this;
}
 
Example 17
Project: tck   File: DroolsTCKTest.java   Source Code and License 5 votes vote down vote up
private boolean isDateTimeOrDuration(Object value)
{
   return value instanceof Duration || value instanceof XMLGregorianCalendar;
}
 
Example 18
Project: WitsmlObjectsLibrary   File: ObjCementJob.java   Source Code and License 5 votes vote down vote up
/**
 * Gets the value of the dTimSqueeze property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimSqueeze() {
    return dTimSqueeze;
}
 
Example 19
Project: openjdk-jdk10   File: AbstractDateTimeDV.java   Source Code and License 5 votes vote down vote up
@Override
public XMLGregorianCalendar getXMLGregorianCalendar() {
    return type.getXMLGregorianCalendar(this);
}
 
Example 20
Project: OpenJSharp   File: XMLGregorianCalendarImpl.java   Source Code and License 5 votes vote down vote up
/**
 * <p>Create a Java representation of XML Schema builtin datatype <code>date</code> or <code>g*</code>.</p>
 *
 * <p>For example, an instance of <code>gYear</code> can be created invoking this factory
 * with <code>month</code> and <code>day</code> parameters set to
 * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
 *
 * @param year of <code>XMLGregorianCalendar</code> to be created.
 * @param month of <code>XMLGregorianCalendar</code> to be created.
 * @param day of <code>XMLGregorianCalendar</code> to be created.
 * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
 *
 * @return <code>XMLGregorianCalendar</code> created from parameter values.
 *
 * @see DatatypeConstants#FIELD_UNDEFINED
 *
 * @throws IllegalArgumentException if any parameter is outside value
 * constraints for the field as specified in
 * <a href="#datetimefieldmapping">date/time field mapping table</a>.
 */
public static XMLGregorianCalendar createDate(
    int year,
    int month,
    int day,
    int timezone) {

    return new XMLGregorianCalendarImpl(
        year,
        month,
        day,
        DatatypeConstants.FIELD_UNDEFINED, // hour
        DatatypeConstants.FIELD_UNDEFINED, // minute
        DatatypeConstants.FIELD_UNDEFINED, // second
            DatatypeConstants.FIELD_UNDEFINED, // millisecond
        timezone);
}
 
Example 21
Project: eSaskaita   File: ReferenceTimeType.java   Source Code and License 5 votes vote down vote up
@Override
public ReferenceTimeType withValue(XMLGregorianCalendar value) {
    setValue(value);
    return this;
}
 
Example 22
Project: oscm   File: Period.java   Source Code and License 5 votes vote down vote up
public XMLGregorianCalendar getStartDateIsoFormat() {
    return startDateIsoFormat;
}
 
Example 23
Project: eSaskaita   File: PaidTimeType.java   Source Code and License 5 votes vote down vote up
@Override
public PaidTimeType withValue(XMLGregorianCalendar value) {
    setValue(value);
    return this;
}
 
Example 24
Project: WitsmlObjectsLibrary   File: CsHse.java   Source Code and License 4 votes vote down vote up
/**
 * Sets the value of the lastBopDrill property.
 * 
 * @param value
 *     allowed object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public void setLastBopDrill(XMLGregorianCalendar value) {
    this.lastBopDrill = value;
}
 
Example 25
Project: WitsmlObjectsLibrary   File: CsPump.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the dTimRemove property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimRemove() {
    return dTimRemove;
}
 
Example 26
Project: sumo   File: SwathBoundsType.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the azimuthTime property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getAzimuthTime() {
    return azimuthTime;
}
 
Example 27
Project: WitsmlObjectsLibrary   File: CsPit.java   Source Code and License 3 votes vote down vote up
/**
 * Sets the value of the dTimRemove property.
 * 
 * @param value
 *     allowed object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public void setDTimRemove(XMLGregorianCalendar value) {
    this.dTimRemove = value;
}
 
Example 28
Project: WitsmlObjectsLibrary   File: CsPit.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the dTimInstall property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimInstall() {
    return dTimInstall;
}
 
Example 29
Project: kares   File: VkPodnet.java   Source Code and License 3 votes vote down vote up
/**
 * Sets the value of the dv property.
 * 
 * @param value
 *     allowed object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public void setDV(XMLGregorianCalendar value) {
    this.dv = value;
}
 
Example 30
Project: rapidminer   File: RemoteScheduler.java   Source Code and License 3 votes vote down vote up
/**
 * Schedules a process to be executed as soon as possible. Works with all process service
 * versions.
 *
 * @throws RepositoryException
 *             on fail
 * @throws PasswordInputCanceledException
 *             if the user canceled the login dialog
 */
ExecutionResponse executeProcessSimple(String executeProcess, XMLGregorianCalendar xmlGregorianCalendar,
		ProcessContextWrapper processContextWrapper) throws RepositoryException, PasswordInputCanceledException;
 
Example 31
Project: rapidminer   File: RemoteScheduler.java   Source Code and License 3 votes vote down vote up
/**
 * Schedules a process to be executed as soon as possible. If Process Service version is not at
 * least 1.3 queueName will not be considered.
 *
 * @throws RepositoryException
 *             on fail
 * @throws PasswordInputCanceledException
 *             if the user canceled the login dialog
 */
ExecutionResponse executeProcessSimple(String path, XMLGregorianCalendar xmlGregorianCalendar,
		ProcessContextWrapper processContextWrapper, String queueName) throws RepositoryException,
		PasswordInputCanceledException;
 
Example 32
Project: WitsmlObjectsLibrary   File: CsStimJobInterval.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the dTimStart property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimStart() {
    return dTimStart;
}
 
Example 33
Project: kares   File: RegistraceRCNS.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the datumLikvidace property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDatumLikvidace() {
    return datumLikvidace;
}
 
Example 34
Project: WitsmlObjectsLibrary   File: CsDrillReportWellboreInfo.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the dTimPreSpud property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimPreSpud() {
    return dTimPreSpud;
}
 
Example 35
Project: WitsmlObjectsLibrary   File: ObjCementJob.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the dTimCementDrillOut property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getDTimCementDrillOut() {
    return dTimCementDrillOut;
}
 
Example 36
Project: WitsmlObjectsLibrary   File: CsHse.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the lastFireBoatDrill property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getLastFireBoatDrill() {
    return lastFireBoatDrill;
}
 
Example 37
Project: soapbox-race-core   File: InventoryItemTrans.java   Source Code and License 3 votes vote down vote up
/**
 * Sets the value of the expirationDate property.
 * 
 * @param value
 *     allowed object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public void setExpirationDate(XMLGregorianCalendar value) {
    this.expirationDate = value;
}
 
Example 38
Project: sumo   File: RawDataAnalysisType.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the azimuthTime property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getAzimuthTime() {
    return azimuthTime;
}
 
Example 39
Project: WitsmlObjectsLibrary   File: SecurityInfoType.java   Source Code and License 3 votes vote down vote up
/**
 * Gets the value of the endDate property.
 * 
 * @return
 *     possible object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public XMLGregorianCalendar getEndDate() {
    return endDate;
}
 
Example 40
Project: WitsmlObjectsLibrary   File: CsShakerScreen.java   Source Code and License 3 votes vote down vote up
/**
 * Sets the value of the dTimEnd property.
 * 
 * @param value
 *     allowed object is
 *     {@link XMLGregorianCalendar }
 *     
 */
public void setDTimEnd(XMLGregorianCalendar value) {
    this.dTimEnd = value;
}