Code example for DatatypeFactory

Methods: newXMLGregorianCalendar

0
        setTypeClass(XMLGregorianCalendar.class);
    } 
 
    @Override 
    public Object readObject(MessageReader reader, Context context) {
        return dtFactory.newXMLGregorianCalendar(reader.getValue().trim());
    } 
 
    @Override 
    public void writeObject(Object object, MessageWriter writer, Context context) {
        writer.writeValue(((XMLGregorianCalendar)object).toXMLFormat());
    } 
} 
Experience pair programming with AI  Get Codota for Java