class ModeShapeDateTimeValueFactory extends AbstractValueFactory<DateTime> implements DateTimeFactory {

    @Override
    public DateTime create( String value ) {
        if (value == null) return null;
        try {
            return new ModeShapeDateTime(value.trim());
        } catch (java.time.format.DateTimeParseException err) {
            // See if this string represents a LONG value ...
            try {
                Long longValue = Long.parseLong(value);
                return new ModeShapeDateTime(longValue);
            } catch (NumberFormatException e) {
                // Guess it wasn't a long value ...
                throw new ValueFormatException(value, getPropertyType(),
                                               GraphI18n.errorConvertingType.text(String.class.getSimpleName(),
                                                                                  org.modeshape.jcr.api.value.DateTime.class.getSimpleName(),
                                                                                  value), err);
            }
        }
    }

    public  ModeShapeDateTimeValueFactory( TextDecoder decoder,
                                          ValueFactories factories );

}