Java Code Examples for javax.xml.datatype.DatatypeConfigurationException

The following examples show how to use javax.xml.datatype.DatatypeConfigurationException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: rya   Source File: DateTimeWithinPeriodTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testHours() throws DatatypeConfigurationException, ValueExprEvaluationException {
    DatatypeFactory dtf = DatatypeFactory.newInstance();

    ZonedDateTime zTime = testThisTimeDate;
    String time = zTime.format(DateTimeFormatter.ISO_INSTANT);

    ZonedDateTime zTime1 = zTime.minusHours(1);
    String time1 = zTime1.format(DateTimeFormatter.ISO_INSTANT);

    Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
    Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));

    DateTimeWithinPeriod func = new DateTimeWithinPeriod();

    assertEquals(TRUE, func.evaluate(VF, now, now,VF.createLiteral(1),OWLTime.HOURS_URI));
    assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(1),OWLTime.HOURS_URI));
    assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(2),OWLTime.HOURS_URI));
}
 
Example 2
Source Project: ldp4j   Source File: LiteralsTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreationFromXMLGregorianCalendar$customDefaults() throws DatatypeConfigurationException {
	XMLGregorianCalendar xgc = xmlGregorianCalendar();

	XMLGregorianCalendar nxgc =
		DatatypeFactory.
			newInstance().
				newXMLGregorianCalendar(
					new GregorianCalendar(anotherTimeZone(this.dateTime.get())));
	DateTimeLiteral dateTimeLiteral=
		Literals.
			of(xgc).
				withDefaults(nxgc).
					dateTime();

	assertThat(this.dateTime,equalTo(dateTimeLiteral));
}
 
Example 3
Source Project: development   Source File: MpOwnerShareResultAssembler.java    License: Apache License 2.0 6 votes vote down vote up
void setPeriod(long periodStartTime, long periodEndTime)
        throws DatatypeConfigurationException {

    this.periodStartTime = periodStartTime;
    this.periodEndTime = periodEndTime;

    Period period = new Period();

    DatatypeFactory df = DatatypeFactory.newInstance();
    GregorianCalendar gc = new GregorianCalendar();

    // start date
    period.setStartDate(BigInteger.valueOf(periodStartTime));
    gc.setTimeInMillis(periodStartTime);
    period.setStartDateIsoFormat(df.newXMLGregorianCalendar(gc).normalize());

    // end date
    period.setEndDate(BigInteger.valueOf(periodEndTime));
    gc.setTimeInMillis(periodEndTime);
    period.setEndDateIsoFormat(df.newXMLGregorianCalendar(gc).normalize());

    result.setPeriod(period);
}
 
Example 4
Source Project: development   Source File: ResellerShareResultAssembler.java    License: Apache License 2.0 6 votes vote down vote up
private Subscription buildSubscription(long subscriptionKey)
        throws DatatypeConfigurationException {
    SubscriptionHistory subscriptionHistory = sharesRetrievalService
            .loadSubscriptionHistoryWithinPeriod(subscriptionKey,
                    periodEndTime);

    Subscription subscription = new Subscription();
    subscription.setKey(BigInteger.valueOf(subscriptionKey));
    subscription.setId(subscriptionHistory.getDataContainer()
            .getSubscriptionId());
    subscription.setBillingKey(BigInteger.valueOf(currentBillingResult
            .getKey()));
    subscription.setRevenue(currentBillingResult.getNetAmount());
    Period period = preparePeriod(
            this.currentBillingResult.getPeriodStartTime(),
            this.currentBillingResult.getPeriodEndTime());
    subscription.setPeriod(period);
    return subscription;
}
 
Example 5
Source Project: rya   Source File: DateTimeTtlValueConverter.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void convert(String ttl, String startTime) {
    try {
        long start_l, stop_l;
        long ttl_l = Long.parseLong(ttl);
        stop_l = System.currentTimeMillis();
        if (startTime != null)
            stop_l = Long.parseLong(startTime);
        start_l = stop_l - ttl_l;

        GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();
        cal.setTimeZone(getTimeZone());
        cal.setTimeInMillis(start_l);
        DatatypeFactory factory = DatatypeFactory.newInstance();
        start = VF.createLiteral(factory.newXMLGregorianCalendar(cal));

        cal.setTimeInMillis(stop_l);
        stop = VF.createLiteral(factory.newXMLGregorianCalendar(cal));
    } catch (DatatypeConfigurationException e) {
        throw new RuntimeException("Exception occurred creating DataTypeFactory", e);
    }
}
 
