Class XmlModuleDescriptorParser

  • All Implemented Interfaces:
    ModuleDescriptorParser

    public class XmlModuleDescriptorParser
    extends AbstractModuleDescriptorParser
    Parses an xml ivy file and output a ModuleDescriptor. For dependency and performance reasons, it uses only the SAX API, which makes the parsing code harder to understand.
    • Constructor Detail

      • XmlModuleDescriptorParser

        protected XmlModuleDescriptorParser()
    • Method Detail

      • parseDescriptor

        public ModuleDescriptor parseDescriptor​(ParserSettings ivySettings,
                                                java.net.URL xmlURL,
                                                Resource res,
                                                boolean validate)
                                         throws java.text.ParseException,
                                                java.io.IOException
        Parameters:
        ivySettings - ParserSettings
        xmlURL - the url pointing to the file to parse
        res - the real resource to parse, used for log only
        validate - boolean
        Returns:
        ModuleDescriptor
        Throws:
        java.text.ParseException - if something goes wrong
        java.io.IOException - if something goes wrong
      • newParser

        protected XmlModuleDescriptorParser.Parser newParser​(ParserSettings ivySettings)
        Instantiates a Parser instance responsible for actual parsing of Ivy files.

        Override this method if you want to use a custom Parser.

        Parameters:
        ivySettings - the settings to use during parsing
        Returns:
        the Parser instance used for parsing Ivy files
      • accept

        public boolean accept​(Resource res)
      • toIvyFile

        public void toIvyFile​(java.io.InputStream is,
                              Resource res,
                              java.io.File destFile,
                              ModuleDescriptor md)
                       throws java.io.IOException,
                              java.text.ParseException
        Description copied from interface: ModuleDescriptorParser
        Convert a module descriptor to an ivy file. This method MUST close the given input stream when job is finished
        Parameters:
        is - input stream with opened on original module descriptor resource
        res - Resource
        destFile - File
        md - ModuleDescriptor
        Throws:
        java.io.IOException - if something goes wrong
        java.text.ParseException - if something goes wrong
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object