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 voidprotected voidaddDependencyArtifacts(String tag, Attributes attributes) protected voidaddExcludeRule(String tag, Attributes attributes) protected voidaddIncludeRule(String tag, Attributes attributes) protected voidartifactStarted(String qName, Attributes attributes) voidcharacters(char[] ch, int start, int length) protected voidprotected voidconfigurationStarted(Attributes attributes) protected voidconfStarted(Attributes attributes) protected voiddependenciesStarted(Attributes attributes) protected voiddependencyStarted(Attributes attributes) voidendElement(String uri, String localName, String qName) protected voidextendsStarted(Attributes attributes) Handle extends elements.protected MDArtifactprotected StringBuilderprotected StringgetConf()protected ConfigurationAwareprotected DefaultDependencyDescriptorgetDd()protected PatternMatcherprotected StringDefault parent location to check (for dev ONLY)protected InputStreamprotected URLprotected Stringprotected PatternMatcherprotected String[]protected URLprotected ParserSettingsprotected intgetState()protected voidincludeConfStarted(Attributes attributes) protected voidinfoStarted(Attributes attributes) protected booleanprotected booleanisOtherNamespace(String qName) protected booleanprotected voidivyModuleStarted(Attributes attributes) protected voidmanagerStarted(Attributes attributes, String managerAtt) protected voidmediationOverrideStarted(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(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(List<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(String tag, Attributes attributes) protected voidpublicationsStarted(Attributes attributes) protected voidresolveEntity(String publicId, String systemId) protected voidsetArtifact(MDArtifact artifact) protected voidsetArtifactsDeclared(boolean artifactsDeclared) protected voidsetBuffer(StringBuilder buffer) protected voidprotected voidsetConfAware(ConfigurationAware confAware) protected voidprotected voidsetDescriptorVersion(String descriptorVersion) voidsetInput(InputStream descriptorInput) voidprotected voidsetPublicationsDefaultConf(String defaultConf) protected voidsetPublicationsDefaultConf(String[] publicationsDefaultConf) protected voidsetState(int state) voidsetValidate(boolean validate) voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class AbstractModuleDescriptorParser.AbstractParser
addError, checkErrors, error, fatalError, getDefaultConf, getDefaultConfMapping, getDefaultConfMappingDescriptor, getDefaultPubDate, getMd, getModuleDescriptor, getModuleDescriptorParser, getResource, parseDepsConfs, parseDepsConfs, parseDepsConfs, parseDepsConfs, parseDepsConfs, setDefaultConf, setDefaultConfMapping, setMd, setResource, warningMethods inherited from class DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDeclMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentHandler
declaration
-
Field Details
-
ALLOWED_VERSIONS
-
-
Constructor Details
-
Parser
-
-
Method Details
-
setInput
-
setInput
-
setValidate
public void setValidate(boolean validate) -
parse
- Throws:
ParseException
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler- Throws:
IOExceptionSAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin 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 aModuleDescriptorby asking repositories- Parameters:
parentMrid- a givenModuleRevisionIdto find- Returns:
- a
ModuleDescriptorif found. Return null if noModuleDescriptorwas 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:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin 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
-