Example 6
Source Project: hottub   Source File: DatatypeConverterImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static DatatypeFactory getDatatypeFactory() {
    ClassLoader tccl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
        public ClassLoader run() {
            return Thread.currentThread().getContextClassLoader();
        }
    });
    DatatypeFactory df = DF_CACHE.get(tccl);
    if (df == null) {
        synchronized (DatatypeConverterImpl.class) {
            df = DF_CACHE.get(tccl);
            if (df == null) { // to prevent multiple initialization
                try {
                    df = DatatypeFactory.newInstance();
                } catch (DatatypeConfigurationException e) {
                    throw new Error(Messages.FAILED_TO_INITIALE_DATATYPE_FACTORY.format(),e);
                }
                DF_CACHE.put(tccl, df);
            }
        }
    }
    return df;
}
 
Example 7
Source Project: juddi   Source File: TModelInstanceDetailsComparatorTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCompareToDurationEQ() throws DatatypeConfigurationException {
    System.out.println("TModelInstanceDetailsComparator.compare testCompareToDurationEQ");
    TModelInstanceDetails lhs = new TModelInstanceDetails();
    lhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
    lhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
    lhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
    lhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("P5Y");
    TModelInstanceDetails rhs = new TModelInstanceDetails();

    rhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
    rhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
    rhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
    rhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("P5Y");
    TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, false, true);
    int result = instance.compare(lhs, rhs);
    Assert.assertTrue("result " + lhs.getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms() + " compare to " +
            lhs.getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms() + " " +
            result, result == 0);
}
 
Example 8
Source Project: birt   Source File: BirtDurationTest.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Test
   public void testCompare() throws DatatypeConfigurationException
{
	String script1 = "BirtDuration.compare( \"P1Y2M1D\", \"P1Y2M2D\" )";
	String script2 = "BirtDuration.compare( \"P1Y2M2DT3S\", \"P1Y2M2DT3S\" )";
	
	assertEquals( cx.evaluateString( scope,
			script1,
			"inline",
			1,
			null ) ,Integer.valueOf( -1 ) );
	assertEquals( cx.evaluateString( scope,
			script2,
			"inline",
			1,
			null ) ,Integer.valueOf( 0 ) );
}
 
Example 9
Source Project: birt   Source File: BirtDuration.java    License: Eclipse Public License 1.0 6 votes vote down vote up
protected Object getValue( Object[] args ) throws BirtException
{
	Duration duration1, duration2;
	try
	{
		duration1 = DatatypeFactory.newInstance( )
				.newDuration( args[0].toString( ) );
		duration2 = DatatypeFactory.newInstance( )
				.newDuration( args[1].toString( ) );
	}
	catch ( DatatypeConfigurationException e )
	{
		throw new IllegalArgumentException( Messages.getFormattedString( "error.BirtDuration.literal.invalidArgument",
				args ) );
	}
	return duration1.add( duration2 ).toString( );
}
 
Example 10
Source Project: juddi   Source File: TModelInstanceDetailsComparatorTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testCompareToDate() throws DatatypeConfigurationException {
    System.out.println("TModelInstanceDetailsComparator.compare testCompareToDate");
    TModelInstanceDetails lhs = new TModelInstanceDetails();
    lhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
    lhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
    lhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
    lhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("asdasd");
    TModelInstanceDetails rhs = new TModelInstanceDetails();

    rhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
    rhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
    rhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
    rhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("asdasdasd");
    TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, true, false);

    int result = instance.compare(lhs, rhs);
    //Assert.assertTrue("result " + result,result < 0);

}
 
Example 11
Source Project: rya   Source File: DateTimeWithinPeriodTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testSeconds() throws DatatypeConfigurationException, ValueExprEvaluationException {
    DatatypeFactory dtf = DatatypeFactory.newInstance();

    ZonedDateTime zTime = testThisTimeDate;
    String time = zTime.format(DateTimeFormatter.ISO_INSTANT);

    ZonedDateTime zTime1 = zTime.minusSeconds(1);
    String time1 = zTime1.format(DateTimeFormatter.ISO_INSTANT);

    Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
    Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));

    DateTimeWithinPeriod func = new DateTimeWithinPeriod();

    assertEquals(TRUE, func.evaluate(VF, now, now, VF.createLiteral(1), OWLTime.SECONDS_URI));
    assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(1), OWLTime.SECONDS_URI));
    assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(2), OWLTime.SECONDS_URI));
}
 
Example 12
Source Project: birt   Source File: BirtDurationTest.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Test
   public void testSecond() throws DatatypeConfigurationException
{
	String script1 = "BirtDuration.second( \"P1Y2M1D\" )";
	String script2 = "BirtDuration.second( \"P2M2DT4S\" )";
	
	assertEquals( (cx.evaluateString( scope,
			script1,
			"inline",
			1,
			null )) ,Integer.valueOf( 0 ) );
	assertEquals( (cx.evaluateString( scope,
			script2,
			"inline",
			1,
			null )) ,Integer.valueOf( 4 ) );
}
 
Example 13
Source Project: birt   Source File: BirtDurationTest.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Test
   public void testIsLongerThan() throws DatatypeConfigurationException
{
	String script1 = "BirtDuration.isLongerThan( \"P1Y2M3D\", \"P1Y2M2D\" )";
	String script2 = "BirtDuration.isLongerThan( \"P1Y2M2DT2S\", \"P1Y2M2DT3S\" )";
	
	assertEquals( cx.evaluateString( scope,
			script1,
			"inline",
			1,
			null ) ,Boolean.valueOf( true ) );
	assertEquals( cx.evaluateString( scope,
			script2,
			"inline",
			1,
			null ) ,Boolean.valueOf( false ) );
}
 
Example 14
Source Project: openjdk-jdk9   Source File: Bug6925410Test.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Test
public void test() throws DatatypeConfigurationException {
    try {
        int times = 100;
        long start = System.currentTimeMillis();
        for (int i = 0; i < times; i++) {
            XMLReaderFactory.createXMLReader();
        }
        long end = System.currentTimeMillis();
        double speed = ((end - start));
        System.out.println(speed + "ms");
    } catch (Throwable e) {
        e.printStackTrace();
        Assert.fail(e.toString());
    }

}
 
Example 15
Source Project: birt   Source File: BirtDuration.java    License: Eclipse Public License 1.0 6 votes vote down vote up
protected Object getValue( Object[] args ) throws BirtException
{
	Duration duration;
	int factor;
	try
	{
		duration = DatatypeFactory.newInstance( )
				.newDuration( args[0].toString( ) );

		factor = DataTypeUtil.toInteger( args[1] ).intValue( );
	}
	catch ( DatatypeConfigurationException e )
	{
		throw new IllegalArgumentException( Messages.getFormattedString( "error.BirtDuration.literal.invalidArgument",
				args ) );
	}
	return duration.multiply( factor ).toString( );
}
 
Example 16
Source Project: development   Source File: SupplierShareResultAssembler.java    License: Apache License 2.0 6 votes vote down vote up
private void addService(Marketplace marketplace, long subscriptionKey)
        throws DatatypeConfigurationException {

    Set<Long> priceModelKeys = xmlSearch.findPriceModelKeys();
    for (Iterator<Long> iterator = priceModelKeys.iterator(); iterator
            .hasNext();) {
        pmKey = iterator.next();
        ProductHistory prd = billingRetrievalService.loadProductOfVendor(
                subscriptionKey, pmKey, periodEndTime);
        Service service = marketplace.getServiceByKey(prd.getObjKey());
        if (service == null) {
            service = buildService(marketplace, prd);
            marketplace.addService(service);
        }
        addSubscription(service, subscriptionKey);
        addServiceCustomerRevenue(service, subscriptionKey);
    }
}
 
Example 17
Source Project: development   Source File: RedirectSamlURLBuilderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void setup() throws DatatypeConfigurationException {
    authnRequest = new AuthnRequestGenerator("Issuer Name", Boolean.TRUE)
            .generateAuthnRequest();
    redirectSamlURLBuilder = spy(new RedirectSamlURLBuilder<AuthnRequestType>());
    logger = mock(Log4jLogger.class);
}
 
Example 18
Source Project: ldp4j   Source File: Datatype.java    License: Apache License 2.0 5 votes vote down vote up
private static void encodeXMLGregorianCalender(Datatype type, String rawValue, ValueSink consumer) {
	try {
		consumer.consumeXMLGregorianCalendar(DatatypeFactory.newInstance().newXMLGregorianCalendar(rawValue));
	} catch (DatatypeConfigurationException e) {
		throw new IllegalStateException(String.format("Could not decode an xml gregorian calendar from raw value '%s' of type '%s'",rawValue,type.toURI()),e);
	}
}
 
