Class XMLToVinci


  • public class XMLToVinci
    extends java.lang.Object
    Class for parsing an XML document and representing it using any of the various jVinci-compatible document models.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static javax.xml.parsers.SAXParserFactory spf  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private XMLToVinci()
      Utility class not intended to be instantiated.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static AFrame xmlToAFrame​(java.io.Reader r)
      Convert the XML document (provided as a Reader) to the AFrame document model.
      static Transportable xmlToTransportable​(java.io.Reader r, Transportable empty)
      Populate the empty document with the XML yielded by the provided reader.
      static VinciFrame xmlToVinciFrame​(java.io.Reader r)
      Convert the XML document (provided as a Reader) to a VinciFrame document model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • spf

        private static final javax.xml.parsers.SAXParserFactory spf
    • Constructor Detail

      • XMLToVinci

        private XMLToVinci()
        Utility class not intended to be instantiated.
    • Method Detail

      • xmlToTransportable

        public static Transportable xmlToTransportable​(java.io.Reader r,
                                                       Transportable empty)
                                                throws ServiceException
        Populate the empty document with the XML yielded by the provided reader.
        Parameters:
        empty - An empty document to be populated.
        r - A reader providing the XML to populate the empty document.
        Returns:
        -
        Throws:
        ServiceException - if there is a parse error.
      • xmlToVinciFrame

        public static VinciFrame xmlToVinciFrame​(java.io.Reader r)
                                          throws ServiceException
        Convert the XML document (provided as a Reader) to a VinciFrame document model. Throws ServiceException if the XML parser reports any error. WARNING: This method will silently ignore any attributes or processing instructions within the document since VinciFrame cannot represent them. Consider using AFrame if attribute support is required. This implementation of xmlToVinciFrame uses apache SAX parser directly. It should be faster, and it should be tolerant of undeclared namespaces, unlike the previous impl.
        Parameters:
        r - A reader providing the XML to convert.
        Returns:
        -
        Throws:
        ServiceException - if there is a parse error.
      • xmlToAFrame

        public static AFrame xmlToAFrame​(java.io.Reader r)
                                  throws ServiceException
        Convert the XML document (provided as a Reader) to the AFrame document model. Throws ServiceException if the XML parser reports any error. WARNING: This method will silently ignore any processing instructions within the document since AFrame cannot represent them.
        Parameters:
        r - A reader providing the XML to convert.
        Returns:
        -
        Throws:
        ServiceException - if there is a parse error.