Class XmlModuleDescriptorParser
java.lang.Object
org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser
- All Implemented Interfaces:
ModuleDescriptorParser
Parses an xml ivy file and output a ModuleDescriptor. For dependency and performance reasons, it
uses only the SAX API, which makes the parsing code harder to understand.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser
AbstractModuleDescriptorParser.AbstractParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static XmlModuleDescriptorParser
protected XmlModuleDescriptorParser.Parser
newParser
(ParserSettings ivySettings) Instantiates a Parser instance responsible for actual parsing of Ivy files.parseDescriptor
(ParserSettings ivySettings, URL xmlURL, Resource res, boolean validate) void
toIvyFile
(InputStream is, Resource res, File destFile, ModuleDescriptor md) Convert a module descriptor to an ivy file.toString()
Methods inherited from class org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser
getMetadataArtifact, getType, parseDescriptor
-
Constructor Details
-
XmlModuleDescriptorParser
protected XmlModuleDescriptorParser()
-
-
Method Details
-
getInstance
-
parseDescriptor
public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL xmlURL, Resource res, boolean validate) throws ParseException, IOException - Parameters:
ivySettings
- ParserSettingsxmlURL
- the url pointing to the file to parseres
- the real resource to parse, used for log onlyvalidate
- boolean- Returns:
- ModuleDescriptor
- Throws:
ParseException
- if something goes wrongIOException
- if something goes wrong
-
newParser
Instantiates a Parser instance responsible for actual parsing of Ivy files.Override this method if you want to use a custom Parser.
- Parameters:
ivySettings
- the settings to use during parsing- Returns:
- the Parser instance used for parsing Ivy files
-
accept
-
toIvyFile
public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) throws IOException, ParseException Description copied from interface:ModuleDescriptorParser
Convert a module descriptor to an ivy file. This method MUST close the given input stream when job is finished- Parameters:
is
- input stream with opened on original module descriptor resourceres
- ResourcedestFile
- Filemd
- ModuleDescriptor- Throws:
IOException
- if something goes wrongParseException
- if something goes wrong
-
toString
-