Example usage for javax.xml.datatype DatatypeFactory newInstance

List of usage examples for javax.xml.datatype DatatypeFactory newInstance

Introduction

In this page you can find the example usage for javax.xml.datatype DatatypeFactory newInstance.

Prototype

public static DatatypeFactory newInstance() throws DatatypeConfigurationException 

Source Link

Document

Obtain a new instance of a DatatypeFactory .

Usage

From source file:test.unit.be.e_contract.dssp.client.DigitalSignatureServiceTestPort.java

public DigitalSignatureServiceTestPort() {
    this.objectFactory = new ObjectFactory();
    this.asyncObjectFactory = new be.e_contract.dssp.ws.jaxb.dss.async.ObjectFactory();
    this.wstObjectFactory = new be.e_contract.dssp.ws.jaxb.wst.ObjectFactory();
    this.wsscObjectFactory = new be.e_contract.dssp.ws.jaxb.wssc.ObjectFactory();
    this.vrObjectFactory = new be.e_contract.dssp.ws.jaxb.dss.vr.ObjectFactory();
    this.xmldsigObjectFactory = new be.e_contract.dssp.ws.jaxb.xmldsig.ObjectFactory();
    this.dsspObjectFactory = new be.e_contract.dssp.ws.jaxb.dssp.ObjectFactory();
    try {//from   w w w .j ava2  s.com
        this.datatypeFactory = DatatypeFactory.newInstance();
    } catch (DatatypeConfigurationException e) {
        throw new RuntimeException("datatype factory error: " + e.getMessage(), e);
    }
}

From source file:ws.michalski.sepa.pain.SEPAUtility.java

/**
 * Konvertiert zwischen GregorianCalender und XMLGregorianCalender Datum und Zeit
 * /*from ww w .  jav  a  2  s  . c  o m*/
 * @param calendar
 * @return
 */
public static XMLGregorianCalendar convert(GregorianCalendar calendar) {

    XMLGregorianCalendar xmlCal = null;
    try {
        xmlCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar);
    } catch (DatatypeConfigurationException e) {
        log.error(e);
    }

    return xmlCal;
}

From source file:ws.michalski.sepa.pain.SEPAUtility.java

/**
 * Konvertiert zwischen GregorianCalender und XMLGregorianCalender Datum und Zeit
 * /*from   w  w w.  jav  a 2 s.c o m*/
 * @param calendar
 * @return
 */
public static XMLGregorianCalendar convertYearOnly(GregorianCalendar calendar) {

    XMLGregorianCalendar xmlCal = null;
    try {
        String str = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime());
        xmlCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(str);
    } catch (DatatypeConfigurationException e) {
        log.error(e);
    }

    return xmlCal;
}