Examples of DatatypeFactory


Examples of com.aneeshpu.dpdeppop.datatypes.DataTypeFactory

class AutoIncrementBasedCreation implements ColumnCreationStrategy {

    private final DataTypeFactory dataTypeFactory;

    public AutoIncrementBasedCreation() {
        dataTypeFactory = new DataTypeFactory();
    }
View Full Code Here

Examples of com.sun.tools.txw2.builder.relaxng.DatatypeFactory

    private XmlSchemaBuilder(XSSchemaSet xs,TxwOptions opts) {
        this.schemaSet = xs;
        grammar.addChild(new Empty(null));
        this.nodeSet = new NodeSet(opts,grammar);
        this.dtf = new DatatypeFactory(opts.codeModel);
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

  @Test
  public void testGregorianCalendar() throws Exception{

    DateObjectSource source = new DateObjectSource();
    DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
    XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar();
    xmlGregorianCalendar.setTimezone(2 * 60);
    source.setRecalledDate(xmlGregorianCalendar);

    DateObjectDest dest = mapper.map(source, DateObjectDest.class);

View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

    assertEquals(DAY, xmlCalendar.getDay());
  }

  @Test
  public void testConvert_XmlGregorianCalendar() throws Exception {
    DatatypeFactory instance = DatatypeFactory.newInstance();
    XMLGregorianCalendar calendar = instance.newXMLGregorianCalendar(new GregorianCalendar(YEAR, MONTH, DAY));

    Object result = converter.convert(XMLGregorianCalendar.class, calendar);
    XMLGregorianCalendar xmlCalendar = (XMLGregorianCalendar) result;

    assertEquals(YEAR, xmlCalendar.getYear());
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

            throws XQueryException {
        return new DateTimeValue(literal, this);
    }

    public DateTimeValue createInstance(XMLGregorianCalendar value) {
        final DatatypeFactory factory = XsDatatypeFactory.getDatatypeFactory();
        int hour = value.getHour();
        int minute = value.getMinute();
        int sec = value.getSecond();
        BigDecimal fsec = value.getFractionalSecond();
        int tz = value.getTimezone();
        XMLGregorianCalendar cal = factory.newXMLGregorianCalendarTime(hour, minute, sec, fsec, tz);
        return new GregorianDateTimeValue(cal, TIME);
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

            throws XQueryException {
        return new DateTimeValue(literal, this);
    }

    public DateTimeValue createInstance(XMLGregorianCalendar value) {
        final DatatypeFactory factory = XsDatatypeFactory.getDatatypeFactory();
        int year = value.getYear();
        int month = value.getMonth();
        int day = value.getDay();
        int tz = value.getTimezone();
        XMLGregorianCalendar cal = factory.newXMLGregorianCalendarDate(year, month, day, tz);
        return new GregorianDateTimeValue(cal, DATE);
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

    public void testSetExpires() throws DatatypeConfigurationException {
        SourceSequence seq = new SourceSequence(id);
       
        Expires expires = factory.createExpires();
       
        DatatypeFactory dbf = DatatypeFactory.newInstance();
        Duration d = dbf.newDuration(0);       
        expires.setValue(d);
        seq.setExpires(expires);
        assertTrue(!seq.isExpired());
       
        d = dbf.newDuration("PT0S");       
        expires.setValue(d);
        seq.setExpires(expires);
        assertTrue(!seq.isExpired());
       
        d = dbf.newDuration(1000);       
        expires.setValue(d);
        seq.setExpires(expires);
        assertTrue(!seq.isExpired());
       
        d = dbf.newDuration("-PT1S");       
        expires.setValue(d);
        seq.setExpires(expires);
        assertTrue(seq.isExpired());  
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

    }

    catch (Exception e) {
      // see if its a xsd:duration
      try {
        DatatypeFactory factory = DatatypeFactory.newInstance();
        Duration d = factory.newDuration(text);
        long secs = d.getTimeInMillis(new Date()) / 1000;
        timeUnit = new TimeUnit(secs + " secs");
      } catch (Exception e1) {
        throw new java.text.ParseException(e.getMessage(), 0);
      }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

    text = (text == null) ? "" : text.trim();
    td.text = text;

    try {
      DatatypeFactory factory = DatatypeFactory.newInstance();
      Duration d = factory.newDuration(text);
      long secs = d.getTimeInMillis(new Date()) / 1000;
      td.timeUnit = new TimeUnit(secs + " secs");
    } catch (Exception e) {
      throw new java.text.ParseException(e.getMessage(), 0);
    }
View Full Code Here

Examples of javax.xml.datatype.DatatypeFactory

  @Override
  protected void setUp()
    throws Exception
  {
    DatatypeFactory factory = DatatypeFactory.newInstance();
    XMLGregorianCalendar mar = factory.newXMLGregorianCalendar("2000-03-04T20:00:00Z");
    XMLGregorianCalendar oct = factory.newXMLGregorianCalendar("2002-10-10T12:00:00-05:00");
    date1 = vf.createLiteral(mar);
    date2 = vf.createLiteral(oct);
  }
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.