Java源码示例:com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl

示例1
@Override
public XMLGregorianCalendar unmarshal(String dateString) throws Exception {
    XMLGregorianCalendar calendar = null;
    GregorianCalendar cal = new GregorianCalendar();
    for (SimpleDateFormat f : RFC822_FORMATS) {
        try {
            Date d = f.parse(dateString);
            cal.setTime(d);
            DatatypeFactory dataType = DatatypeFactoryImpl.newInstance();
            calendar = dataType.newXMLGregorianCalendar(cal);
            break;
        } catch (ParseException e) {
        }
    }
    return calendar;
}
 
示例2
/**
 * Creates a new instance of the {@code DatatypeFactory} {@linkplain
 * #DATATYPEFACTORY_IMPLEMENTATION_CLASS builtin system-default
 * implementation}.
 *
 * @return A new instance of the {@code DatatypeFactory} builtin
 *         system-default implementation.
 *
 * @since 9
 */
public static DatatypeFactory newDefaultInstance() {
    return new DatatypeFactoryImpl();
}
 
示例3
/**
 * Creates a new instance of the {@code DatatypeFactory} {@linkplain
 * #DATATYPEFACTORY_IMPLEMENTATION_CLASS builtin system-default
 * implementation}.
 *
 * @return A new instance of the {@code DatatypeFactory} builtin
 *         system-default implementation.
 *
 * @since 9
 */
public static DatatypeFactory newDefaultInstance() {
    return new DatatypeFactoryImpl();
}