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
FieldsModifier and TypeFieldDescriptionprivate MDArtifact
private boolean
private StringBuilder
private String
private ConfigurationAware
private DefaultDependencyDescriptor
private PatternMatcher
private InputStream
private URL
private String
private Stack<ExtraInfoHolder>
private static final String
private String[]
private ParserSettings
private int
private boolean
-
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) private static boolean
isApacheOrgIvyXSDSystemId
(String systemId) 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 licensesprivate static String
mergeRevisionValue
(String inherited, String override) private static String
mergeValue
(String inherited, String override) protected 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 repositoriesprivate ModuleDescriptor
parseParentModuleOnFilesystem
(String location) Returns the parent module using the location attribute (for dev purpose).protected void
parseRule
(String tag, Attributes attributes) protected void
publicationsStarted
(Attributes attributes) protected void
resolveEntity
(String publicId, String systemId) 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, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
-
Field Details
-
ALLOWED_VERSIONS
-
IVY_XSD_CONTENT
-
settings
-
validate
private boolean validate -
descriptorURL
-
descriptorInput
-
state
private int state -
defaultMatcher
-
dd
-
confAware
-
artifact
-
conf
-
artifactsDeclared
private boolean artifactsDeclared -
buffer
-
descriptorVersion
-
publicationsDefaultConf
-
extraInfoStack
-
-
Constructor Details
-
Parser
-
-
Method Details
-
setInput
-
setInput
-
setValidate
public void setValidate(boolean validate) -
parse
- Throws:
ParseException
-
resolveEntity
- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in classDefaultHandler
- Throws:
IOException
SAXException
-
isApacheOrgIvyXSDSystemId
-
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
-
mergeRevisionValue
-
mergeValue
-
mergeValues
-
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
-
parseParentModuleOnFilesystem
private ModuleDescriptor parseParentModuleOnFilesystem(String location) throws IOException, ParseException Returns the parent module using the location attribute (for dev purpose).- Parameters:
location
- a given location- Throws:
IOException
- if something goes wrongParseException
- if something goes wrong
-
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
-