Example 19
private static void test(int offsetMinutes)
        throws DatatypeConfigurationException {
    XMLGregorianCalendar calendar = DatatypeFactory.newInstance().
            newXMLGregorianCalendar();
    calendar.setTimezone(60 + offsetMinutes);
    TimeZone timeZone = calendar.getTimeZone(DatatypeConstants.FIELD_UNDEFINED);
    String expected = (offsetMinutes < 10 ? "GMT+01:0" : "GMT+01:")
            + offsetMinutes;
    if (!timeZone.getID().equals(expected)) {
        throw new RuntimeException("Test failed: expected timezone: " +
                expected + " Actual: " + timeZone.getID());
    }
}
 
Example 20
Source Project: sis   Source File: XmlUtilitiesTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Tests the {@link XmlUtilities#toXML} method.
 * This test arbitrarily uses the CET timezone.
 *
 * @throws DatatypeConfigurationException if the XML factory can not be created.
 */
@Test
public void testToXML() throws DatatypeConfigurationException {
    createContext(false, Locale.FRANCE, "CET");
    final XMLGregorianCalendar calendar = XmlUtilities.toXML(context, new Date(1230786000000L));
    assertEquals("2009-01-01T06:00:00.000+01:00", calendar.toString());

    calendar.setMillisecond(FIELD_UNDEFINED);
    assertEquals("2009-01-01T06:00:00+01:00", calendar.toString());
}
 
Example 21
private static XMLGregorianCalendar generateCalendarFromNow() {
	GregorianCalendar gregCal = GregorianCalendar.from(ZonedDateTime.now());
	XMLGregorianCalendar xmlGregCal = null;
	try {
		xmlGregCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregCal);
	} catch (DatatypeConfigurationException exception) {
		//LOG.calenderMappingNotWorking(exception);
	}
	return xmlGregCal;
}
 
Example 22
public XMLGregorianCalendar getCurrentXMLGregorianCalendar() {
    XMLGregorianCalendar xgcal = null;
    try {
        GregorianCalendar gcal = new GregorianCalendar();
        gcal.setTimeInMillis(System.currentTimeMillis());
        xgcal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal);
    } catch (DatatypeConfigurationException ex) {
        LOG.error("Error creating a xml gregorian calendat!! ", ex);
    }
    return xgcal;
}
 
Example 23
public static XMLGregorianCalendar getDefaultVersion() {

        Calendar cal = Calendar.getInstance();
        cal.set(1980, 1, 1, 0, 0, 0);
        GregorianCalendar c = new GregorianCalendar();
        c.setTime(cal.getTime());
        try {
            XMLGregorianCalendar gc = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
            return gc;
        } catch (DatatypeConfigurationException e) {
            e.printStackTrace();
            return null;
        }
    }
 
Example 24
/**
 * invalid expiration time
 *
 * @throws DatatypeConfigurationException
 */
@Test
public void JUDDI_606_2() throws DatatypeConfigurationException {
     Assume.assumeTrue(TckPublisher.isEnabled());
        logger.info("JUDDI_606_2");
        Assume.assumeTrue(TckPublisher.isSubscriptionEnabled());
        // invalid expiration time
        DatatypeFactory df = DatatypeFactory.newInstance();
        GregorianCalendar gcal = new GregorianCalendar();
        gcal.setTimeInMillis(System.currentTimeMillis());
        gcal.add(Calendar.DATE, -1);
        XMLGregorianCalendar newXMLGregorianCalendar = df.newXMLGregorianCalendar(gcal);

        Subscription sub = new Subscription();
        Holder<List<Subscription>> data = new Holder<List<Subscription>>();
        data.value = new ArrayList<Subscription>();
        sub.setBrief(true);
        sub.setExpiresAfter(newXMLGregorianCalendar);
        sub.setMaxEntities(1);
        sub.setNotificationInterval(null);
        sub.setBindingKey(null);
        sub.setSubscriptionFilter(new SubscriptionFilter());
        sub.getSubscriptionFilter().setFindService(new FindService());
        sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
        sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        sub.getSubscriptionFilter().getFindService().getName().add(new Name("%", null));
        data.value.add(sub);
        try {
                tckSubscriptionJoe.subscription.saveSubscription(authInfoJoe, data);
                Assert.fail();
        } catch (Exception ex) {
                //HandleException(ex);
                logger.info("Expected exception: " + ex.getMessage());
        }
}
 
