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 Description static classXmlModuleDescriptorParser.Parser.State
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List<java.lang.String>ALLOWED_VERSIONS
-
Constructor Summary
Constructors Constructor Description Parser(ModuleDescriptorParser parser, ParserSettings ivySettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConfiguration(java.lang.String c)protected voidaddDependencyArtifacts(java.lang.String tag, org.xml.sax.Attributes attributes)protected voidaddExcludeRule(java.lang.String tag, org.xml.sax.Attributes attributes)protected voidaddIncludeRule(java.lang.String tag, org.xml.sax.Attributes attributes)protected voidartifactStarted(java.lang.String qName, org.xml.sax.Attributes attributes)voidcharacters(char[] ch, int start, int length)protected voidcheckConfigurations()protected voidconfigurationStarted(org.xml.sax.Attributes attributes)protected voidconfStarted(org.xml.sax.Attributes attributes)protected voiddependenciesStarted(org.xml.sax.Attributes attributes)protected voiddependencyStarted(org.xml.sax.Attributes attributes)voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)protected voidextendsStarted(org.xml.sax.Attributes attributes)Handle extends elements.protected MDArtifactgetArtifact()protected java.lang.StringBuildergetBuffer()protected java.lang.StringgetConf()protected ConfigurationAwaregetConfAware()protected DefaultDependencyDescriptorgetDd()protected PatternMatchergetDefaultMatcher()protected java.lang.StringgetDefaultParentLocation()Default parent location to check (for dev ONLY)protected java.io.InputStreamgetDescriptorInput()protected java.net.URLgetDescriptorURL()protected java.lang.StringgetDescriptorVersion()protected PatternMatchergetPatternMatcher(java.lang.String m)protected java.lang.String[]getPublicationsDefaultConf()protected java.net.URLgetSchemaURL()protected ParserSettingsgetSettings()protected intgetState()protected voidincludeConfStarted(org.xml.sax.Attributes attributes)protected voidinfoStarted(org.xml.sax.Attributes attributes)protected booleanisArtifactsDeclared()protected booleanisOtherNamespace(java.lang.String qName)protected booleanisValidate()protected voidivyModuleStarted(org.xml.sax.Attributes attributes)protected voidmanagerStarted(org.xml.sax.Attributes attributes, java.lang.String managerAtt)protected voidmediationOverrideStarted(org.xml.sax.Attributes attributes)protected voidmergeAll(ModuleDescriptor parent)Merge everything from a given parentprotected voidmergeConfigurations(ModuleDescriptor parent)Describes how to merge configurations elementsprotected voidmergeDependencies(DependencyDescriptor[] dependencies)Describes how dependencies should be inheritedprotected voidmergeDescription(java.lang.String description)Describes how to merge descriptionvoidmergeExcludes(ExcludeRule[] excludeRules)Describes how to merge exclude rulesprotected voidmergeInfo(ModuleDescriptor parent)Explain how to inherit metadata related to info elementvoidmergeLicenses(License[] licenses)Describes how to merge licensesprotected voidmergeWithOtherModuleDescriptor(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 argumentvoidparse()protected ModuleDescriptorparseOtherIvyFile(ModuleRevisionId parentMrid)Describe how to parse aModuleDescriptorby asking repositoriesprotected voidparseRule(java.lang.String tag, org.xml.sax.Attributes attributes)protected voidpublicationsStarted(org.xml.sax.Attributes attributes)protected voidreplaceConfigurationWildcards()org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)protected voidsetArtifact(MDArtifact artifact)protected voidsetArtifactsDeclared(boolean artifactsDeclared)protected voidsetBuffer(java.lang.StringBuilder buffer)protected voidsetConf(java.lang.String conf)protected voidsetConfAware(ConfigurationAware confAware)protected voidsetDd(DefaultDependencyDescriptor dd)protected voidsetDescriptorVersion(java.lang.String descriptorVersion)voidsetInput(java.io.InputStream descriptorInput)voidsetInput(java.net.URL descriptorURL)protected voidsetPublicationsDefaultConf(java.lang.String defaultConf)protected voidsetPublicationsDefaultConf(java.lang.String[] publicationsDefaultConf)protected voidsetState(int state)voidsetValidate(boolean validate)voidstartElement(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
-
-
-
-
Constructor Detail
-
Parser
public 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- Throws:
java.text.ParseException
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException- Specified by:
resolveEntityin interfaceorg.xml.sax.EntityResolver- Overrides:
resolveEntityin classorg.xml.sax.helpers.DefaultHandler- Throws:
java.io.IOExceptionorg.xml.sax.SAXException
-
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:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.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.ParseExceptionHandle 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 inheritedparent- 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
-
parseOtherIvyFile
protected ModuleDescriptor parseOtherIvyFile(ModuleRevisionId parentMrid) throws java.text.ParseException
Describe how to parse aModuleDescriptorby asking repositories- Parameters:
parentMrid- a givenModuleRevisionIdto find- Returns:
- a
ModuleDescriptorif found. Return null if noModuleDescriptorwas found - Throws:
java.text.ParseException- if something goes wrong
-
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.SAXExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionjava.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:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.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:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.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.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()
-
-