Examples of calendarValue()


Examples of org.apache.xmlbeans.XmlTime.calendarValue()

    }
   
    public static void testParse() throws Exception
    {
        XmlTime xt = XmlTime.Factory.parse("<xml-fragment>12:00:00</xml-fragment>");
        Assert.assertEquals("12:00:00", xt.calendarValue().toString());
    }

   
   
}
View Full Code Here

Examples of org.apache.xmlbeans.XmlTime.calendarValue()

    }
   
    public static void testParse() throws Exception
    {
        XmlTime xt = XmlTime.Factory.parse("<xml-fragment>12:00:00</xml-fragment>");
        Assert.assertEquals("12:00:00", xt.calendarValue().toString());
    }

   
}
View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

    if (value instanceof Literal) {
      Literal lit = (Literal)value;
      URI dt = lit.getDatatype();
      if (dt != null && XMLDatatypeUtil.isCalendarDatatype(dt)) {
        try {
          return new NumberValue(getCalendarValue(lit.calendarValue()));
        }
        catch (IllegalArgumentException e) {
          return null;
        }
      }
View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

        XMLGregorianCalendar calendar = XMLDatatypeUtil.parseCalendar("2002-10-10T12:00:00-05:00");
        l = vf.createLiteral(calendar);
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("2002-10-10T12:00:00-05:00", l.getLabel());
        assertEquals(calendar, l.calendarValue());
        assertEquals(XMLSchema.DATETIME, l.getDatatype());
    }

    @Test
    public void testGetLiteralsFromTripleStore() throws Exception {
View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

        l = (Literal) toSet(sc.getStatements(valueUri, hasValueUri, null, false)).iterator().next().getObject();
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("2002-10-10T12:00:00-05:00", l.getLabel());
        assertEquals(XMLSchema.DATETIME, l.getDatatype());
        assertEquals(calendar, l.calendarValue());
        sc.rollback();
        sc.close();
    }

    // blank nodes /////////////////////////////////////////////////////////////
View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

    if (value instanceof Literal) {
      Literal lit = (Literal)value;
      URI dt = lit.getDatatype();
      if (dt != null && XMLDatatypeUtil.isCalendarDatatype(dt)) {
        try {
          return new NumberValue(getCalendarValue(lit.calendarValue()));
        }
        catch (IllegalArgumentException e) {
          return null;
        }
      }
View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

        if(o instanceof Literal) {
            Literal that = (Literal)o;

            if(!(this.getDatatype().equals(that.getDatatype()))) return false;

            return calendarValue().toGregorianCalendar().getTime().getTime() == that.calendarValue().toGregorianCalendar().getTime().getTime();
        }
        return false;
    }

View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

        if(o instanceof Literal) {
            Literal that = (Literal)o;

            if(!(this.getDatatype().equals(that.getDatatype()))) return false;

            return calendarValue().toGregorianCalendar().getTime().getTime() == that.calendarValue().toGregorianCalendar().getTime().getTime();
        }
        return false;
    }

View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

            } else if (XMLSchema.FLOAT.equals(datatype)) {
                return l.floatValue();
            } else if (XMLSchema.BYTE.equals(datatype)) {
                return l.byteValue();
            } else if (XMLSchema.DATETIME.equals(datatype)) {
                return l.calendarValue();
            } else if (XMLSchema.DOUBLE.equals(datatype)) {
                return l.doubleValue();
            } else if (XMLSchema.BOOLEAN.equals(datatype)) {
                return l.booleanValue();
            } else if (XMLSchema.DECIMAL.equals(datatype)) {
View Full Code Here

Examples of org.openrdf.model.Literal.calendarValue()

    }

    public Date toDateValue(final RippleValue v) throws RippleException {
        Literal l = castToLiteral(v.toRDF(this).sesameValue());

        XMLGregorianCalendar c = l.calendarValue();
        return c.toGregorianCalendar().getTime();
    }

    // TODO: this method is incomplete
    public String toString(final RippleValue v) throws RippleException {
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.