Class ParsingUtilities

java.lang.Object
com.google.refine.util.ParsingUtilities

public class ParsingUtilities extends Object
  • 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

      public static final DateTimeFormatter ISO8601
  • Constructor Details

    • ParsingUtilities

      public ParsingUtilities()
  • Method Details

    • parseUrlParameters

      public static Properties parseUrlParameters(javax.servlet.http.HttpServletRequest request)
    • parseParameters

      public static Properties parseParameters(Properties p, String str)
    • parseParameters

      public static Properties parseParameters(String str)
    • inputStreamToString

      public static String inputStreamToString(InputStream is) throws IOException
      Throws:
      IOException
    • inputStreamToString

      public static String inputStreamToString(InputStream is, String encoding) throws IOException
      Throws:
      IOException
    • encode

      public static String encode(String s)
      Encode a string as UTF-8.
    • decode

      public static String decode(String s)
      Decode a string from UTF-8 encoding.
    • dateToString

      public static String dateToString(OffsetDateTime d)
      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

      public static String localDateToString(LocalDateTime d)
    • stringToDate

      public static OffsetDateTime stringToDate(String s)
      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

      public static LocalDateTime stringToLocalDate(String s)
    • calendarToOffsetDateTime

      public static OffsetDateTime calendarToOffsetDateTime(Calendar calendar)
    • offsetDateTimeToCalendar

      public static Calendar offsetDateTimeToCalendar(OffsetDateTime offsetDateTime)
    • isDate

      public static boolean isDate(Object o)
    • toDate

      public static OffsetDateTime toDate(Date date)
      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

      public static OffsetDateTime toDate(Calendar date)
      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)