Examples of toXMLFormat()


Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

                }else{
                    xgc.setYear(cal.get(Calendar.YEAR));
                }
                xgc.setMonth(cal.get(Calendar.MONTH) + 1);
                xgc.setDay(cal.get(Calendar.DATE));
                return xgc.toXMLFormat();
            }
            // Time
            if (XMLConstants.TIME_QNAME.equals(schemaTypeQName)) {
                xgc.setTime(
                        cal.get(Calendar.HOUR_OF_DAY),
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

                xgc.setTime(
                        cal.get(Calendar.HOUR_OF_DAY),
                        cal.get(Calendar.MINUTE),
                        cal.get(Calendar.SECOND),
                        cal.get(Calendar.MILLISECOND));
                return truncateMillis(xgc.toXMLFormat());
            }
            // DateTime
            if(cal.get(Calendar.ERA) == GregorianCalendar.BC){
                xgc.setYear(-cal.get(Calendar.YEAR));
            }else{
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

                    cal.get(Calendar.HOUR_OF_DAY),
                    cal.get(Calendar.MINUTE),
                    cal.get(Calendar.SECOND),
                    cal.get(Calendar.MILLISECOND));

            return truncateMillis(xgc.toXMLFormat());
    }

    /**
     * Truncate any trailing zeros from the millisecond portion of a given string.
     * The string is assumed to be in dateTime or time format, as returned by
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

        xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
        xgc.setMinute(cal.get(Calendar.MINUTE));
        xgc.setSecond(cal.get(Calendar.SECOND));

        String string= xgc.toXMLFormat();
        string = appendMillis(string, sourceDate.getTime());
        string = appendTimeZone(string);
        return string;

    }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

        .getTimeZone("UTC"));
    utcCalendar.setTimeInMillis(cal.getTimeInMillis());

    XMLGregorianCalendar xmlCalendar = dtFactory.newXMLGregorianCalendar(utcCalendar);
    xmlCalendar = xmlCalendar.normalize();
    return xmlCalendar.toXMLFormat();
   
//    // TODO get rid of Jena dependency
//    XSDDateTime x = new XSDDateTime(utcCalendar);
//
//    StringBuffer buff = new StringBuffer();
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

        return xmlGregCal;
    }

    private static String replaceTimeToken(String string) {
        XMLGregorianCalendar calendar = getCalendar();
        return string.replace("@TIME@", calendar.toXMLFormat());
    }

    private AtomEntry getEntryWithoutContent(String id) throws Exception {
        AtomEntry entry = new AtomEntry();
        entry.setId(id);
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

   
    GregorianCalendar gregorianCalendar = (GregorianCalendar)GregorianCalendar.getInstance();
    gregorianCalendar.setTime(date);
    XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
    StringBuilder builder = new StringBuilder("<source><stringValue>stringValue</stringValue><doubleValue>1.0</doubleValue><dateValue>");
    builder.append(xmlGregorianCalendar.toXMLFormat());
    builder.append("</dateValue><simpleStringContent>simpleStringContent</simpleStringContent></source>");
   
   
    Assert.assertEquals(builder.toString(), xml);
  }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

   
    GregorianCalendar gregorianCalendar = (GregorianCalendar)GregorianCalendar.getInstance();
    gregorianCalendar.setTime(date);
    XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
    StringBuilder builder = new StringBuilder("<source><stringValue>stringValue</stringValue><doubleValue>1.0</doubleValue><dateValue>");
    builder.append(xmlGregorianCalendar.toXMLFormat());
    builder.append("</dateValue></source>");
   
   
    Assert.assertEquals(builder.toString(), xml);
  }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

    public String parse(Object object) {
      try {
        GregorianCalendar gregorianCalendar = (GregorianCalendar)GregorianCalendar.getInstance();
        gregorianCalendar.setTime((Date)object);
        XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
        return xmlGregorianCalendar.toXMLFormat();
      }
      catch (Exception ex) {
        throw new RuntimeException(ex);
      }
    }
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.toXMLFormat()

    public String parse(Object object) {
      try {
       
        GregorianCalendar gregorianCalendar = (GregorianCalendar)object;
        XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
        return xmlGregorianCalendar.toXMLFormat();
      }
      catch (Exception ex) {
        throw new RuntimeException(ex);
      }
    }
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.