Class XmlModuleDescriptorParser.Parser

    • Field Detail

      • ALLOWED_VERSIONS

        protected static final java.util.List<java.lang.String> ALLOWED_VERSIONS
    • Method Detail

      • setInput

        public void setInput​(java.io.InputStream descriptorInput)
      • setInput

        public void setInput​(java.net.URL descriptorURL)
      • setValidate

        public void setValidate​(boolean validate)
      • parse

        public void parse()
                   throws java.text.ParseException
        Throws:
        java.text.ParseException
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes attributes)
                          throws org.xml.sax.SAXException
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • getDefaultParentLocation

        protected java.lang.String getDefaultParentLocation()
        Default parent location to check (for dev ONLY)
        Returns:
        a relative path to a parent module descriptor
      • extendsStarted

        protected void extendsStarted​(org.xml.sax.Attributes attributes)
                               throws java.text.ParseException
        Handle extends elements. It checks :
        • filesystem based on location attribute, if no one is specified it will check the default parent location
        • cache to find a resolved parent descriptor
        • ask repositories to retrieve the parent module descriptor
        Parameters:
        attributes - Attributes
        Throws:
        java.text.ParseException - if something goes wrong
      • mergeWithOtherModuleDescriptor

        protected void mergeWithOtherModuleDescriptor​(java.util.List<java.lang.String> extendTypes,
                                                      ModuleDescriptor parent)
        Merge current module with a given module descriptor and specify what should be inherited through extendTypes argument
        Parameters:
        extendTypes - specify what should be inherited
        parent - a given parent module descriptor
      • mergeAll

        protected void mergeAll​(ModuleDescriptor parent)
        Merge everything from a given parent
        Parameters:
        parent - a given parent module descriptor
      • mergeInfo

        protected void mergeInfo​(ModuleDescriptor parent)
        Explain how to inherit metadata related to info element
        Parameters:
        parent - a given parent module descriptor
      • mergeConfigurations

        protected void mergeConfigurations​(ModuleDescriptor parent)
        Describes how to merge configurations elements
        Parameters:
        parent - the module descriptor
      • mergeDependencies

        protected void mergeDependencies​(DependencyDescriptor[] dependencies)
        Describes how dependencies should be inherited
        Parameters:
        dependencies - array of dependencies to inherit
      • mergeDescription

        protected void mergeDescription​(java.lang.String description)
        Describes how to merge description
        Parameters:
        description - description going to be inherited
      • mergeLicenses

        public void mergeLicenses​(License[] licenses)
        Describes how to merge licenses
        Parameters:
        licenses - licenses going to be inherited
      • mergeExcludes

        public void mergeExcludes​(ExcludeRule[] excludeRules)
        Describes how to merge exclude rules
        Parameters:
        excludeRules - exclude rules going to be inherited
      • publicationsStarted

        protected void publicationsStarted​(org.xml.sax.Attributes attributes)
      • setPublicationsDefaultConf

        protected void setPublicationsDefaultConf​(java.lang.String defaultConf)
      • isOtherNamespace

        protected boolean isOtherNamespace​(java.lang.String qName)
      • managerStarted

        protected void managerStarted​(org.xml.sax.Attributes attributes,
                                      java.lang.String managerAtt)
      • mediationOverrideStarted

        protected void mediationOverrideStarted​(org.xml.sax.Attributes attributes)
      • includeConfStarted

        protected void includeConfStarted​(org.xml.sax.Attributes attributes)
                                   throws org.xml.sax.SAXException,
                                          java.io.IOException,
                                          javax.xml.parsers.ParserConfigurationException,
                                          java.text.ParseException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        java.text.ParseException
      • confStarted

        protected void confStarted​(org.xml.sax.Attributes attributes)
      • dependencyStarted

        protected void dependencyStarted​(org.xml.sax.Attributes attributes)
      • artifactStarted

        protected void artifactStarted​(java.lang.String qName,
                                       org.xml.sax.Attributes attributes)
                                throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • dependenciesStarted

        protected void dependenciesStarted​(org.xml.sax.Attributes attributes)
      • configurationStarted

        protected void configurationStarted​(org.xml.sax.Attributes attributes)
      • infoStarted

        protected void infoStarted​(org.xml.sax.Attributes attributes)
      • ivyModuleStarted

        protected void ivyModuleStarted​(org.xml.sax.Attributes attributes)
                                 throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException
      • addDependencyArtifacts

        protected void addDependencyArtifacts​(java.lang.String tag,
                                              org.xml.sax.Attributes attributes)
                                       throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • addIncludeRule

        protected void addIncludeRule​(java.lang.String tag,
                                      org.xml.sax.Attributes attributes)
                               throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • addExcludeRule

        protected void addExcludeRule​(java.lang.String tag,
                                      org.xml.sax.Attributes attributes)
                               throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • parseRule

        protected void parseRule​(java.lang.String tag,
                                 org.xml.sax.Attributes attributes)
                          throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • addConfiguration

        protected void addConfiguration​(java.lang.String c)
      • getPatternMatcher

        protected PatternMatcher getPatternMatcher​(java.lang.String m)
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • checkConfigurations

        protected void checkConfigurations()
      • replaceConfigurationWildcards

        protected void replaceConfigurationWildcards()
      • getDescriptorURL

        protected java.net.URL getDescriptorURL()
      • getDescriptorInput

        protected java.io.InputStream getDescriptorInput()
      • getState

        protected int getState()
      • setState

        protected void setState​(int state)
      • getArtifact

        protected MDArtifact getArtifact()
      • setArtifact

        protected void setArtifact​(MDArtifact artifact)
      • getConf

        protected java.lang.String getConf()
      • setConf

        protected void setConf​(java.lang.String conf)
      • isArtifactsDeclared

        protected boolean isArtifactsDeclared()
      • setArtifactsDeclared

        protected void setArtifactsDeclared​(boolean artifactsDeclared)
      • getBuffer

        protected java.lang.StringBuilder getBuffer()
      • setBuffer

        protected void setBuffer​(java.lang.StringBuilder buffer)
      • getDescriptorVersion

        protected java.lang.String getDescriptorVersion()
      • setDescriptorVersion

        protected void setDescriptorVersion​(java.lang.String descriptorVersion)
      • getPublicationsDefaultConf

        protected java.lang.String[] getPublicationsDefaultConf()
      • setPublicationsDefaultConf

        protected void setPublicationsDefaultConf​(java.lang.String[] publicationsDefaultConf)
      • isValidate

        protected boolean isValidate()
      • getSchemaURL

        protected java.net.URL getSchemaURL()