Example 25
public GetInsurabilityForPharmacistRequest createRequest(String userName, String password, String pharmacyHolder, String pharmacySSIN, String pharmcayNihii, String date, String type, String careReceiverSSIN, String careReceiverMutuality, String careReceiverRegNrWithMut, String packageName, String recordCommonInputReference, String recordCommonInputUserReference) throws IntegrationModuleException, DatatypeConfigurationException {
   GetInsurabilityForPharmacistRequest request = new GetInsurabilityForPharmacistRequest();
   request.setCommonInput(this.createCommonInput(password, userName, pharmacyHolder, pharmcayNihii, pharmacySSIN, packageName));
   request.setRecordCommonInput(this.createRecordCommonInputType(recordCommonInputReference, recordCommonInputUserReference));
   XMLGregorianCalendar d = DatatypeFactory.newInstance().newXMLGregorianCalendar(date);
   request.setInsurabilityRequest(this.createInsurabilityRequestPart(d, type, careReceiverSSIN, careReceiverMutuality, careReceiverRegNrWithMut));
   SamlAttributeType extendedInfo = new SamlAttributeType();
   request.setExtendedInformation(extendedInfo);
   return request;
}
 
Example 26
Source Project: r-course   Source File: Value.java    License: MIT License 5 votes vote down vote up
public void setDateTime(GregorianCalendar value) throws DatatypeConfigurationException {
    if (this.dtf == null) {
        this.dtf = DatatypeFactory.newInstance();
    }
    this.objValue = this.dtf.newXMLGregorianCalendar(value);
    this.objType = TYPE_dateTime_iso8601;
}
 
Example 27
Source Project: development   Source File: MpOwnerShareResultAssembler.java    License: Apache License 2.0 5 votes vote down vote up
public MarketplaceOwnerRevenueShareResult build(Long mpOwnerKey,
        long periodStartTime, long periodEndTime)
        throws DatatypeConfigurationException {

    Invariants.assertNotNull(mpOwnerKey);
    result = new MarketplaceOwnerRevenueShareResult();
    setMarketpleOwnerData(mpOwnerKey);
    setPeriod(periodStartTime, periodEndTime);

    List<String> currencies = billingRetrievalService
            .loadSupportedCurrencies();
    List<Long> marketplaceKeys = billingRetrievalService
            .loadMarketplaceKeys(mpOwnerKey.longValue(), periodEndTime);
    for (String currencyCode : currencies) {
        for (Long marketplaceKey : marketplaceKeys) {
            List<BillingResult> billingResults = billingRetrievalService
                    .loadBillingResultsForMarketplace(marketplaceKey,
                            currencyCode, Long.valueOf(periodStartTime),
                            Long.valueOf(periodEndTime));
            for (BillingResult br : billingResults) {
                currentBillingResult = br;
                xmlSearch = newXmlSearch(currentBillingResult);
                build(currencyCode, marketplaceKey);
            }
        }
    }
    return result;
}
 
Example 28
Source Project: juddi   Source File: TModelInstanceDetailsComparatorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testCompareToNulls8() throws DatatypeConfigurationException {
    System.out.println("TModelInstanceDetailsComparator.compare nulls8");
    TModelInstanceDetails lhs = null;
    TModelInstanceDetails rhs = null;
    TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", true, false, false);
    int expResult = 0;
    int result = instance.compare(lhs, rhs);
}
 
Example 29
public BuiltinLeafInfoCompiler(String name, QName qualifiedName) {
	Validate.notNull(name);
	Validate.notNull(qualifiedName);
	this.qualifiedName = qualifiedName;
	this.name = name;
	try {
		this.datatypeFactory = DatatypeFactory.newInstance();
	} catch (DatatypeConfigurationException dcex) {
		throw new ExceptionInInitializerError(dcex);
	}

}
 
Example 30
public static XMLGregorianCalendar getXMLGregorianCalendar(Date dateValue) {
   XMLGregorianCalendar dateTime = null;

   try {
      GregorianCalendar calendar = new GregorianCalendar();
      calendar.setTime(dateValue);
      DatatypeFactory df = DatatypeFactory.newInstance();
      dateTime = df.newXMLGregorianCalendar(calendar);
   } catch (DatatypeConfigurationException var4) {
      ;
   }

   return dateTime;
}