Examples of newDurationYearMonth()


Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

     */
    public XMLGregorianCalendar grantExpiration() {
        try { // by default, we grant an expiration time of 2 years
            DatatypeFactory factory = DatatypeFactory.newInstance();
            XMLGregorianCalendar granted = factory.newXMLGregorianCalendar(new GregorianCalendar());
            granted.add(factory.newDurationYearMonth(true, 2, 0));
            return granted;
        } catch (DatatypeConfigurationException ex) {
            throw new Error(ex);
        }
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

    private void performTestNewDuration(StandardTypesServiceClient serviceClient) throws DatatypeConfigurationException {
        DatatypeFactory df = DatatypeFactory.newInstance();
        Duration[] da = new Duration[3];
        da[0] = df.newDuration(1000000000000L);
        da[1] = df.newDurationDayTime(1000000000000L);
        da[2] = df.newDurationYearMonth(true, 1, 3);

        for (int i = 0; i < da.length; ++i) {
            Assert.assertEquals(da[i].negate(), serviceClient.getNewDurationForward(da[i]));
        }
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

        throws DatatypeConfigurationException {
        DatatypeFactory df = DatatypeFactory.newInstance();
        Duration[] da = new Duration[3];
        da[0] = df.newDuration(1000000000000L);
        da[1] = df.newDurationDayTime(1000000000000L);
        da[2] = df.newDurationYearMonth(true, 1, 3);

        Duration[] actual = serviceClient.getNewDurationArrayForward(da);
        Assert.assertEquals(da.length, actual.length);
        for (int i = 0; i < da.length; ++i) {
            Assert.assertEquals(da[i].negate(), actual[i]);
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

    private void performTestNewDuration(StandardTypesServiceClient serviceClient) throws DatatypeConfigurationException {
        DatatypeFactory df = DatatypeFactory.newInstance();
        Duration[] da = new Duration[3];
        da[0] = df.newDuration(1000000000000L);
        da[1] = df.newDurationDayTime(1000000000000L);
        da[2] = df.newDurationYearMonth(true, 1, 3);

        for (int i = 0; i < da.length; ++i) {
            Assert.assertEquals(da[i].negate(), serviceClient.getNewDurationForward(da[i]));
        }
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

        throws DatatypeConfigurationException {
        DatatypeFactory df = DatatypeFactory.newInstance();
        Duration[] da = new Duration[3];
        da[0] = df.newDuration(1000000000000L);
        da[1] = df.newDurationDayTime(1000000000000L);
        da[2] = df.newDurationYearMonth(true, 1, 3);

        Duration[] actual = serviceClient.getNewDurationArrayForward(da);
        Assert.assertEquals(da.length, actual.length);
        for (int i = 0; i < da.length; ++i) {
            Assert.assertEquals(da[i].negate(), actual[i]);
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

                case DatatypeConstants.INDETERMINATE:
                    System.out.println("The comparison could not be carried out.");
            }
           
            // create a yearMonthDuration
            Duration ymDuration = df.newDurationYearMonth("P12Y10M");
            System.out.println("P12Y10M is of type: " + ymDuration.getXMLSchemaType());
           
            // create a dayTimeDuration (really this time)
            Duration dtDuration = df.newDurationDayTime("P10DT10H12M0S");
            System.out.println("P10DT10H12M0S is of type: " + dtDuration.getXMLSchemaType());
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

            Duration dtDuration = df.newDurationDayTime("P10DT10H12M0S");
            System.out.println("P10DT10H12M0S is of type: " + dtDuration.getXMLSchemaType());
           
            // try to fool the factory!
            try {
                ymDuration = df.newDurationYearMonth("P12Y10M1D");
            }
            catch(IllegalArgumentException e) {
                System.out.println("'duration': P12Y10M1D is not 'yearMonthDuration'!!!");
            }
           
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

                case DatatypeConstants.INDETERMINATE:
                    System.out.println("The comparison could not be carried out.");
            }
           
            // create a yearMonthDuration
            Duration ymDuration = df.newDurationYearMonth("P12Y10M");
            System.out.println("P12Y10M is of type: " + ymDuration.getXMLSchemaType());
           
            // create a dayTimeDuration (really this time)
            Duration dtDuration = df.newDurationDayTime("P10DT10H12M0S");
            System.out.println("P10DT10H12M0S is of type: " + dtDuration.getXMLSchemaType());
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

            Duration dtDuration = df.newDurationDayTime("P10DT10H12M0S");
            System.out.println("P10DT10H12M0S is of type: " + dtDuration.getXMLSchemaType());
           
            // try to fool the factory!
            try {
                ymDuration = df.newDurationYearMonth("P12Y10M1D");
            }
            catch(IllegalArgumentException e) {
                System.out.println("'duration': P12Y10M1D is not 'yearMonthDuration'!!!");
            }
           
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory.newDurationYearMonth()

    private void performTestNewDuration(StandardTypesServiceClient serviceClient) throws DatatypeConfigurationException {
        DatatypeFactory df = DatatypeFactory.newInstance();
        Duration[] da = new Duration[3];
        da[0] = df.newDuration(1000000000000L);
        da[1] = df.newDurationDayTime(1000000000000L);
        da[2] = df.newDurationYearMonth(true, 1, 3);

        for (int i = 0; i < da.length; ++i) {
            Assert.assertEquals(da[i].negate(), serviceClient.getNewDurationForward(da[i]));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.