Class XSDHelper

java.lang.Object
com.primavera.integration.util.XSDHelper

public final class XSDHelper extends Object
Helper class for converting XSD dateTime format strings to Java dates, and vice-versa.
  • Method Details

    • getDateFromString

      public static Date getDateFromString(String sDateTime) throws InvalidValueException
      Gets a Date representation of a String that conforms to the xsd:dateTime format defined in XML Schema.
      Parameters:
      sDateTime - the string to convert
      Returns:
      Date the date representation of the value
      Throws:
      InvalidValueException - if the given string was not of the proper xsd:dateTime format
    • getStringFromDate

      public static String getStringFromDate(Date date)
      Gets a String representation of a Date, conforming to the xsd:dateTime format defined in XML Schema.
      Parameters:
      date - the date to convert
      Returns:
      String a string representation of the value
    • getDateFromStringWithTZOffset

      public static Date getDateFromStringWithTZOffset(String sDateTimeZ) throws InvalidValueException, ParseException
      Throws:
      InvalidValueException
      ParseException