Class XmlModuleDescriptorParser.Parser

All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Enclosing class:
XmlModuleDescriptorParser

public static class XmlModuleDescriptorParser.Parser extends AbstractModuleDescriptorParser.AbstractParser
  • Field Details

    • ALLOWED_VERSIONS

      protected static final List<String> ALLOWED_VERSIONS
  • Constructor Details

  • Method Details

    • setInput

      public void setInput(InputStream descriptorInput)
    • setInput

      public void setInput(URL descriptorURL)
    • setValidate

      public void setValidate(boolean validate)
    • parse

      public void parse() throws ParseException
      Throws:
      ParseException
    • startElement

      public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class DefaultHandler
      Throws:
      SAXException
    • getDefaultParentLocation

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

      protected void extendsStarted(Attributes attributes) throws 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:
      ParseException - if something goes wrong
    • mergeWithOtherModuleDescriptor

      protected void mergeWithOtherModuleDescriptor(List<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(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
    • parseOtherIvyFile

      protected ModuleDescriptor parseOtherIvyFile(ModuleRevisionId parentMrid) throws ParseException
      Describe how to parse a ModuleDescriptor by asking repositories
      Parameters:
      parentMrid - a given ModuleRevisionId to find
      Returns:
      a ModuleDescriptor if found. Return null if no ModuleDescriptor was found
      Throws:
      ParseException - if something goes wrong
    • publicationsStarted

      protected void publicationsStarted(Attributes attributes)
    • setPublicationsDefaultConf

      protected void setPublicationsDefaultConf(String defaultConf)
    • isOtherNamespace

      protected boolean isOtherNamespace(String qName)
    • managerStarted

      protected void managerStarted(Attributes attributes, String managerAtt)
    • mediationOverrideStarted

      protected void mediationOverrideStarted(Attributes attributes)
    • includeConfStarted

      protected void includeConfStarted(Attributes attributes) throws SAXException, IOException, ParserConfigurationException, ParseException
      Throws:
      SAXException
      IOException
      ParserConfigurationException
      ParseException
    • confStarted

      protected void confStarted(Attributes attributes)
    • dependencyStarted

      protected void dependencyStarted(Attributes attributes)
    • artifactStarted

      protected void artifactStarted(String qName, Attributes attributes) throws MalformedURLException
      Throws:
      MalformedURLException
    • dependenciesStarted

      protected void dependenciesStarted(Attributes attributes)
    • configurationStarted

      protected void configurationStarted(Attributes attributes)
    • infoStarted

      protected void infoStarted(Attributes attributes)
    • ivyModuleStarted

      protected void ivyModuleStarted(Attributes attributes) throws SAXException
      Throws:
      SAXException
    • addDependencyArtifacts

      protected void addDependencyArtifacts(String tag, Attributes attributes) throws MalformedURLException
      Throws:
      MalformedURLException
    • addIncludeRule

      protected void addIncludeRule(String tag, Attributes attributes) throws MalformedURLException
      Throws:
      MalformedURLException
    • addExcludeRule

      protected void addExcludeRule(String tag, Attributes attributes) throws MalformedURLException
      Throws:
      MalformedURLException
    • parseRule

      protected void parseRule(String tag, Attributes attributes) throws MalformedURLException
      Throws:
      MalformedURLException
    • addConfiguration

      protected void addConfiguration(String c)
    • getPatternMatcher

      protected PatternMatcher getPatternMatcher(String m)
    • characters

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

      public void endElement(String uri, String localName, String qName) throws SAXException
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class DefaultHandler
      Throws:
      SAXException
    • checkConfigurations

      protected void checkConfigurations()
    • replaceConfigurationWildcards

      protected void replaceConfigurationWildcards()
    • getSettings

      protected ParserSettings getSettings()
    • getDescriptorURL

      protected URL getDescriptorURL()
    • getDescriptorInput

      protected InputStream getDescriptorInput()
    • getState

      protected int getState()
    • setState

      protected void setState(int state)
    • getDefaultMatcher

      protected PatternMatcher getDefaultMatcher()
    • getDd

      protected DefaultDependencyDescriptor getDd()
    • setDd

      protected void setDd(DefaultDependencyDescriptor dd)
    • getConfAware

      protected ConfigurationAware getConfAware()
    • setConfAware

      protected void setConfAware(ConfigurationAware confAware)
    • getArtifact

      protected MDArtifact getArtifact()
    • setArtifact

      protected void setArtifact(MDArtifact artifact)
    • getConf

      protected String getConf()
    • setConf

      protected void setConf(String conf)
    • isArtifactsDeclared

      protected boolean isArtifactsDeclared()
    • setArtifactsDeclared

      protected void setArtifactsDeclared(boolean artifactsDeclared)
    • getBuffer

      protected StringBuilder getBuffer()
    • setBuffer

      protected void setBuffer(StringBuilder buffer)
    • getDescriptorVersion

      protected String getDescriptorVersion()
    • setDescriptorVersion

      protected void setDescriptorVersion(String descriptorVersion)
    • getPublicationsDefaultConf

      protected String[] getPublicationsDefaultConf()
    • setPublicationsDefaultConf

      protected void setPublicationsDefaultConf(String[] publicationsDefaultConf)
    • isValidate

      protected boolean isValidate()
    • getSchemaURL

      protected URL getSchemaURL()