Class XmlToXsdExtensions


  • public final class XmlToXsdExtensions
    extends java.lang.Object
    The class XmlToXsdExtensions generates XML schema from XML files. It makes use of XMLBeans tools.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String xmlToXsd​(java.io.File xmlFile)
      Returns a xsd String from the given XML file that can used for several purposes.
      static void xmlToXsd​(java.io.File[] xmlFiles, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, java.io.File outDir, java.lang.String outPrefix)
      Creates or update the given xsd output file from the given XML file.
      static void xmlToXsd​(java.io.File xmlInputFile, java.io.File xsdOutFile)
      Creates or update the given xsd output file from the given XML file.
      static void xmlToXsd​(java.io.File xmlInputFile, java.io.File xsdOutFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
      Creates or update the given xsd output file from the given XML file.
      static void xmlToXsd​(java.io.File xmlFile, java.io.File xsdOutFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions)
      Creates or update the given xsd output file from the given XML file.
      static java.lang.String xmlToXsd​(java.io.File xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
      Returns a xsd String from the given XML file that can used for several purposes.
      static java.lang.String xmlToXsd​(java.io.File xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions)
      Returns a xsd String from the given XML file that can used for several purposes.
      static java.lang.String xmlToXsd​(java.lang.String xmlString)
      Returns a xsd String from the given XML string that can used for several purposes.
      static java.lang.String xmlToXsd​(java.lang.String xmlFile, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
      Returns a xsd String from the given XML file that can used for several purposes.
      static java.lang.String xmlToXsd​(java.lang.String xmlString, org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions, org.apache.xmlbeans.XmlOptions xmlOptions)
      Creates or update the given xsd output file from the given XML String
      • Methods inherited from class java.lang.Object

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

      • xmlToXsd

        public static java.lang.String xmlToXsd​(java.io.File xmlFile)
                                         throws org.apache.xmlbeans.XmlException,
                                                java.io.IOException
        Returns a xsd String from the given XML file that can used for several purposes.
        Parameters:
        xmlFile - the XML file
        Returns:
        the resulted xsd String
        Throws:
        org.apache.xmlbeans.XmlException - the xml exception
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static java.lang.String xmlToXsd​(java.lang.String xmlString)
                                         throws org.apache.xmlbeans.XmlException,
                                                java.io.IOException
        Returns a xsd String from the given XML string that can used for several purposes.
        Parameters:
        xmlString - the XML string
        Returns:
        the resulted xsd String
        Throws:
        org.apache.xmlbeans.XmlException - the xml exception
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static void xmlToXsd​(java.io.File xmlInputFile,
                                    java.io.File xsdOutFile)
                             throws org.apache.xmlbeans.XmlException,
                                    java.io.IOException
        Creates or update the given xsd output file from the given XML file.
        Parameters:
        xmlInputFile - the xml input file
        xsdOutFile - the xsd out file
        Throws:
        org.apache.xmlbeans.XmlException - the xml exception
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static void xmlToXsd​(java.io.File xmlInputFile,
                                    java.io.File xsdOutFile,
                                    org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
                             throws org.apache.xmlbeans.XmlException,
                                    java.io.IOException
        Creates or update the given xsd output file from the given XML file.
        Parameters:
        xmlInputFile - the xml input file
        xsdOutFile - the xsd out file
        inst2XsdOptions - the inst2 xsd options
        Throws:
        org.apache.xmlbeans.XmlException - occurs when a give xml file is invalid.
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static void xmlToXsd​(java.io.File xmlFile,
                                    java.io.File xsdOutFile,
                                    org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions,
                                    org.apache.xmlbeans.XmlOptions xmlOptions)
                             throws org.apache.xmlbeans.XmlException,
                                    java.io.IOException
        Creates or update the given xsd output file from the given XML file.
        Parameters:
        xmlFile - the xml file
        xsdOutFile - the xsd out file
        inst2XsdOptions - the inst2 xsd options
        xmlOptions - the xml options
        Throws:
        org.apache.xmlbeans.XmlException - occurs when a give xml file is invalid.
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static java.lang.String xmlToXsd​(java.io.File xmlFile,
                                                org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
                                         throws org.apache.xmlbeans.XmlException,
                                                java.io.IOException
        Returns a xsd String from the given XML file that can used for several purposes.
        Parameters:
        xmlFile - the XML file.
        inst2XsdOptions - the inst2 xsd options
        Returns:
        the resulted xsd String
        Throws:
        org.apache.xmlbeans.XmlException - occurs when a give xml file is invalid.
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static java.lang.String xmlToXsd​(java.lang.String xmlFile,
                                                org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions)
                                         throws org.apache.xmlbeans.XmlException,
                                                java.io.IOException
        Returns a xsd String from the given XML file that can used for several purposes.
        Parameters:
        xmlFile - the XML file.
        inst2XsdOptions - the inst2 xsd options
        Returns:
        the resulted xsd String
        Throws:
        org.apache.xmlbeans.XmlException - occurs when a give xml file is invalid.
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static java.lang.String xmlToXsd​(java.io.File xmlFile,
                                                org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions,
                                                org.apache.xmlbeans.XmlOptions xmlOptions)
                                         throws org.apache.xmlbeans.XmlException,
                                                java.io.IOException
        Returns a xsd String from the given XML file that can used for several purposes.
        Parameters:
        xmlFile - the xml file
        inst2XsdOptions - the inst2 xsd options
        xmlOptions - the xml options
        Returns:
        the resulted xsd String
        Throws:
        org.apache.xmlbeans.XmlException - occurs when a give xml file is invalid.
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static void xmlToXsd​(java.io.File[] xmlFiles,
                                    org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions,
                                    java.io.File outDir,
                                    java.lang.String outPrefix)
                             throws java.io.IOException
        Creates or update the given xsd output file from the given XML file.
        Parameters:
        xmlFiles - the XML files
        inst2XsdOptions - the inst2 xsd options
        outDir - The directory path for output files. Default is '.' (the current directory).
        outPrefix - The prefix for output file names. Default is "schema".
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • xmlToXsd

        public static java.lang.String xmlToXsd​(java.lang.String xmlString,
                                                org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions inst2XsdOptions,
                                                org.apache.xmlbeans.XmlOptions xmlOptions)
                                         throws org.apache.xmlbeans.XmlException,
                                                java.io.IOException
        Creates or update the given xsd output file from the given XML String
        Parameters:
        xmlString - the xml String
        inst2XsdOptions - the inst2 xsd options
        xmlOptions - the xml options
        Throws:
        org.apache.xmlbeans.XmlException - occurs when a give xml file is invalid.
        java.io.IOException - Signals that an I/O exception has occurred.