Class Ecf4Helper

java.lang.Object
edu.suffolk.litlab.efsp.tyler.Ecf4Helper

public class Ecf4Helper extends Object
  • Field Details

    • MDE_PROFILE_CODE

      public static final String MDE_PROFILE_CODE
      One of the ways that you can communicate over ECF. For more information, see https://docs.oasis-open.org/legalxml-courtfiling/specs/ecf/v4.01/ecf-v4.01-spec/errata02/os/ecf-v4.01-spec-errata02-os-complete.html#_Toc425241629
      See Also:
  • Constructor Details

    • Ecf4Helper

      public Ecf4Helper()
  • Method Details

    • convertDate

      public static DateType convertDate(LocalDate date)
      Creates a date from a java date. Doesn't have time associated with it.
    • parseDate

      public static LocalDate parseDate(DateType dt)
    • convertBool

      public static Boolean convertBool(boolean bool)
      Niem's Boolean type: either true or false.
    • getNonEmptyText

      public static Optional<String> getNonEmptyText(TextType text)
    • convertText

      public static TextType convertText(String str)
      Converts a Java string to NIEM "Text", a wrapper around the NIEM String.

      "A data type for a character string"

    • convertString

      public static String convertString(String str)
      Converts a Java string to NIEM's XML String. "A datatype for character strings in XML." Practically, just a xsd:string with the extra SimpleObjectAttributeGroup attributes.
    • sizeMeasureAsBytes

      public static long sizeMeasureAsBytes(MeasureType type)
      Parameters:
      type - will always be in bytes, but this is for backup.
    • convertId

      public static IdentificationType convertId(String idStr)
    • convertId

      public static IdentificationType convertId(String idStr, String category)
    • convertDecimal

      public static Decimal convertDecimal(BigDecimal deci)
    • convertDecimal

      public static Decimal convertDecimal(int val)
      Convert an int to a BigDecimal to an XML Decimal

      Weird conversion, but the multiplier on optional services is a Decimal for some reason? "I need 2.3 copies of this sent to my office", lmao.

      Parameters:
      val -
      Returns:
    • convertUri

      public static AnyURI convertUri(String uri)
      Converts a Java string to a URI.
    • convertBase64

      public static Base64Binary convertBase64(byte[] rawContent)
    • convertCourtType

      public static CourtType convertCourtType(String courtId)
    • amountToString

      public static String amountToString(AmountType amt)
    • objectToXmlStrOrError

      public static <T> String objectToXmlStrOrError(T toXml, Class<T> toXmlClazz)
      Converts any XML annotated object (from CXF) to a string. Useful for debugging. Doesn't throw, but does return the string of the exception instead.
      Type Parameters:
      T - the type of object being passed in
      Parameters:
      toXml - The object to do things with
      Returns:
      the XML string to do what you want with
    • objectToXmlStr

      public static <T> String objectToXmlStr(T toXml, Class<T> toXmlClazz) throws jakarta.xml.bind.JAXBException
      Converts any XML annotated object (from CXF) to a string. Useful for testing. Will throw an exception if there's a JAXB error.
      Type Parameters:
      T - the type of object being passed in
      Parameters:
      toXml - The object to do things with
      Returns:
      the XML string to do what you want with
      Throws:
      jakarta.xml.bind.JAXBException
    • objectToXmlFile

      public static <T> void objectToXmlFile(T toXml, Class<T> toXmlClazz, File outfile) throws jakarta.xml.bind.JAXBException
      Converts any XML annotated object (from CXF) to a file. Useful for testing larger XML objects that are unwieldly to print. Will throw an exception if there's a JAXB error.
      Type Parameters:
      T - the type of object being passed in
      Parameters:
      toXml - The object to do things with
      Throws:
      jakarta.xml.bind.JAXBException
    • strToCountryCode

      public static CountryCodeType strToCountryCode(String country)
      Turn a given string into a country type.
    • prep

      public static <T extends QueryMessageType> T prep(T newMsg, String courtId, String locationId)
    • setupReplys

      public static void setupReplys(CaseFilingType reply, String locationId)