Package com.google.refine.util
Class ParsingUtilities
java.lang.Object
com.google.refine.util.ParsingUtilities
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ser.FilterProviderstatic final com.fasterxml.jackson.databind.ObjectWriterstatic final DateTimeFormatterstatic com.fasterxml.jackson.core.JsonFactorystatic final com.fasterxml.jackson.databind.ObjectMapperstatic final com.fasterxml.jackson.databind.ser.FilterProviderstatic final com.fasterxml.jackson.databind.ObjectWriter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetDateTimecalendarToOffsetDateTime(Calendar calendar) static StringConvert a date/time to an ISO_LOCAL_DATE_TIME stringstatic StringDecode a string from UTF-8 encoding.static StringEncode a string as UTF-8.static com.fasterxml.jackson.databind.node.ArrayNodeevaluateJsonStringToArrayNode(String parameter) static com.fasterxml.jackson.databind.node.ObjectNodeevaluateJsonStringToObjectNode(String optionsString) static Stringstatic StringinputStreamToString(InputStream is, String encoding) static booleanstatic Stringstatic CalendaroffsetDateTimeToCalendar(OffsetDateTime offsetDateTime) static PropertiesparseParameters(String str) static PropertiesparseParameters(Properties p, String str) static PropertiesparseUrlParameters(javax.servlet.http.HttpServletRequest request) static OffsetDateTimeParse an ISO_LOCAL_DATE_TIME formatted string into a Java Date.static LocalDateTimestatic OffsetDateTimeConverts an old-style Java Calendar to an OffsetDateTime, assuming the date is represented in the current default system zone (which is what you get if the date was parsed using `Calendar.getDefault()`).static OffsetDateTimeConverts an old-style Java Date to an OffsetDateTime, assuming the date is represented in the current default system zone (which is what you get if the date was parsed using `Calendar.getDefault()`).
-
Field Details
-
jsonFactory
public static com.fasterxml.jackson.core.JsonFactory jsonFactory -
mapper
public static final com.fasterxml.jackson.databind.ObjectMapper mapper -
defaultFilters
public static final com.fasterxml.jackson.databind.ser.FilterProvider defaultFilters -
saveFilters
public static final com.fasterxml.jackson.databind.ser.FilterProvider saveFilters -
saveWriter
public static final com.fasterxml.jackson.databind.ObjectWriter saveWriter -
defaultWriter
public static final com.fasterxml.jackson.databind.ObjectWriter defaultWriter -
ISO8601
-
-
Constructor Details
-
ParsingUtilities
public ParsingUtilities()
-
-
Method Details
-
parseUrlParameters
-
parseParameters
-
parseParameters
-
inputStreamToString
- Throws:
IOException
-
inputStreamToString
- Throws:
IOException
-
encode
Encode a string as UTF-8. -
decode
Decode a string from UTF-8 encoding. -
dateToString
Convert a date/time to an ISO_LOCAL_DATE_TIME string- Parameters:
d- the date to be written- Returns:
- string with ISO_LOCAL_DATE_TIME formatted date & time
-
localDateToString
-
stringToDate
Parse an ISO_LOCAL_DATE_TIME formatted string into a Java Date. For backward compatibility, to support the version <= 2.8, cannot use the DateTimeFormatter.ISO_OFFSET_DATE_TIME. Instead, use the ISO8601 below format: yyyy-MM-dd'T'HH:mm:ss'Z'- Parameters:
s- the string to be parsed- Returns:
- LocalDateTime or null if the parse failed
-
stringToLocalDate
-
calendarToOffsetDateTime
-
offsetDateTimeToCalendar
-
isDate
-
toDate
Converts an old-style Java Date to an OffsetDateTime, assuming the date is represented in the current default system zone (which is what you get if the date was parsed using `Calendar.getDefault()`).- Parameters:
date-- Returns:
-
toDate
Converts an old-style Java Calendar to an OffsetDateTime, assuming the date is represented in the current default system zone (which is what you get if the date was parsed using `Calendar.getDefault()`).- Parameters:
date-- Returns:
-
evaluateJsonStringToObjectNode
public static com.fasterxml.jackson.databind.node.ObjectNode evaluateJsonStringToObjectNode(String optionsString) -
evaluateJsonStringToArrayNode
public static com.fasterxml.jackson.databind.node.ArrayNode evaluateJsonStringToArrayNode(String parameter)
-