org.apache.ivy.plugins.parser.xml

## Class XmlModuleDescriptorParser.Parser

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.AbstractParser
    - - org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.Parser

- All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
  Enclosing class:
    XmlModuleDescriptorParser

      public static class XmlModuleDescriptorParser.Parser
      extends AbstractModuleDescriptorParser.AbstractParser

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `XmlModuleDescriptorParser.Parser.State`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.util.List` | `ALLOWED_VERSIONS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlModuleDescriptorParser.Parser(ModuleDescriptorParser parser, ParserSettings ivySettings)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addConfiguration(java.lang.String c)`
    `protected void` | `addDependencyArtifacts(java.lang.String tag, org.xml.sax.Attributes attributes)`
    `protected void` | `addExcludeRule(java.lang.String tag, org.xml.sax.Attributes attributes)`
    `protected void` | `addIncludeRule(java.lang.String tag, org.xml.sax.Attributes attributes)`
    `protected void` | `artifactStarted(java.lang.String qName, org.xml.sax.Attributes attributes)`
    `void` | `characters(char[] ch, int start, int length)`
    `protected void` | `checkConfigurations()`
    `protected void` | `configurationStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `confStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `dependenciesStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `dependencyStarted(org.xml.sax.Attributes attributes)`
    `void` | `endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)`
    `protected void` | `extendsStarted(org.xml.sax.Attributes attributes)` Handle extends elements.
    `protected MDArtifact` | `getArtifact()`
    `protected java.lang.StringBuffer` | `getBuffer()`
    `protected java.lang.String` | `getConf()`
    `protected ConfigurationAware` | `getConfAware()`
    `protected DefaultDependencyDescriptor` | `getDd()`
    `protected PatternMatcher` | `getDefaultMatcher()`
    `protected java.lang.String` | `getDefaultParentLocation()` Default parent location to check (for dev ONLY)
    `protected java.io.InputStream` | `getDescriptorInput()`
    `protected java.net.URL` | `getDescriptorURL()`
    `protected java.lang.String` | `getDescriptorVersion()`
    `protected PatternMatcher` | `getPatternMatcher(java.lang.String m)`
    `protected java.lang.String[]` | `getPublicationsDefaultConf()`
    `protected java.net.URL` | `getSchemaURL()`
    `protected ParserSettings` | `getSettings()`
    `protected int` | `getState()`
    `protected void` | `includeConfStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `infoStarted(org.xml.sax.Attributes attributes)`
    `protected boolean` | `isArtifactsDeclared()`
    `protected boolean` | `isOtherNamespace(java.lang.String qName)`
    `protected boolean` | `isValidate()`
    `protected void` | `ivyModuleStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `managerStarted(org.xml.sax.Attributes attributes, java.lang.String managerAtt)`
    `protected void` | `mediationOverrideStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `mergeAll(ModuleDescriptor parent)` Merge everything from a given parent
    `protected void` | `mergeConfigurations(ModuleDescriptor parent)` Describes how to merge configurations elements
    `protected void` | `mergeDependencies(DependencyDescriptor[] dependencies)` Describes how dependencies should be inherited
    `protected void` | `mergeDescription(java.lang.String description)` Describes how to merge description
    `void` | `mergeExcludes(ExcludeRule[] excludeRules)` Describes how to merge exclude rules
    `protected void` | `mergeInfo(ModuleDescriptor parent)` Explain how to inherit metadatas related to info element
    `void` | `mergeLicenses(License[] licenses)` Describes how to merge licenses
    `protected void` | `mergeWithOtherModuleDescriptor(java.util.List extendTypes, ModuleDescriptor parent)` Merge current module with a given module descriptor and specify what should be inherited through extendTypes argument
    `void` | `parse()`
    `protected ModuleDescriptor` | `parseOtherIvyFile(ModuleRevisionId parentMrid)` Describe how to parse a `ModuleDescriptor` by asking repositories
    `protected void` | `parseRule(java.lang.String tag, org.xml.sax.Attributes attributes)`
    `protected void` | `publicationsStarted(org.xml.sax.Attributes attributes)`
    `protected void` | `replaceConfigurationWildcards()`
    `protected void` | `setArtifact(MDArtifact artifact)`
    `protected void` | `setArtifactsDeclared(boolean artifactsDeclared)`
    `protected void` | `setBuffer(java.lang.StringBuffer buffer)`
    `protected void` | `setConf(java.lang.String conf)`
    `protected void` | `setConfAware(ConfigurationAware confAware)`
    `protected void` | `setDd(DefaultDependencyDescriptor dd)`
    `protected void` | `setDescriptorVersion(java.lang.String descriptorVersion)`
    `void` | `setInput(java.io.InputStream descriptorInput)`
    `void` | `setInput(java.net.URL descriptorURL)`
    `protected void` | `setPublicationsDefaultConf(java.lang.String defaultConf)`
    `protected void` | `setPublicationsDefaultConf(java.lang.String[] publicationsDefaultConf)`
    `protected void` | `setState(int state)`
    `void` | `setValidate(boolean validate)`
    `void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)`

    - ### Methods inherited from class org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.AbstractParser

      `addError, checkErrors, error, fatalError, getDefaultConf, getDefaultConfMapping, getDefaultConfMappingDescriptor, getDefaultPubDate, getMd, getModuleDescriptor, getModuleDescriptorParser, getResource, parseDepsConfs, parseDepsConfs, parseDepsConfs, parseDepsConfs, parseDepsConfs, setDefaultConf, setDefaultConfMapping, setMd, setResource, warning`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ALLOWED_VERSIONS

          protected static final java.util.List ALLOWED_VERSIONS

  - ### Constructor Detail

    - #### XmlModuleDescriptorParser.Parser

          public XmlModuleDescriptorParser.Parser(ModuleDescriptorParser parser,
                                          ParserSettings ivySettings)

  - ### 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,
                            java.io.IOException

      Throws:
        `java.text.ParseException`
        `java.io.IOException`

    - #### 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` -
      Throws:
        `java.text.ParseException`

    - #### mergeWithOtherModuleDescriptor

          protected void mergeWithOtherModuleDescriptor(java.util.List extendTypes,
                                            ModuleDescriptor parent)
                                                 throws java.text.ParseException

      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
      Throws:
        `java.text.ParseException`

    - #### mergeAll

          protected void mergeAll(ModuleDescriptor parent)

      Merge everything from a given parent
      Parameters:
        `parent` - a given parent module desciptor

    - #### mergeInfo

          protected void mergeInfo(ModuleDescriptor parent)

      Explain how to inherit metadatas related to info element
      Parameters:
        `parent` - a given parent module decriptor

    - #### mergeConfigurations

          protected void mergeConfigurations(ModuleDescriptor parent)

      Describes how to merge configurations elements
      Parameters:
        `sourceMrid` - the source module revision id
        `configurations` - array of configurations to be inherited

    - #### 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

    - #### parseOtherIvyFile

          protected ModuleDescriptor parseOtherIvyFile(ModuleRevisionId parentMrid)
                                                throws java.text.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:
        `java.text.ParseException`

    - #### 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()

    - #### getSettings

          protected ParserSettings getSettings()

    - #### getDescriptorURL

          protected java.net.URL getDescriptorURL()

    - #### getDescriptorInput

          protected java.io.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 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.StringBuffer getBuffer()

    - #### setBuffer

          protected void setBuffer(java.lang.StringBuffer 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()