Class XMLFragments

java.lang.Object
ca.phon.session.io.xml.XMLFragments

public final class XMLFragments extends Object
  • Constructor Details

    • XMLFragments

      public XMLFragments()
  • Method Details

    • writeFragment

      public static void writeFragment(jakarta.xml.bind.JAXBElement<?> jaxbElement, OutputStream out, boolean includeNamespace, boolean formatted) throws IOException
      Write xml fragment to given stream
      Parameters:
      jaxbElement -
      out -
      includeNamespace -
      formatted -
      Throws:
      IOException
    • toXml

      public static String toXml(Orthography orthography, boolean includeNamespace, boolean formatted) throws IOException
      Generate xml fragment for Orthogrpahy
      Parameters:
      orthography -
      includeNamespace -
      Returns:
      xml fragment for given orthography
      Throws:
      IOException - on error
    • toXml

      public static String toXml(IPATranscript ipa, boolean includeNamespace, boolean formatted) throws IOException
      Generate xml fragment for given ipa
      Parameters:
      ipa -
      includeNamespace -
      formatted -
      Returns:
      xml fragment for given ipa
      Throws:
      IOException - on error
    • toXml

      public static String toXml(Mor mor, String type, boolean includeNamespace, boolean formatted) throws IOException
      Generate xml fragment for given mor
      Parameters:
      mor -
      formatted -
      Returns:
      xml fragment for given Mor
      Throws:
      IOException
    • toXml

      public static String toXml(Grasp gra, String type, boolean includeNamespace, boolean formatted) throws IOException
      Generate xml fragment for given grasp
      Parameters:
      gra -
      formatted -
      Returns:
      xml fragment for given Grasp
      Throws:
      IOException
    • readFragment

      public static <T> T readFragment(InputStream inputStream, Class<T> type) throws IOException
      Throws:
      IOException
    • orthographyFromXml

      public static Orthography orthographyFromXml(String xml) throws IOException
      Create a new instance of Orthpgraphy from given xml
      Parameters:
      xml -
      Returns:
      orthography described by the xml
      Throws:
      IOException - on error
    • ipaFromXml

      public static IPATranscript ipaFromXml(String xml) throws IOException
      Throws:
      IOException
    • morsFromXml

      public static MorTierData morsFromXml(String xml) throws IOException
      Throws:
      IOException
    • morFromXml

      public static Mor morFromXml(String xml) throws IOException
      Throws:
      IOException
    • graFromXml

      public static Grasp graFromXml(String xml) throws IOException
      Throws:
      IOException
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception