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:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Enclosing class:
- XmlModuleDescriptorParser
public static class XmlModuleDescriptorParser.Parser
extends AbstractModuleDescriptorParser.AbstractParser
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
addDependencyArtifacts
(String tag, Attributes attributes) protected void
addExcludeRule
(String tag, Attributes attributes) protected void
addIncludeRule
(String tag, Attributes attributes) protected void
artifactStarted
(String qName, Attributes attributes) void
characters
(char[] ch, int start, int length) protected void
protected void
configurationStarted
(Attributes attributes) protected void
confStarted
(Attributes attributes) protected void
dependenciesStarted
(Attributes attributes) protected void
dependencyStarted
(Attributes attributes) void
endElement
(String uri, String localName, String qName) protected void
extendsStarted
(Attributes attributes) Handle extends elements.protected MDArtifact
protected StringBuilder
protected String
getConf()
protected ConfigurationAware
protected DefaultDependencyDescriptor
getDd()
protected PatternMatcher
protected String
Default parent location to check (for dev ONLY)protected InputStream
protected URL
protected String
protected PatternMatcher
protected String[]
protected URL
protected ParserSettings
protected int
getState()
protected void
includeConfStarted
(Attributes attributes) protected void
infoStarted
(Attributes attributes) protected boolean
protected boolean
isOtherNamespace
(String qName) protected boolean
protected void
ivyModuleStarted
(Attributes attributes) protected void
managerStarted
(Attributes attributes, String managerAtt) protected void
mediationOverrideStarted
(Attributes attributes) protected void
mergeAll
(ModuleDescriptor parent) Merge everything from a given parentprotected void
mergeConfigurations
(ModuleDescriptor parent) Describes how to merge configurations elementsprotected void
mergeDependencies
(DependencyDescriptor[] dependencies) Describes how dependencies should be inheritedprotected void
mergeDescription
(String description) Describes how to merge descriptionvoid
mergeExcludes
(ExcludeRule[] excludeRules) Describes how to merge exclude rulesprotected void
mergeInfo
(ModuleDescriptor parent) Explain how to inherit metadata related to info elementvoid
mergeLicenses
(License[] licenses) Describes how to merge licensesprotected void
mergeWithOtherModuleDescriptor
(List<String> extendTypes, ModuleDescriptor parent) Merge current module with a given module descriptor and specify what should be inherited through extendTypes argumentvoid
parse()
protected ModuleDescriptor
parseOtherIvyFile
(ModuleRevisionId parentMrid) Describe how to parse aModuleDescriptor
by asking repositoriesprotected void
parseRule
(String tag, Attributes attributes) protected void
publicationsStarted
(Attributes attributes) protected void
protected void
setArtifact
(MDArtifact artifact) protected void
setArtifactsDeclared
(boolean artifactsDeclared) protected void
setBuffer
(StringBuilder buffer) protected void
protected void
setConfAware
(ConfigurationAware confAware) protected void
protected void
setDescriptorVersion
(String descriptorVersion) void
setInput
(InputStream descriptorInput) void
protected void
setPublicationsDefaultConf
(String defaultConf) protected void
setPublicationsDefaultConf
(String[] publicationsDefaultConf) protected void
setState
(int state) void
setValidate
(boolean validate) void
startElement
(String uri, String localName, String qName, 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
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
ALLOWED_VERSIONS
-
-
Constructor Details
-
Parser
-
-
Method Details
-
setInput
-
setInput
-
setValidate
public void setValidate(boolean validate) -
parse
- Throws:
ParseException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
getDefaultParentLocation
Default parent location to check (for dev ONLY)- Returns:
- a relative path to a parent module descriptor
-
extendsStarted
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
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
Merge everything from a given parent- Parameters:
parent
- a given parent module descriptor
-
mergeInfo
Explain how to inherit metadata related to info element- Parameters:
parent
- a given parent module descriptor
-
mergeConfigurations
Describes how to merge configurations elements- Parameters:
parent
- the module descriptor
-
mergeDependencies
Describes how dependencies should be inherited- Parameters:
dependencies
- array of dependencies to inherit
-
mergeDescription
Describes how to merge description- Parameters:
description
- description going to be inherited
-
mergeLicenses
Describes how to merge licenses- Parameters:
licenses
- licenses going to be inherited
-
mergeExcludes
Describes how to merge exclude rules- Parameters:
excludeRules
- exclude rules going to be inherited
-
parseOtherIvyFile
Describe how to parse aModuleDescriptor
by asking repositories- Parameters:
parentMrid
- a givenModuleRevisionId
to find- Returns:
- a
ModuleDescriptor
if found. Return null if noModuleDescriptor
was found - Throws:
ParseException
- if something goes wrong
-
publicationsStarted
-
setPublicationsDefaultConf
-
isOtherNamespace
-
managerStarted
-
mediationOverrideStarted
-
includeConfStarted
protected void includeConfStarted(Attributes attributes) throws SAXException, IOException, ParserConfigurationException, ParseException -
confStarted
-
dependencyStarted
-
artifactStarted
- Throws:
MalformedURLException
-
dependenciesStarted
-
configurationStarted
-
infoStarted
-
ivyModuleStarted
- Throws:
SAXException
-
addDependencyArtifacts
protected void addDependencyArtifacts(String tag, Attributes attributes) throws MalformedURLException - Throws:
MalformedURLException
-
addIncludeRule
- Throws:
MalformedURLException
-
addExcludeRule
- Throws:
MalformedURLException
-
parseRule
- Throws:
MalformedURLException
-
addConfiguration
-
getPatternMatcher
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
checkConfigurations
protected void checkConfigurations() -
replaceConfigurationWildcards
protected void replaceConfigurationWildcards() -
getSettings
-
getDescriptorURL
-
getDescriptorInput
-
getState
protected int getState() -
setState
protected void setState(int state) -
getDefaultMatcher
-
getDd
-
setDd
-
getConfAware
-
setConfAware
-
getArtifact
-
setArtifact
-
getConf
-
setConf
-
isArtifactsDeclared
protected boolean isArtifactsDeclared() -
setArtifactsDeclared
protected void setArtifactsDeclared(boolean artifactsDeclared) -
getBuffer
-
setBuffer
-
getDescriptorVersion
-
setDescriptorVersion
-
getPublicationsDefaultConf
-
setPublicationsDefaultConf
-
isValidate
protected boolean isValidate() -
getSchemaURL
-